[issm-svn] r11527 - issm/trunk

morlighe at issm.ess.uci.edu morlighe at issm.ess.uci.edu
Fri Feb 24 08:12:48 PST 2012


Author: morlighe
Date: 2012-02-24 08:12:47 -0800 (Fri, 24 Feb 2012)
New Revision: 11527

Added:
   issm/trunk/README.rtf
   issm/trunk/ar-lib
   issm/trunk/configs/config-greenplanet.sh
   issm/trunk/configs/config-win7-32.sh
   issm/trunk/configs/config-win7-64.sh
   issm/trunk/cron/configs/linux64_schlegel_daily
   issm/trunk/cron/configs/linux64_schlegel_nightly
   issm/trunk/cron/configs/linux64_schlegel_ucitrunk
   issm/trunk/cron/configs/linux64_schlegel_validation
   issm/trunk/externalpackages/android/
   issm/trunk/externalpackages/android/HelloWorldAppProject/
   issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug.apk
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/HelloWorldAppActivity.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$attr.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$layout.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$string.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/res/
   issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java
   issm/trunk/externalpackages/android/HelloWorldAppProject/libs/
   issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg
   issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java
   issm/trunk/externalpackages/android/README
   issm/trunk/externalpackages/autoconf/autoconf-2.68.tar.gz
   issm/trunk/externalpackages/automake/automake-1.11.3.tar.gz
   issm/trunk/externalpackages/bsdtar/
   issm/trunk/externalpackages/bsdtar/install-win7.sh
   issm/trunk/externalpackages/bsdtar/libarchive-3.0.3.tar.gz
   issm/trunk/externalpackages/cccl/
   issm/trunk/externalpackages/cccl/cccl-0.03.tar.gz
   issm/trunk/externalpackages/cccl/install-win7.orig.sh
   issm/trunk/externalpackages/cccl/install-win7.sh
   issm/trunk/externalpackages/cccl/issm/
   issm/trunk/externalpackages/cccl/issm/cccl
   issm/trunk/externalpackages/intel/intel-windows7.sh
   issm/trunk/externalpackages/metis/configs/4.0/greenplanet/
   issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch
   issm/trunk/externalpackages/metis/configs/4.0/win7/
   issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch
   issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch
   issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh
   issm/trunk/externalpackages/metis/install-4.0-win7.sh
   issm/trunk/externalpackages/petsc/install-2.3.2-win7.sh
   issm/trunk/externalpackages/petsc/install-3.1-win7.sh
   issm/trunk/externalpackages/petsc/install-3.2-greenplanet.sh
   issm/trunk/externalpackages/tao/tao-2.0-p3.tar.gz
   issm/trunk/externalpackages/triangle/configs/win7/
   issm/trunk/externalpackages/triangle/configs/win7/configure.make
   issm/trunk/externalpackages/triangle/configs/win7/makefile
   issm/trunk/externalpackages/triangle/install-win7.sh
   issm/trunk/externalpackages/win7/
   issm/trunk/externalpackages/win7/notes
   issm/trunk/externalpackages/win7/sdk7.1.32bits.sh
   issm/trunk/externalpackages/win7/sdk7.1.64bits.sh
   issm/trunk/externalpackages/win7/vs10.0.sh
   issm/trunk/externalpackages/win7/winsdk_web.exe
   issm/trunk/installers/
   issm/trunk/installers/macosx/
   issm/trunk/installers/macosx/ISSM.pmdoc/
   issm/trunk/installers/macosx/ISSM.pmdoc/index.xml
   issm/trunk/installers/win7/
   issm/trunk/installers/win7/ISSM.initial.aip
   issm/trunk/installers/win7/ISSMlogo.ico
   issm/trunk/installers/win7/aic.sh
   issm/trunk/m4/ar-lib.m4
   issm/trunk/scripts/intel-compile.sh
   issm/trunk/scripts/matlabissm.bat
   issm/trunk/scripts/wincron.sh
   issm/trunk/src/c/modules/CreateJacobianMatrixx/
   issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
   issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
   issm/trunk/src/c/modules/GetVectorFromControlInputsx/
   issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
   issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
   issm/trunk/src/c/modules/KMLFileReadx/
   issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp
   issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h
   issm/trunk/src/c/modules/PositiveDegreeDayx/
   issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp
   issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h
   issm/trunk/src/c/modules/SetControlInputsFromVectorx/
   issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
   issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
   issm/trunk/src/c/modules/SmearFunctionx/
   issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp
   issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h
   issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp
   issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h
   issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp
   issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h
   issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp
   issm/trunk/src/c/objects/Inputs/PentaP1Input.h
   issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp
   issm/trunk/src/c/objects/Inputs/TriaP1Input.h
   issm/trunk/src/c/objects/KML/KML_Unknown.cpp
   issm/trunk/src/c/objects/KML/KML_Unknown.h
   issm/trunk/src/c/solutions/enthalpy_core_step.cpp
   issm/trunk/src/c/solvers/solver_newton.cpp
   issm/trunk/src/m/Makefile.am
   issm/trunk/src/m/classes/@modellist/Makefile.am
   issm/trunk/src/m/classes/@pairoptions/Makefile.am
   issm/trunk/src/m/classes/Makefile.am
   issm/trunk/src/m/classes/clusters/Makefile.am
   issm/trunk/src/m/classes/clusters/greenplanet.m
   issm/trunk/src/m/classes/model/Makefile.am
   issm/trunk/src/m/enum/DiagnosticIsnewtonEnum.m
   issm/trunk/src/m/enum/InversionIncompleteAdjointEnum.m
   issm/trunk/src/m/enum/InversionTaoEnum.m
   issm/trunk/src/m/enum/Makefile.am
   issm/trunk/src/m/enum/PentaP1ElementResultEnum.m
   issm/trunk/src/m/enum/PentaP1InputEnum.m
   issm/trunk/src/m/enum/SurfaceforcingsPrecipitationEnum.m
   issm/trunk/src/m/enum/ThermalIsenthalpyEnum.m
   issm/trunk/src/m/enum/TriaP1ElementResultEnum.m
   issm/trunk/src/m/enum/TriaP1InputEnum.m
   issm/trunk/src/m/kml/Makefile.am
   issm/trunk/src/m/model/Makefile.am
   issm/trunk/src/m/model/display/Makefile.am
   issm/trunk/src/m/model/mesh/Makefile.am
   issm/trunk/src/m/model/parameterization/Makefile.am
   issm/trunk/src/m/model/partition/Makefile.am
   issm/trunk/src/m/model/plot/Makefile.am
   issm/trunk/src/m/model/plot/plot_icefront.m
   issm/trunk/src/m/model/solvers/Makefile.am
   issm/trunk/src/m/planet/Makefile.am
   issm/trunk/src/m/qmu/Makefile.am
   issm/trunk/src/m/shared/Makefile.am
   issm/trunk/src/m/solutions/Makefile.am
   issm/trunk/src/m/solutions/enthalpy_core_step.m
   issm/trunk/src/m/solvers/Makefile.am
   issm/trunk/src/m/solvers/solver_newton.m
   issm/trunk/src/m/utils/Analysis/Makefile.am
   issm/trunk/src/m/utils/Array/Makefile.am
   issm/trunk/src/m/utils/BC/Makefile.am
   issm/trunk/src/m/utils/Basins/Makefile.am
   issm/trunk/src/m/utils/Cluster/Makefile.am
   issm/trunk/src/m/utils/DataProcessing/Makefile.am
   issm/trunk/src/m/utils/Ecco3/Makefile.am
   issm/trunk/src/m/utils/Exp/Makefile.am
   issm/trunk/src/m/utils/Geometry/Makefile.am
   issm/trunk/src/m/utils/ImageProcessing/Makefile.am
   issm/trunk/src/m/utils/Interp/Makefile.am
   issm/trunk/src/m/utils/Kml/Makefile.am
   issm/trunk/src/m/utils/LatLong/Makefile.am
   issm/trunk/src/m/utils/Makefile.am
   issm/trunk/src/m/utils/Math/Makefile.am
   issm/trunk/src/m/utils/Meca/Makefile.am
   issm/trunk/src/m/utils/Mesh/Makefile.am
   issm/trunk/src/m/utils/Miscellaneous/Makefile.am
   issm/trunk/src/m/utils/Miscellaneous/issmdoc.m
   issm/trunk/src/m/utils/Model/Makefile.am
   issm/trunk/src/m/utils/Numerics/Makefile.am
   issm/trunk/src/m/utils/OS/Makefile.am
   issm/trunk/src/m/utils/OS/ismumps.m
   issm/trunk/src/m/utils/Plot/Makefile.am
   issm/trunk/src/m/utils/Shell/Makefile.am
   issm/trunk/src/m/utils/String/Makefile.am
   issm/trunk/src/m/utils/consistency/Makefile.am
   issm/trunk/src/m/utils/qmu/Makefile.am
   issm/trunk/src/mex/CreateJacobianMatrix/
   issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp
   issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h
   issm/trunk/src/mex/KMLFileRead/
   issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp
   issm/trunk/src/mex/KMLFileRead/KMLFileRead.h
   issm/trunk/test/Archives/Archive139.mat
   issm/trunk/test/Archives/Archive140.mat
   issm/trunk/test/Archives/Archive141.mat
   issm/trunk/test/Archives/Archive142.mat
   issm/trunk/test/Archives/Archive143.mat
   issm/trunk/test/Archives/Archive144.mat
   issm/trunk/test/Archives/Archive349.mat
   issm/trunk/test/Archives/Archive350.mat
   issm/trunk/test/Archives/Archive351.mat
   issm/trunk/test/Archives/Archive352.mat
   issm/trunk/test/Archives/Archive353.mat
   issm/trunk/test/Archives/Archive354.mat
   issm/trunk/test/NightlyRun/test139.m
   issm/trunk/test/NightlyRun/test140.m
   issm/trunk/test/NightlyRun/test141.m
   issm/trunk/test/NightlyRun/test142.m
   issm/trunk/test/NightlyRun/test143.m
   issm/trunk/test/NightlyRun/test144.m
   issm/trunk/test/NightlyRun/test349.m
   issm/trunk/test/NightlyRun/test350.m
   issm/trunk/test/NightlyRun/test351.m
   issm/trunk/test/NightlyRun/test352.m
   issm/trunk/test/NightlyRun/test353.m
   issm/trunk/test/NightlyRun/test354.m
Removed:
   issm/trunk/doc/
   issm/trunk/externalpackages/android/HelloWorldAppProject/
   issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug.apk
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/HelloWorldAppActivity.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$attr.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$layout.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$string.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R.class
   issm/trunk/externalpackages/android/HelloWorldAppProject/bin/res/
   issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/
   issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java
   issm/trunk/externalpackages/android/HelloWorldAppProject/libs/
   issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg
   issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/
   issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/
   issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java
   issm/trunk/externalpackages/android/README
   issm/trunk/externalpackages/autoconf/autoconf-2.63.tar.gz
   issm/trunk/externalpackages/automake/automake-1.10.2.tar.gz
   issm/trunk/externalpackages/bsdtar/install-win7.sh
   issm/trunk/externalpackages/bsdtar/libarchive-3.0.3.tar.gz
   issm/trunk/externalpackages/cccl/cccl-0.03.tar.gz
   issm/trunk/externalpackages/cccl/install-win7.orig.sh
   issm/trunk/externalpackages/cccl/install-win7.sh
   issm/trunk/externalpackages/cccl/issm/
   issm/trunk/externalpackages/cccl/issm/cccl
   issm/trunk/externalpackages/flaim/install
   issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch
   issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch
   issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch
   issm/trunk/externalpackages/tao/tao-1.10.1-p1.tar.gz
   issm/trunk/externalpackages/triangle/configs/win7/configure.make
   issm/trunk/externalpackages/triangle/configs/win7/makefile
   issm/trunk/externalpackages/win7/notes
   issm/trunk/externalpackages/win7/sdk7.1.32bits.sh
   issm/trunk/externalpackages/win7/sdk7.1.64bits.sh
   issm/trunk/externalpackages/win7/vs10.0.sh
   issm/trunk/externalpackages/win7/winsdk_web.exe
   issm/trunk/installers/macosx/
   issm/trunk/installers/macosx/ISSM.pmdoc/
   issm/trunk/installers/macosx/ISSM.pmdoc/index.xml
   issm/trunk/installers/win7/
   issm/trunk/installers/win7/ISSM.initial.aip
   issm/trunk/installers/win7/ISSMlogo.ico
   issm/trunk/installers/win7/aic.sh
   issm/trunk/src/c/intel-compile.sh
   issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
   issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
   issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
   issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
   issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp
   issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h
   issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.cpp
   issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.h
   issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp
   issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h
   issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
   issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
   issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp
   issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h
   issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp
   issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h
   issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp
   issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h
   issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
   issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
   issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
   issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
   issm/trunk/src/m/enum/PentaVertexElementResultEnum.m
   issm/trunk/src/m/enum/PentaVertexInputEnum.m
   issm/trunk/src/m/enum/SurfaceforcingsAblationRateEnum.m
   issm/trunk/src/m/enum/SurfaceforcingsAccumulationRateEnum.m
   issm/trunk/src/m/enum/TriaVertexElementResultEnum.m
   issm/trunk/src/m/enum/TriaVertexInputEnum.m
   issm/trunk/src/m/model/plot/plot_pressureload.m
   issm/trunk/src/m/utils/Enum/
   issm/trunk/src/m/utils/Meca/effective_value.m
   issm/trunk/src/m/utils/Meca/glen_coefficients.m
   issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp
   issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h
   issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp
   issm/trunk/src/mex/KMLFileRead/KMLFileRead.h
   issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.cpp
   issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.h
Modified:
   issm/trunk/
   issm/trunk/INSTALL
   issm/trunk/Makefile.am
   issm/trunk/README
   issm/trunk/bin/
   issm/trunk/configure.ac
   issm/trunk/cron/cronfiles/linux_cronfile
   issm/trunk/etc/environment.sh
   issm/trunk/etc/environment_variables.sh
   issm/trunk/externalpackages/autoconf/install.sh
   issm/trunk/externalpackages/automake/install.sh
   issm/trunk/externalpackages/doxygen/install.sh
   issm/trunk/externalpackages/flaim/install.sh
   issm/trunk/externalpackages/tao/install.sh
   issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim
   issm/trunk/m4/issm_options.m4
   issm/trunk/scripts/Update.sh
   issm/trunk/scripts/cloc2html.py
   issm/trunk/scripts/getloc.sh
   issm/trunk/src/Makefile.am
   issm/trunk/src/ad/wrappers.txt
   issm/trunk/src/c/
   issm/trunk/src/c/Container/DataSet.cpp
   issm/trunk/src/c/Container/Nodes.cpp
   issm/trunk/src/c/Container/Vertices.cpp
   issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
   issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp
   issm/trunk/src/c/EnumDefinitions/Synchronize.sh
   issm/trunk/src/c/Makefile.am
   issm/trunk/src/c/include/typedefs.h
   issm/trunk/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp
   issm/trunk/src/c/modules/Chacox/Chacox.cpp
   issm/trunk/src/c/modules/Chacox/input_parse.cpp
   issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
   issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
   issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp
   issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
   issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp
   issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h
   issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
   issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
   issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
   issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
   issm/trunk/src/c/modules/Gradjx/Gradjx.cpp
   issm/trunk/src/c/modules/Gradjx/Gradjx.h
   issm/trunk/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
   issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
   issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
   issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
   issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
   issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
   issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
   issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
   issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
   issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
   issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
   issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
   issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
   issm/trunk/src/c/modules/Scotchx/Scotchx.cpp
   issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
   issm/trunk/src/c/modules/Solverx/Solverx.cpp
   issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
   issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
   issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
   issm/trunk/src/c/modules/modules.h
   issm/trunk/src/c/objects/Elements/Element.h
   issm/trunk/src/c/objects/Elements/Penta.cpp
   issm/trunk/src/c/objects/Elements/Penta.h
   issm/trunk/src/c/objects/Elements/Tria.cpp
   issm/trunk/src/c/objects/Elements/Tria.h
   issm/trunk/src/c/objects/Inputs/ControlInput.cpp
   issm/trunk/src/c/objects/Inputs/ControlInput.h
   issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
   issm/trunk/src/c/objects/KML/KMLFileReadUtils.cpp
   issm/trunk/src/c/objects/KML/KMLFileReadUtils.h
   issm/trunk/src/c/objects/KML/KML_Container.cpp
   issm/trunk/src/c/objects/KML/KML_Feature.cpp
   issm/trunk/src/c/objects/KML/KML_File.cpp
   issm/trunk/src/c/objects/KML/KML_File.h
   issm/trunk/src/c/objects/KML/KML_GroundOverlay.cpp
   issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp
   issm/trunk/src/c/objects/KML/KML_Object.cpp
   issm/trunk/src/c/objects/KML/KML_Object.h
   issm/trunk/src/c/objects/KML/KML_Overlay.cpp
   issm/trunk/src/c/objects/KML/KML_Placemark.cpp
   issm/trunk/src/c/objects/KML/KML_Polygon.cpp
   issm/trunk/src/c/objects/KML/KML_Style.cpp
   issm/trunk/src/c/objects/Loads/Icefront.cpp
   issm/trunk/src/c/objects/Loads/Icefront.h
   issm/trunk/src/c/objects/Loads/Load.h
   issm/trunk/src/c/objects/Loads/Numericalflux.h
   issm/trunk/src/c/objects/Loads/Pengrid.h
   issm/trunk/src/c/objects/Loads/Penpair.cpp
   issm/trunk/src/c/objects/Loads/Penpair.h
   issm/trunk/src/c/objects/Loads/Riftfront.cpp
   issm/trunk/src/c/objects/Loads/Riftfront.h
   issm/trunk/src/c/objects/Materials/Matice.cpp
   issm/trunk/src/c/objects/Materials/Matice.h
   issm/trunk/src/c/objects/Materials/Matpar.cpp
   issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp
   issm/trunk/src/c/objects/Numerics/ElementMatrix.h
   issm/trunk/src/c/objects/Params/BoolParam.h
   issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h
   issm/trunk/src/c/objects/Params/DoubleMatParam.h
   issm/trunk/src/c/objects/Params/DoubleParam.h
   issm/trunk/src/c/objects/Params/DoubleVecParam.h
   issm/trunk/src/c/objects/Params/FileParam.h
   issm/trunk/src/c/objects/Params/IntMatParam.h
   issm/trunk/src/c/objects/Params/IntParam.h
   issm/trunk/src/c/objects/Params/PetscMatParam.h
   issm/trunk/src/c/objects/Params/PetscVecParam.h
   issm/trunk/src/c/objects/Params/StringParam.h
   issm/trunk/src/c/objects/Patch.cpp
   issm/trunk/src/c/objects/Vertex.cpp
   issm/trunk/src/c/objects/Vertex.h
   issm/trunk/src/c/objects/objects.h
   issm/trunk/src/c/shared/Numerics/Synchronize.sh
   issm/trunk/src/c/shared/Numerics/UnitConversion.cpp
   issm/trunk/src/c/shared/Numerics/Verbosity.cpp
   issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp
   issm/trunk/src/c/shared/TriMesh/trimesh.h
   issm/trunk/src/c/solutions/AnalysisConfiguration.cpp
   issm/trunk/src/c/solutions/control_core.cpp
   issm/trunk/src/c/solutions/controltao_core.cpp
   issm/trunk/src/c/solutions/convergence.cpp
   issm/trunk/src/c/solutions/diagnostic_core.cpp
   issm/trunk/src/c/solutions/enthalpy_core.cpp
   issm/trunk/src/c/solutions/gradient_core.cpp
   issm/trunk/src/c/solutions/issm.cpp
   issm/trunk/src/c/solutions/solutions.h
   issm/trunk/src/c/solutions/transient_core.cpp
   issm/trunk/src/c/solvers/solver_nonlinear.cpp
   issm/trunk/src/c/solvers/solver_stokescoupling_nonlinear.cpp
   issm/trunk/src/c/solvers/solvers.h
   issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
   issm/trunk/src/dox/issm.dox
   issm/trunk/src/m/
   issm/trunk/src/m/classes/
   issm/trunk/src/m/classes/@modellist/
   issm/trunk/src/m/classes/@pairoptions/
   issm/trunk/src/m/classes/clusters/
   issm/trunk/src/m/classes/clusters/castor.m
   issm/trunk/src/m/classes/clusters/cosmos.m
   issm/trunk/src/m/classes/clusters/gemini.m
   issm/trunk/src/m/classes/clusters/generic.m
   issm/trunk/src/m/classes/clusters/pollux.m
   issm/trunk/src/m/classes/diagnostic.m
   issm/trunk/src/m/classes/initialization.m
   issm/trunk/src/m/classes/inversion.m
   issm/trunk/src/m/classes/model/
   issm/trunk/src/m/classes/model/model.m
   issm/trunk/src/m/classes/solver.m
   issm/trunk/src/m/classes/surfaceforcings.m
   issm/trunk/src/m/classes/thermal.m
   issm/trunk/src/m/enum/
   issm/trunk/src/m/kml/
   issm/trunk/src/m/model/
   issm/trunk/src/m/model/collapse.m
   issm/trunk/src/m/model/display/
   issm/trunk/src/m/model/extrude.m
   issm/trunk/src/m/model/loadresultsfromcluster.m
   issm/trunk/src/m/model/loadresultsfromdisk.m
   issm/trunk/src/m/model/mesh/
   issm/trunk/src/m/model/parameterization/
   issm/trunk/src/m/model/partition/
   issm/trunk/src/m/model/partition/partitioner.m
   issm/trunk/src/m/model/plot/
   issm/trunk/src/m/model/plot/plot_BC.m
   issm/trunk/src/m/model/plot/plot_manager.m
   issm/trunk/src/m/model/plot/plot_riftrelvel.m
   issm/trunk/src/m/model/plot/plot_rifts.m
   issm/trunk/src/m/model/plot/plot_riftvel.m
   issm/trunk/src/m/model/plot/plotdoc.m
   issm/trunk/src/m/model/radarpower.m
   issm/trunk/src/m/model/solveparallel.m
   issm/trunk/src/m/model/solvers/
   issm/trunk/src/m/model/tres.m
   issm/trunk/src/m/planet/
   issm/trunk/src/m/qmu/
   issm/trunk/src/m/qmu/expandresponses.m
   issm/trunk/src/m/shared/
   issm/trunk/src/m/solutions/
   issm/trunk/src/m/solutions/AnalysisConfiguration.m
   issm/trunk/src/m/solutions/control_core.m
   issm/trunk/src/m/solutions/diagnostic_core.m
   issm/trunk/src/m/solutions/enthalpy_core.m
   issm/trunk/src/m/solutions/gradient_core.m
   issm/trunk/src/m/solutions/transient_core.m
   issm/trunk/src/m/solvers/
   issm/trunk/src/m/solvers/solver_nonlinear.m
   issm/trunk/src/m/utils/
   issm/trunk/src/m/utils/Analysis/
   issm/trunk/src/m/utils/Array/
   issm/trunk/src/m/utils/BC/
   issm/trunk/src/m/utils/BC/SetIceSheetBC.m
   issm/trunk/src/m/utils/BC/SetIceShelfBC.m
   issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
   issm/trunk/src/m/utils/Basins/
   issm/trunk/src/m/utils/Cluster/
   issm/trunk/src/m/utils/DataProcessing/
   issm/trunk/src/m/utils/Ecco3/
   issm/trunk/src/m/utils/Exp/
   issm/trunk/src/m/utils/Geometry/
   issm/trunk/src/m/utils/ImageProcessing/
   issm/trunk/src/m/utils/Interp/
   issm/trunk/src/m/utils/Kml/
   issm/trunk/src/m/utils/LatLong/
   issm/trunk/src/m/utils/Math/
   issm/trunk/src/m/utils/Meca/
   issm/trunk/src/m/utils/Mesh/
   issm/trunk/src/m/utils/Miscellaneous/
   issm/trunk/src/m/utils/Model/
   issm/trunk/src/m/utils/Numerics/
   issm/trunk/src/m/utils/OS/
   issm/trunk/src/m/utils/Plot/
   issm/trunk/src/m/utils/Shell/
   issm/trunk/src/m/utils/Shell/issmdir.m
   issm/trunk/src/m/utils/Shell/issmtier.m
   issm/trunk/src/m/utils/String/
   issm/trunk/src/m/utils/consistency/
   issm/trunk/src/m/utils/consistency/checkfield.m
   issm/trunk/src/m/utils/qmu/
   issm/trunk/src/mex/
   issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.cpp
   issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.h
   issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.cpp
   issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.h
   issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.cpp
   issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.h
   issm/trunk/src/mex/Gradj/Gradj.cpp
   issm/trunk/src/mex/Gradj/Gradj.h
   issm/trunk/src/mex/Makefile.am
   issm/trunk/src/mex/MeshProfileIntersection/MeshProfileIntersection.cpp
   issm/trunk/src/mex/Solver/Solver.cpp
   issm/trunk/startup.m
   issm/trunk/test/Archives/Archive101.mat
   issm/trunk/test/Archives/Archive1109.mat
   issm/trunk/test/Archives/Archive1208.mat
   issm/trunk/test/Archives/Archive121.mat
   issm/trunk/test/Archives/Archive122.mat
   issm/trunk/test/Archives/Archive1501.mat
   issm/trunk/test/Archives/Archive1502.mat
   issm/trunk/test/Archives/Archive217.mat
   issm/trunk/test/Archives/Archive218.mat
   issm/trunk/test/Archives/Archive219.mat
   issm/trunk/test/Archives/Archive220.mat
   issm/trunk/test/Archives/Archive221.mat
   issm/trunk/test/Archives/Archive222.mat
   issm/trunk/test/Archives/Archive224.mat
   issm/trunk/test/Archives/Archive226.mat
   issm/trunk/test/Archives/Archive228.mat
   issm/trunk/test/Archives/Archive247.mat
   issm/trunk/test/Archives/Archive248.mat
   issm/trunk/test/Archives/Archive249.mat
   issm/trunk/test/Archives/Archive250.mat
   issm/trunk/test/Archives/Archive253.mat
   issm/trunk/test/Archives/Archive254.mat
   issm/trunk/test/Archives/Archive265.mat
   issm/trunk/test/Archives/Archive266.mat
   issm/trunk/test/Archives/Archive329.mat
   issm/trunk/test/Archives/Archive330.mat
   issm/trunk/test/Archives/Archive333.mat
   issm/trunk/test/Archives/Archive334.mat
   issm/trunk/test/Archives/Archive338.mat
   issm/trunk/test/Archives/Archive339.mat
   issm/trunk/test/Archives/Archive340.mat
   issm/trunk/test/Archives/Archive344.mat
   issm/trunk/test/Archives/Archive347.mat
   issm/trunk/test/Archives/Archive348.mat
   issm/trunk/test/Archives/Archive417.mat
   issm/trunk/test/Archives/Archive418.mat
   issm/trunk/test/Archives/Archive429.mat
   issm/trunk/test/Archives/Archive430.mat
   issm/trunk/test/Archives/Archive431.mat
   issm/trunk/test/Archives/Archive432.mat
   issm/trunk/test/Archives/Archive451.mat
   issm/trunk/test/Archives/Archive452.mat
   issm/trunk/test/Archives/Archive453.mat
   issm/trunk/test/Archives/Archive454.mat
   issm/trunk/test/Archives/Archive509.mat
   issm/trunk/test/Archives/Archive510.mat
   issm/trunk/test/Archives/Archive511.mat
   issm/trunk/test/Archives/Archive512.mat
   issm/trunk/test/Archives/Archive513.mat
   issm/trunk/test/Archives/Archive514.mat
   issm/trunk/test/Archives/Archive523.mat
   issm/trunk/test/Archives/Archive524.mat
   issm/trunk/test/Archives/Archive525.mat
   issm/trunk/test/Archives/Archive526.mat
   issm/trunk/test/NightlyRun/IdToName.m
   issm/trunk/test/NightlyRun/Makefile
   issm/trunk/test/NightlyRun/runme.m
   issm/trunk/test/NightlyRun/test1104.m
   issm/trunk/test/NightlyRun/test1106.m
   issm/trunk/test/NightlyRun/test1107.m
   issm/trunk/test/NightlyRun/test1108.m
   issm/trunk/test/NightlyRun/test1109.m
   issm/trunk/test/NightlyRun/test122.m
   issm/trunk/test/NightlyRun/test1502.m
   issm/trunk/test/NightlyRun/test218.m
   issm/trunk/test/NightlyRun/test222.m
   issm/trunk/test/NightlyRun/test223.m
   issm/trunk/test/NightlyRun/test266.m
   issm/trunk/test/NightlyRun/test314.m
   issm/trunk/test/NightlyRun/test430.m
   issm/trunk/test/NightlyRun/test525.m
   issm/trunk/test/NightlyRun/test526.m
   issm/trunk/test/NightlyRun/test626.m
Log:
merged trunk-jpl and trunk for revision 11526


Property changes on: issm/trunk
___________________________________________________________________
Modified: svn:mergeinfo
   - /issm/trunk-jpl:10936-11237
   + /issm/trunk-jpl:10936-11237,11239-11526

Modified: issm/trunk/INSTALL
===================================================================
--- issm/trunk/INSTALL	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/INSTALL	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,2 +1,3 @@
-For the installation process please go to the ISSM website 
+For the installation process please go to the ISSM website:
+
 http://issm.jpl.nasa.gov/

Modified: issm/trunk/Makefile.am
===================================================================
--- issm/trunk/Makefile.am	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,2 +1,3 @@
 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
+bin_SCRIPTS=config.h startup.m README.rtf

Modified: issm/trunk/README
===================================================================
--- issm/trunk/README	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/README	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,45 +9,54 @@
 
 Jet Propulsion Laboratory
 
-Eric    Larour (Project Lead)
-Mathieu Morlighem (Anisotropic Meshing, Control Methods)
-Helene  Seroussi (Coupling 2D-3D, Multi-model, full-Stokes)
+Eric    Larour (Project Manager)
+Mathieu Morlighem (Core Developer, Anisotropic Meshing, Control Methods)
+Helene  Seroussi (Core Develper Coupling 2D-3D, Multi-model, full-Stokes)
+Nicole  Schlegel (Developer, Atmospheric Forcing)
+Chris   Borstad (Developer, Rifting/Faulting/Crack Propagation)
+Feras   Habbal (Developer, Solver Technologies)
+Daria   Halkides (Analyst, Atmospheric Forcing)
+Ala     Khazendar (Analyst, Ice Sheet Processes)
 
 Email: issm at jpl.nasa.gov
 
 ------------------------------------------------------------------------------
-License
 
-ISSM is California Institute of Technology Copyright.
-------------------------------------------------------------------------------
-Overview
+Website: ttp://issm.jpl.nasa.gov/ for additional information.
 
-More to come
-
-Refer to http://issm.jpl.nasa.gov/ for additional information.
 ------------------------------------------------------------------------------
-Distribution
 
-The directories contained in this distribution include:
+License
 
-examples            Example problems 
+ISSM is California Institute of Technology Copyright, Distributed under BSD Three Clause License.
 
-externalpackages    Other libraries 
 
-m4                  m4 macros used for supporting autoconf.
+Copyright (c) 2002-2011, California Institute of Technology.
+All rights reserved.  Based on Government Sponsored Research under contracts
+NAS7-1407 and/or NAS7-03001.
 
-doc                 The Users, Reference, and Developers Manuals are 
-                    maintained here.  Other references are available from
-                    the ISSM Web site (http://issm.jpl.nasa.gov/)
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
 
-src                 The main source code repository for the ISSM system.
+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.
 
-test                Files for regression and unit testing of the ISSM system.
+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.
 ------------------------------------------------------------------------------
-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.
-------------------------------------------------------------------------------

Copied: issm/trunk/README.rtf (from rev 11526, issm/trunk-jpl/README.rtf)
===================================================================
--- issm/trunk/README.rtf	                        (rev 0)
+++ issm/trunk/README.rtf	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,67 @@
+{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}
+{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\lang1033\f0\fs22 ------------------------------------------------------------------------------\par
+\par
+ISSM\par
+Ice Sheet System Modeling: a framework for modeling ice flow on ice sheet/ice shelf\par
+systems using Finite Elemenent Analysis, and parallel technologies.\par
+\par
+------------------------------------------------------------------------------\par
+\par
+Jet Propulsion Laboratory\par
+\par
+Eric          Eric Larour (Project Manager)\par
+Mathieu       Mathieu Morlighem (Core Developer, Anisotropic Meshing, Control Methods)\par
+Helene        Helene Seroussi (Core Develper Coupling 2D-3D, Multi-model, full-Stokes)\par
+Nicole        Nicole Schlegel (Developer, Atmospheric Forcing)\par
+Chris         Christopher Borstad (Developer, Rifting/Faulting/Crack Propagation)\par
+Feras         Feras Habbal (Developer, Solver Technologies)\par
+Daria         Daria Halkides (Analyst, Atmospheric Forcing)\par
+Ala           Ala Khazendar (Analyst, Ice Sheet Processes)\par
+\par
+\par
+Email: issm at jpl.nasa.gov\par
+\par
+------------------------------------------------------------------------------\par
+\par
+Website: ttp://issm.jpl.nasa.gov/ for additional information.\par
+\par
+------------------------------------------------------------------------------\par
+\par
+License\par
+\par
+ISSM is California Institute of Technology Copyright, Distributed under BSD Three Clause License.\par
+\par
+\par
+Copyright (c) 2002-2011, California Institute of Technology.\par
+All rights reserved.  Based on Government Sponsored Research under contracts\par
+NAS7-1407 and/or NAS7-03001.\par
+\par
+Redistribution and use in source and binary forms, with or without\par
+modification, are permitted provided that the following conditions are met:\par
+\par
+    1. Redistributions of source code must retain the above copyright notice,\par
+       this list of conditions and the following disclaimer.\par
+    2. Redistributions in binary form must reproduce the above copyright\par
+       notice, this list of conditions and the following disclaimer in the\par
+       documentation and/or other materials provided with the distribution.\par
+    3. Neither the name of the California Institute of Technology (Caltech),\par
+       its operating division the Jet Propulsion Laboratory (JPL), the National\par
+       Aeronautics and Space Administration (NASA), nor the names of its\par
+       contributors may be used to endorse or promote products derived from\par
+       this software without specific prior written permission.\par
+\par
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\par
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\par
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\par
+DISCLAIMED. IN NO EVENT SHALL THE CALIFORNIA INSTITUTE OF TECHNOLOGY BE LIABLE\par
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\par
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\par
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\par
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\par
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\par
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\par
+------------------------------------------------------------------------------\par
+\par
+\par
+}
+ 

Copied: issm/trunk/ar-lib (from rev 11526, issm/trunk-jpl/ar-lib)
===================================================================
--- issm/trunk/ar-lib	                        (rev 0)
+++ issm/trunk/ar-lib	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,265 @@
+#! /bin/sh
+# Wrapper for Microsoft lib.exe
+
+me=ar-lib
+scriptversion=2012-01-30.22; # UTC
+
+# Copyright (C) 2010, 2012 Free Software Foundation, Inc.
+# Written by Peter Rosin <peda at lysator.liu.se>.
+#
+# 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, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+
+# func_error message
+func_error ()
+{
+  echo "$me: $1" 1>&2
+  exit 1
+}
+
+file_conv=
+
+# func_file_conv build_file
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv in
+	mingw)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_at_file at_file operation archive
+# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
+# for each of them.
+# When interpreting the content of the @FILE, do NOT use func_file_conv,
+# since the user would need to supply preconverted file names to
+# binutils ar, at least for MinGW.
+func_at_file ()
+{
+  operation=$2
+  archive=$3
+  at_file_contents=`cat "$1"`
+  eval set x "$at_file_contents"
+  shift
+
+  for member
+  do
+    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
+  done
+}
+
+case $1 in
+  '')
+     func_error "no command.  Try '$0 --help' for more information."
+     ;;
+  -h | --h*)
+    cat <<EOF
+Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
+
+Members may be specified in a file named with @FILE.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "$me, version $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test $# -lt 3; then
+  func_error "you must specify a program, an action and an archive"
+fi
+
+AR=$1
+shift
+while :
+do
+  if test $# -lt 2; then
+    func_error "you must specify a program, an action and an archive"
+  fi
+  case $1 in
+    -lib | -LIB \
+    | -ltcg | -LTCG \
+    | -machine* | -MACHINE* \
+    | -subsystem* | -SUBSYSTEM* \
+    | -verbose | -VERBOSE \
+    | -wx* | -WX* )
+      AR="$AR $1"
+      shift
+      ;;
+    *)
+      action=$1
+      shift
+      break
+      ;;
+  esac
+done
+orig_archive=$1
+shift
+func_file_conv "$orig_archive"
+archive=$file
+
+# strip leading dash in $action
+action=${action#-}
+
+delete=
+extract=
+list=
+replace=
+create=
+
+while test -n "$action"
+do
+  case $action in
+    d*) delete=yes  ;;
+    x*) extract=yes ;;
+    t*) list=yes    ;;
+    r*) replace=yes ;;
+    c*) create=yes  ;;
+    u*)             ;; # TODO: don't ignore the update modifier
+    v*)             ;; # TODO: don't ignore the verbose modifier
+    *)
+      func_error "unknown action specified"
+      ;;
+  esac
+  action=${action#?}
+done
+
+case $delete$extract$list$replace in
+  yes)
+    ;;
+  yesyes*)
+    func_error "more than one action specified"
+    ;;
+  *)
+    func_error "no action specified"
+    ;;
+esac
+
+if test -n "$delete"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  for member
+  do
+    case $1 in
+      @*)
+        func_at_file "${1#@}" -REMOVE "$archive"
+        ;;
+      *)
+        func_file_conv "$1"
+        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
+        ;;
+    esac
+  done
+
+elif test -n "$extract"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  if test $# -gt 0; then
+    for member
+    do
+      case $1 in
+        @*)
+          func_at_file "${1#@}" -EXTRACT "$archive"
+          ;;
+        *)
+          func_file_conv "$1"
+          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
+          ;;
+      esac
+    done
+  else
+    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
+    do
+      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+    done
+  fi
+
+elif test -n "$replace"; then
+  if test ! -f "$orig_archive"; then
+    if test -z "$create"; then
+      echo "$me: creating $orig_archive"
+    fi
+    orig_archive=
+  else
+    orig_archive=$archive
+  fi
+
+  for member
+  do
+    case $1 in
+    @*)
+      func_file_conv "${1#@}"
+      set x "$@" "@$file"
+      ;;
+    *)
+      func_file_conv "$1"
+      set x "$@" "$file"
+      ;;
+    esac
+    shift
+    shift
+  done
+
+  if test -n "$orig_archive"; then
+    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
+  else
+    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
+  fi
+
+elif test -n "$list"; then
+  if test ! -f "$orig_archive"; then
+    func_error "archive not found"
+  fi
+  $AR -NOLOGO -LIST "$archive" || exit $?
+fi


Property changes on: issm/trunk/bin
___________________________________________________________________
Modified: svn:ignore
   - *.mexa64
Makefile
Makefile.in
issm.exe

   + *.mexa64
*.mexw64
*.mexw32
Makefile
Makefile.in
issm.exe
*.m
*.h
@pairoptions
@modellist
*.bat
*.rtf


Copied: issm/trunk/configs/config-greenplanet.sh (from rev 11526, issm/trunk-jpl/configs/config-greenplanet.sh)
===================================================================
--- issm/trunk/configs/config-greenplanet.sh	                        (rev 0)
+++ issm/trunk/configs/config-greenplanet.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,24 @@
+#!/bin/csh
+
+#PETSc 3.2
+#MPI /sopt/mpi/openmpi-1.5.4_psm/intel
+
+./configure \
+ --prefix=$ISSM_TIER \
+ --with-serial=no \
+ --with-triangle-dir=$ISSM_TIER/externalpackages/triangle/install \
+ --with-metis-dir=$ISSM_TIER/externalpackages/metis/install \
+ --with-petsc-dir=$ISSM_TIER/externalpackages/petsc/install \
+ --with-mpi-include="/sopt/mpi/openmpi-1.5.4_psm/intel/include/" \
+ --with-mpi-lib="-L/sopt/mpi/openmpi-1.5.4_psm/intel/lib/ -lmpi -lmpi_f77" \
+ --with-petsc-arch=$ISSM_ARCH \
+ --with-dakota-dir=$ISSM_TIER/externalpackages/dakota/install \
+ --with-mkl-dir=/opt/intel/mkl/10.2.4.032/ \
+ --with-plapack-lib="-L$ISSM_TIER/externalpackages/petsc/install/ -lPLAPACK" \
+ --with-plapack-include="-I$ISSM_TIER/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+ --with-mumps-dir=$ISSM_TIER/externalpackages/petsc/install/ \
+ --with-scalapack-dir=$ISSM_TIER/externalpackages/petsc/install/ \
+ --with-blacs-dir=$ISSM_TIER/externalpackages/petsc/install/ \
+ --with-graphics-lib=/usr/lib64/libX11.so \
+ --with-cxxoptflags="-O3 -xS" \
+ --with-vendor=intel-linux

Copied: issm/trunk/configs/config-win7-32.sh (from rev 11526, issm/trunk-jpl/configs/config-win7-32.sh)
===================================================================
--- issm/trunk/configs/config-win7-32.sh	                        (rev 0)
+++ issm/trunk/configs/config-win7-32.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+
+#get configure.sh to pick up the win7 Visual Studio compiler 
+./configure --prefix=$ISSM_TIER --with-vendor=intel-win7-32  --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_TIER_WIN/externalpackages/triangle/install --with-metis-dir=$ISSM_TIER_WIN/externalpackages/metis/install --with-petsc-dir=$ISSM_TIER_WIN/externalpackages/petsc/install  --with-petsc-arch=$ISSM_ARCH  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/lib/  --with-mpi-lib=$ISSM_TIER_WIN/externalpackages/petsc/install/lib/libpetsc.lib --with-mpi-include=$ISSM_TIER_WIN/externalpackages/petsc/install/include/mpiuni

Copied: issm/trunk/configs/config-win7-64.sh (from rev 11526, issm/trunk-jpl/configs/config-win7-64.sh)
===================================================================
--- issm/trunk/configs/config-win7-64.sh	                        (rev 0)
+++ issm/trunk/configs/config-win7-64.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+
+#get configure.sh to pick up the win7 Visual Studio compiler 
+./configure --prefix=$ISSM_TIER --with-vendor=intel-win7-64  --with-matlab-dir=$MATLAB_DIR --with-triangle-dir=$ISSM_TIER_WIN/externalpackages/triangle/install --with-metis-dir=$ISSM_TIER_WIN/externalpackages/metis/install --with-petsc-dir=$ISSM_TIER_WIN/externalpackages/petsc/install  --with-petsc-arch=$ISSM_ARCH  --with-blas-lapack-dir=$ISSM_TIER/externalpackages/petsc/install/lib/  --with-mpi-lib=$ISSM_TIER_WIN/externalpackages/petsc/install/lib/libpetsc.lib --with-mpi-include=$ISSM_TIER_WIN/externalpackages/petsc/install/include/mpiuni

Modified: issm/trunk/configure.ac
===================================================================
--- issm/trunk/configure.ac	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/configure.ac	2012-02-24 16:12:47 UTC (rev 11527)
@@ -4,20 +4,69 @@
 #LT_INIT
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
 AC_PROG_RANLIB
-AC_PROG_CC([gcc icl])
+AC_PROG_CC([gcc icl cccl cl])
 AC_PROG_CPP
-AC_PROG_CXX([g++ icl])
+AC_PROG_CXX([g++ icl cccl cl])
 AC_PROG_F77([ifort g77 gfortran])
 AC_F77_LIBRARY_LDFLAGS
 AM_PROG_CC_C_O
 AC_PATH_XTRA
 ISSM_OPTIONS
+AM_PROG_AR
 AC_CONFIG_FILES([Makefile
 			src/Makefile
 			src/c/Makefile
 			src/ad/Makefile
 			src/mex/Makefile
+			src/m/Makefile
+			src/m/classes/Makefile
+			src/m/classes/@modellist/Makefile
+			src/m/classes/@pairoptions/Makefile
+			src/m/classes/model/Makefile
+			src/m/classes/clusters/Makefile
+			src/m/enum/Makefile
+			src/m/kml/Makefile
+			src/m/model/Makefile
+			src/m/model/plot/Makefile
+			src/m/model/mesh/Makefile
+			src/m/model/display/Makefile
+			src/m/model/parameterization/Makefile
+			src/m/model/partition/Makefile
+			src/m/model/solvers/Makefile
+			src/m/planet/Makefile
+			src/m/qmu/Makefile
+			src/m/shared/Makefile
+			src/m/solutions/Makefile
+			src/m/solvers/Makefile
+			src/m/utils/Makefile
+			src/m/utils/Analysis/Makefile
+			src/m/utils/Array/Makefile
+			src/m/utils/BC/Makefile
+			src/m/utils/Basins/Makefile
+			src/m/utils/Cluster/Makefile
+			src/m/utils/DataProcessing/Makefile
+			src/m/utils/Ecco3/Makefile
+			src/m/utils/Exp/Makefile
+			src/m/utils/Geometry/Makefile
+			src/m/utils/ImageProcessing/Makefile
+			src/m/utils/Interp/Makefile
+			src/m/utils/Kml/Makefile
+			src/m/utils/LatLong/Makefile
+			src/m/utils/Math/Makefile
+			src/m/utils/Meca/Makefile
+			src/m/utils/Mesh/Makefile
+			src/m/utils/Miscellaneous/Makefile
+			src/m/utils/Model/Makefile
+			src/m/utils/Numerics/Makefile
+			src/m/utils/OS/Makefile
+			src/m/utils/Plot/Makefile
+			src/m/utils/Shell/Makefile
+			src/m/utils/String/Makefile
+			src/m/utils/consistency/Makefile
+			src/m/utils/qmu/Makefile
 			bin/Makefile])
 AC_OUTPUT
 
+

Copied: issm/trunk/cron/configs/linux64_schlegel_daily (from rev 11526, issm/trunk-jpl/cron/configs/linux64_schlegel_daily)
===================================================================
--- issm/trunk/cron/configs/linux64_schlegel_daily	                        (rev 0)
+++ issm/trunk/cron/configs/linux64_schlegel_daily	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,93 @@
+#
+########### Configuration file for Mathieu Morlighem's nightly run on Linux ############
+
+#-------------------------------#
+# 1: ISSM general configuration #
+#-------------------------------#
+
+#ISSM main directory (full paths)
+ISSM_DIR="/u/astrid-r1b/schlegel/issmuci"
+ISSM_TIER="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk-jpl"
+#ISSM_TIER="/u/astrid-r1b/seroussi/svn/issm/trunk/cron/issm2.2"
+
+#ISSM Architecture
+ISSM_ARCH="linux-gnu-amd64"
+
+#Machine configuration
+MACHINE="astrid"
+
+#MATLAB path
+MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
+
+#----------------------#
+# 2: ISSM Installation #
+#----------------------#
+
+#ISSM_INSTALLATION can have 3 values:
+# - "checkout" the existing version of the code will be erased and
+#              the latest version will be checked out
+# - "update"   the directory won't be erased but ISSM will be updated
+#              ->skip to section 3
+# - "none"     leave ISSM as is in its directory
+#              ->skip to section 3
+ISSM_INSTALLATION="update"
+
+#SVN repository
+REPOSITORY="https://issm.ess.uci.edu/svn/issm/issm/trunk-jpl"
+#REPOSITORY="http://s383-rhat/issm/svn/issm/branches/issm2.2"
+
+#execution path used for parallel runs
+EXECUTION_PATH="/u/astrid-r1b/schlegel/ExecutionNightlyRun"
+
+#-----------------------------------#
+# 3: External packages installation #
+#-----------------------------------#
+
+#ISSM_EXTERNALPACKAGES can have 3 values:
+# - "install" install all external packages listed below
+# - "copy"    copy existing directories (EXTERNALPACKAGESDIR)
+# - "none"    leave external packages as is
+#             ->skip to section 4
+ISSM_EXTERNALPACKAGES="none"
+EXTERNALPACKAGESDIR="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/externalpackages"
+
+#List of external pakages to be installed
+EXTERNALPACKAGES="autoconf automake matlab mpich2 petsc metis triangle dakota chaco"
+
+#---------------------#
+# 4: ISSM Compilation #
+#---------------------#
+
+#ISSM_COMPILATION can have 2 values:
+# - "yes" compile ISSM
+# - "no"  do not compile ISSM
+ISSM_COMPILATION="yes"
+
+#----------------------#
+# 5: Mail notification #
+#----------------------#
+
+#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
+#sent to the adresses present in $ISSM_TIER/cron/mailinglist.
+SKIPMAIL="no"
+
+#Sender email address
+EMAIL_ADRESS="schlegel at jpl.nasa.gov"
+
+#------------------------#
+# 6: Nightly run options #
+#------------------------#
+
+#number of cpus used in ISSM installation and compilation (one is usually
+#safer as some packages are very sensitive to parallel compilation)
+NUMCPUS_INSTALL=8
+
+#number of cpus used in the nightly runs.
+NUMCPUS_RUN=7
+
+#Nightly run options. The matlab routine nightlyrun.m will be called
+#as follows: nightlyrun($NROPTIONS). The options must be understandable
+#by Matlab and nightlyrun.m
+#ex: "'id',[101 102 103]"
+
+NROPTIONS=""

Copied: issm/trunk/cron/configs/linux64_schlegel_nightly (from rev 11526, issm/trunk-jpl/cron/configs/linux64_schlegel_nightly)
===================================================================
--- issm/trunk/cron/configs/linux64_schlegel_nightly	                        (rev 0)
+++ issm/trunk/cron/configs/linux64_schlegel_nightly	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,93 @@
+#
+########### Configuration file for Mathieu Morlighem's nightly run on Linux ############
+
+#-------------------------------#
+# 1: ISSM general configuration #
+#-------------------------------#
+
+#ISSM main directory (full path)
+ISSM_DIR="/u/astrid-r1b/schlegel/issmuci"
+ISSM_TIER="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk-jpl"
+#ISSM_TIER="/u/astrid-r1b/seroussi/svn/issm/trunk/cron/issm2.2"
+
+#ISSM Architecture
+ISSM_ARCH="linux-gnu-amd64"
+
+#Machine configuration
+MACHINE="astrid"
+
+#MATLAB path
+MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
+
+#----------------------#
+# 2: ISSM Installation #
+#----------------------#
+
+#ISSM_INSTALLATION can have 3 values:
+# - "checkout" the existing version of the code will be erased and
+#              the latest version will be checked out
+# - "update"   the directory won't be erased but ISSM will be updated
+#              ->skip to section 3
+# - "none"     leave ISSM as is in its directory
+#              ->skip to section 3
+ISSM_INSTALLATION="checkout"
+
+#SVN repository
+REPOSITORY="https://issm.ess.uci.edu/svn/issm/issm/trunk-jpl"
+#REPOSITORY="http://s383-rhat/issm/svn/issm/branches/issm2.2"
+
+#execution path used for parallel runs
+EXECUTION_PATH="/u/astrid-r1b/schlegel/ExecutionNightlyRun"
+
+#-----------------------------------#
+# 3: External packages installation #
+#-----------------------------------#
+
+#ISSM_EXTERNALPACKAGES can have 3 values:
+# - "install" install all external packages listed below
+# - "copy"    copy existing directories (EXTERNALPACKAGESDIR)
+# - "none"    leave external packages as is
+#             ->skip to section 4
+ISSM_EXTERNALPACKAGES="install"
+EXTERNALPACKAGESDIR="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/externalpackages"
+
+#List of external pakages to be installed
+EXTERNALPACKAGES="autoconf automake matlab mpich2 petsc metis triangle dakota chaco"
+
+#---------------------#
+# 4: ISSM Compilation #
+#---------------------#
+
+#ISSM_COMPILATION can have 2 values:
+# - "yes" compile ISSM
+# - "no"  do not compile ISSM
+ISSM_COMPILATION="yes"
+
+#----------------------#
+# 5: Mail notification #
+#----------------------#
+
+#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
+#sent to the adresses present in $ISSM_TIER/cron/mailinglist.
+SKIPMAIL="no"
+
+#Sender email address
+EMAIL_ADRESS="schlegel at jpl.nasa.gov"
+
+#------------------------#
+# 6: Nightly run options #
+#------------------------#
+
+#number of cpus used in ISSM installation and compilation (one is usually
+#safer as some packages are very sensitive to parallel compilation)
+NUMCPUS_INSTALL=1
+
+#number of cpus used in the nightly runs.
+NUMCPUS_RUN=7
+
+#Nightly run options. The matlab routine nightlyrun.m will be called
+#as follows: nightlyrun($NROPTIONS). The options must be understandable
+#by Matlab and nightlyrun.m
+#ex: "'id',[101 102 103]"
+
+NROPTIONS=""

Copied: issm/trunk/cron/configs/linux64_schlegel_ucitrunk (from rev 11526, issm/trunk-jpl/cron/configs/linux64_schlegel_ucitrunk)
===================================================================
--- issm/trunk/cron/configs/linux64_schlegel_ucitrunk	                        (rev 0)
+++ issm/trunk/cron/configs/linux64_schlegel_ucitrunk	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,93 @@
+#
+########### Configuration file for Mathieu Morlighem's nightly run on Linux ############
+
+#-------------------------------#
+# 1: ISSM general configuration #
+#-------------------------------#
+
+#ISSM main directory (full path)
+ISSM_DIR="/u/astrid-r1b/schlegel/issmuci"
+ISSM_TIER="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk"
+#ISSM_TIER="/u/astrid-r1b/seroussi/svn/issm/trunk/cron/issm2.2"
+
+#ISSM Architecture
+ISSM_ARCH="linux-gnu-amd64"
+
+#Machine configuration
+MACHINE="astrid"
+
+#MATLAB path
+MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
+
+#----------------------#
+# 2: ISSM Installation #
+#----------------------#
+
+#ISSM_INSTALLATION can have 3 values:
+# - "checkout" the existing version of the code will be erased and
+#              the latest version will be checked out
+# - "update"   the directory won't be erased but ISSM will be updated
+#              ->skip to section 3
+# - "none"     leave ISSM as is in its directory
+#              ->skip to section 3
+ISSM_INSTALLATION="checkout"
+
+#SVN repository
+REPOSITORY="https://issm.ess.uci.edu/svn/issm/issm/trunk"
+#REPOSITORY="http://s383-rhat/issm/svn/issm/branches/issm2.2"
+
+#execution path used for parallel runs
+EXECUTION_PATH="/u/astrid-r1b/schlegel/ExecutionNightlyRun"
+
+#-----------------------------------#
+# 3: External packages installation #
+#-----------------------------------#
+
+#ISSM_EXTERNALPACKAGES can have 3 values:
+# - "install" install all external packages listed below
+# - "copy"    copy existing directories (EXTERNALPACKAGESDIR)
+# - "none"    leave external packages as is
+#             ->skip to section 4
+ISSM_EXTERNALPACKAGES="install"
+EXTERNALPACKAGESDIR="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/externalpackages"
+
+#List of external pakages to be installed
+EXTERNALPACKAGES="autoconf automake matlab mpich2 petsc metis triangle dakota chaco"
+
+#---------------------#
+# 4: ISSM Compilation #
+#---------------------#
+
+#ISSM_COMPILATION can have 2 values:
+# - "yes" compile ISSM
+# - "no"  do not compile ISSM
+ISSM_COMPILATION="yes"
+
+#----------------------#
+# 5: Mail notification #
+#----------------------#
+
+#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
+#sent to the adresses present in $ISSM_TIER/cron/mailinglist.
+SKIPMAIL="no"
+
+#Sender email address
+EMAIL_ADRESS="schlegel at jpl.nasa.gov"
+
+#------------------------#
+# 6: Nightly run options #
+#------------------------#
+
+#number of cpus used in ISSM installation and compilation (one is usually
+#safer as some packages are very sensitive to parallel compilation)
+NUMCPUS_INSTALL=1
+
+#number of cpus used in the nightly runs.
+NUMCPUS_RUN=7
+
+#Nightly run options. The matlab routine nightlyrun.m will be called
+#as follows: nightlyrun($NROPTIONS). The options must be understandable
+#by Matlab and nightlyrun.m
+#ex: "'id',[101 102 103]"
+
+NROPTIONS=""

Copied: issm/trunk/cron/configs/linux64_schlegel_validation (from rev 11526, issm/trunk-jpl/cron/configs/linux64_schlegel_validation)
===================================================================
--- issm/trunk/cron/configs/linux64_schlegel_validation	                        (rev 0)
+++ issm/trunk/cron/configs/linux64_schlegel_validation	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,92 @@
+########### Configuration file for Mathieu Morlighem's nightly run on Linux ############
+
+#-------------------------------#
+# 1: ISSM general configuration #
+#-------------------------------#
+
+#ISSM main directory (full path)
+ISSM_DIR="/u/astrid-r1b/schlegel/issmuci"
+ISSM_TIER="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk-jpl"
+#ISSM_TIER="/u/astrid-r1b/seroussi/svn/issm/trunk/cron/issm2.2"
+
+#ISSM Architecture
+ISSM_ARCH="linux-gnu-amd64"
+
+#Machine configuration
+MACHINE="astrid"
+
+#MATLAB path
+MATLAB_PATH="/usr/local/pkgs/matlab-7.6/"
+
+#----------------------#
+# 2: ISSM Installation #
+#----------------------#
+
+#ISSM_INSTALLATION can have 3 values:
+# - "checkout" the existing version of the code will be erased and
+#              the latest version will be checked out
+# - "update"   the directory won't be erased but ISSM will be updated
+#              ->skip to section 3
+# - "none"     leave ISSM as is in its directory
+#              ->skip to section 3
+ISSM_INSTALLATION="checkout"
+
+#SVN repository
+REPOSITORY="https://issm.ess.uci.edu/svn/issm/issm/trunk-jpl"
+#REPOSITORY="http://s383-rhat/issm/svn/issm/branches/issm2.2"
+
+#execution path used for parallel runs
+EXECUTION_PATH="/u/astrid-r1b/schlegel/ExecutionNightlyRun"
+
+#-----------------------------------#
+# 3: External packages installation #
+#-----------------------------------#
+
+#ISSM_EXTERNALPACKAGES can have 3 values:
+# - "install" install all external packages listed below
+# - "copy"    copy existing directories (EXTERNALPACKAGESDIR)
+# - "none"    leave external packages as is
+#             ->skip to section 4
+ISSM_EXTERNALPACKAGES="install"
+EXTERNALPACKAGESDIR="/u/astrid-r1b/schlegel/issmuci/trunk-jpl/externalpackages"
+
+#List of external pakages to be installed
+EXTERNALPACKAGES="autoconf automake matlab mpich2 petsc metis triangle dakota chaco yams"
+
+#---------------------#
+# 4: ISSM Compilation #
+#---------------------#
+
+#ISSM_COMPILATION can have 2 values:
+# - "yes" compile ISSM
+# - "no"  do not compile ISSM
+ISSM_COMPILATION="yes"
+
+#----------------------#
+# 5: Mail notification #
+#----------------------#
+
+#Mail delivery. If SKIPMAIL="no", the html nightly run report will be
+#sent to the adresses present in $ISSM_TIER/cron/mailinglist.
+SKIPMAIL="no"
+
+#Sender email address
+EMAIL_ADRESS="schlegel at jpl.nasa.gov"
+
+#------------------------#
+# 6: Nightly run options #
+#------------------------#
+
+#number of cpus used in ISSM installation and compilation (one is usually
+#safer as some packages are very sensitive to parallel compilation)
+NUMCPUS_INSTALL=1
+
+#number of cpus used in the nightly runs.
+NUMCPUS_RUN=7
+
+#Nightly run options. The matlab routine nightlyrun.m will be called
+#as follows: nightlyrun($NROPTIONS). The options must be understandable
+#by Matlab and nightlyrun.m
+#ex: "'id',[101 102 103]"
+
+NROPTIONS="'benchmark','all'"

Modified: issm/trunk/cron/cronfiles/linux_cronfile
===================================================================
--- issm/trunk/cron/cronfiles/linux_cronfile	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/cron/cronfiles/linux_cronfile	2012-02-24 16:12:47 UTC (rev 11527)
@@ -2,13 +2,18 @@
 SHELL=/bin/bash
 
 #mail output to Mathieu
-MAILTO=eric.larour at jpl.nasa.gov,mathieu.morlighem at jpl.nasa.gov,helene.seroussi at jpl.nasa.gov
+MAILTO=eric.larour at jpl.nasa.gov,mathieu.morlighem at jpl.nasa.gov,helene.seroussi at jpl.nasa.gov,Christopher.P.Borstad at jpl.nasa.gov,Nicole-Jeanne.Schlegel at jpl.nasa.gov,Feras.A.Habbal at jpl.nasa.gov
 
 #cronjob
-00 09 * * 1-5 cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
-30 12 * * 1-5 cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
-00 15 * * 1-5 cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
-00 18 * * 1-5 cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_daily
-00 23 * * 1-5 cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_nightly
-00 23 * * 6   cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_validation
-00 23 * * 7   cd /u/astrid-r1b/seroussi/issm/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_seroussi_ucitrunk
+00 09 * * 1-5 cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_daily
+30 12 * * 1-5 cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_daily
+00 15 * * 1-5 cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_daily
+00 18 * * 1-5 cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_daily
+00 23 * * 1-5 cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_nightly
+00 20 * * 6   cd /u/astrid-r1b/schlegel/ExecutionNightlyRun && rm -r test*
+00 21 * * 6   cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk-jpl/test/NightlyRun && make clean
+00 22 * * 6   cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk-jpl/test/NightlyRun && rm -r qmu*
+00 23 * * 6   cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_validation
+00 21 * * 7   cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk/test/NightlyRun && make clean
+00 22 * * 7   cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/trunk/test/NightlyRun && rm -r qmu*
+00 23 * * 7   cd /u/astrid-r1b/schlegel/issmuci/trunk-jpl/cron/ && ./nightlyrun.sh configs/linux64_schlegel_ucitrunk

Modified: issm/trunk/etc/environment.sh
===================================================================
--- issm/trunk/etc/environment.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/etc/environment.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -223,3 +223,6 @@
 
 #SHAPELIB
 export PATH="$PATH:$SHAPELIB_DIR/exec"
+
+#CCCL
+export PATH="$PATH:$CCCL_DIR/bin"

Modified: issm/trunk/etc/environment_variables.sh
===================================================================
--- issm/trunk/etc/environment_variables.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/etc/environment_variables.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -165,3 +165,6 @@
 
 #shapelib
 SHAPELIB_DIR="$ISSM_TIER/externalpackages/shapelib/install"
+
+#cccl
+CCCL_DIR="$ISSM_TIER/externalpackages/cccl/install"


Property changes on: issm/trunk/externalpackages/android/HelloWorldAppProject
___________________________________________________________________
Added: svn:ignore
   + local.*


Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.example.helloworld"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <application android:label="@string/app_name" >
-        <activity android:name="HelloWorldAppActivity"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-    </application>
-</manifest> 

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/AndroidManifest.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.helloworld"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:label="@string/app_name" >
+        <activity android:name="HelloWorldAppActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest> 

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/ant.properties	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,17 +0,0 @@
-# This file is used to override default values used by the Ant build system.
-#
-# This file must be checked in Version Control Systems, as it is
-# integral to the build system of your project.
-
-# This file is only used by the Ant script.
-
-# You can use this to override default values such as
-#  'source.dir' for the location of your java source folder and
-#  'out.dir' for the location of your output folder.
-
-# You can also use it define how the release builds are signed by declaring
-# the following properties:
-#  'key.store' for the location of your keystore and
-#  'key.alias' for the name of the key to use.
-# The password will be asked during the build when you use the 'release' target.
-

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/ant.properties)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/ant.properties	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,17 @@
+# This file is used to override default values used by the Ant build system.
+#
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,3 +0,0 @@
-/Users/gperez/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk : \
-/Users/gperez/HelloWorldAppProject/bin/HelloWorldApp.ap_ \
-/Users/gperez/HelloWorldAppProject/bin/classes.dex \

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,3 @@
+/Users/gperez/HelloWorldAppProject/bin/HelloWorldApp-debug-unaligned.apk : \
+/Users/gperez/HelloWorldAppProject/bin/HelloWorldApp.ap_ \
+/Users/gperez/HelloWorldAppProject/bin/classes.dex \

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug.apk
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug.apk (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp-debug.apk)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_ (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +0,0 @@
-/Users/gperez/HelloWorldAppProject/bin/HelloWorldApp.ap_ \
- : /Users/gperez/HelloWorldAppProject/res/layout/main.xml \
-/Users/gperez/HelloWorldAppProject/res/values/strings.xml \
-/Users/gperez/HelloWorldAppProject/AndroidManifest.xml \

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/HelloWorldApp.ap_.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,4 @@
+/Users/gperez/HelloWorldAppProject/bin/HelloWorldApp.ap_ \
+ : /Users/gperez/HelloWorldAppProject/res/layout/main.xml \
+/Users/gperez/HelloWorldAppProject/res/values/strings.xml \
+/Users/gperez/HelloWorldAppProject/AndroidManifest.xml \

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/build.prop	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,10 +0,0 @@
-#Last build type
-#Tue, 21 Feb 2012 11:52:47 -0800
-
-build.last.target=debug
-
-build.last.is.instrumented=false
-
-build.last.is.packaging.debug=true
-
-build.last.is.signing.debug=true

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/build.prop)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/build.prop	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,10 @@
+#Last build type
+#Tue, 21 Feb 2012 11:52:47 -0800
+
+build.last.target=debug
+
+build.last.is.instrumented=false
+
+build.last.is.packaging.debug=true
+
+build.last.is.signing.debug=true

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/HelloWorldAppActivity.class
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/HelloWorldAppActivity.class (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/HelloWorldAppActivity.class)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$attr.class
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$attr.class (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$attr.class)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$layout.class
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$layout.class (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$layout.class)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$string.class
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$string.class (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R$string.class)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R.class
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R.class (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes/com/example/helloworld/R.class)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes.dex)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1 +0,0 @@
-/Users/gperez/HelloWorldAppProject/bin/classes.dex : \

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/bin/classes.dex.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+/Users/gperez/HelloWorldAppProject/bin/classes.dex : \

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/build.xml	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="HelloWorldApp" default="help">
-
-    <!-- The local.properties file is created and updated by the 'android' tool.
-         It contains the path to the SDK. It should *NOT* be checked into
-         Version Control Systems. -->
-    <property file="local.properties" />
-
-    <!-- The ant.properties file can be created by you. It is only edited by the
-         'android' tool to add properties to it.
-         This is the place to change some Ant specific build properties.
-         Here are some properties you may want to change/update:
-
-         source.dir
-             The name of the source directory. Default is 'src'.
-         out.dir
-             The name of the output directory. Default is 'bin'.
-
-         For other overridable properties, look at the beginning of the rules
-         files in the SDK, at tools/ant/build.xml
-
-         Properties related to the SDK location or the project target should
-         be updated using the 'android' tool with the 'update' action.
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems.
-
-         -->
-    <property file="ant.properties" />
-
-    <!-- The project.properties file is created and updated by the 'android'
-         tool, as well as ADT.
-
-         This contains project specific properties such as project target, and library
-         dependencies. Lower level build properties are stored in ant.properties
-         (or in .classpath for Eclipse projects).
-
-         This file is an integral part of the build system for your
-         application and should be checked into Version Control Systems. -->
-    <loadproperties srcFile="project.properties" />
-
-    <!-- quick check on sdk.dir -->
-    <fail
-            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
-            unless="sdk.dir"
-    />
-
-
-<!-- extension targets. Uncomment the ones where you want to do custom work
-     in between standard targets -->
-<!--
-    <target name="-pre-build">
-    </target>
-    <target name="-pre-compile">
-    </target>
-
-    /* This is typically used for code obfuscation.
-       Compiled code location: ${out.classes.absolute.dir}
-       If this is not done in place, override ${out.dex.input.absolute.dir} */
-    <target name="-post-compile">
-    </target>
--->
-
-    <!-- Import the actual build file.
-
-         To customize existing targets, there are two options:
-         - Customize only one target:
-             - copy/paste the target into this file, *before* the
-               <import> task.
-             - customize it to your needs.
-         - Customize the whole content of build.xml
-             - copy/paste the content of the rules files (minus the top node)
-               into this file, replacing the <import> task.
-             - customize to your needs.
-
-         ***********************
-         ****** IMPORTANT ******
-         ***********************
-         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
-         in order to avoid having your file be overridden by tools such as "android update project"
-    -->
-    <!-- version-tag: 1 -->
-    <import file="${sdk.dir}/tools/ant/build.xml" />
-
-</project>

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/build.xml)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/build.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="HelloWorldApp" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked into
+         Version Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The ant.properties file can be created by you. It is only edited by the
+         'android' tool to add properties to it.
+         This is the place to change some Ant specific build properties.
+         Here are some properties you may want to change/update:
+
+         source.dir
+             The name of the source directory. Default is 'src'.
+         out.dir
+             The name of the output directory. Default is 'bin'.
+
+         For other overridable properties, look at the beginning of the rules
+         files in the SDK, at tools/ant/build.xml
+
+         Properties related to the SDK location or the project target should
+         be updated using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems.
+
+         -->
+    <property file="ant.properties" />
+
+    <!-- The project.properties file is created and updated by the 'android'
+         tool, as well as ADT.
+
+         This contains project specific properties such as project target, and library
+         dependencies. Lower level build properties are stored in ant.properties
+         (or in .classpath for Eclipse projects).
+
+         This file is an integral part of the build system for your
+         application and should be checked into Version Control Systems. -->
+    <loadproperties srcFile="project.properties" />
+
+    <!-- quick check on sdk.dir -->
+    <fail
+            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
+            unless="sdk.dir"
+    />
+
+
+<!-- extension targets. Uncomment the ones where you want to do custom work
+     in between standard targets -->
+<!--
+    <target name="-pre-build">
+    </target>
+    <target name="-pre-compile">
+    </target>
+
+    /* This is typically used for code obfuscation.
+       Compiled code location: ${out.classes.absolute.dir}
+       If this is not done in place, override ${out.dex.input.absolute.dir} */
+    <target name="-post-compile">
+    </target>
+-->
+
+    <!-- Import the actual build file.
+
+         To customize existing targets, there are two options:
+         - Customize only one target:
+             - copy/paste the target into this file, *before* the
+               <import> task.
+             - customize it to your needs.
+         - Customize the whole content of build.xml
+             - copy/paste the content of the rules files (minus the top node)
+               into this file, replacing the <import> task.
+             - customize to your needs.
+
+         ***********************
+         ****** IMPORTANT ******
+         ***********************
+         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
+         in order to avoid having your file be overridden by tools such as "android update project"
+    -->
+    <!-- version-tag: 1 -->
+    <import file="${sdk.dir}/tools/ant/build.xml" />
+
+</project>

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/gen/R.java.d	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +0,0 @@
-/Users/gperez/HelloWorldAppProject/gen/com/example/helloworld/R.java \
- : /Users/gperez/HelloWorldAppProject/res/layout/main.xml \
-/Users/gperez/HelloWorldAppProject/res/values/strings.xml \
-/Users/gperez/HelloWorldAppProject/AndroidManifest.xml \

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/gen/R.java.d)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/gen/R.java.d	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,4 @@
+/Users/gperez/HelloWorldAppProject/gen/com/example/helloworld/R.java \
+ : /Users/gperez/HelloWorldAppProject/res/layout/main.xml \
+/Users/gperez/HelloWorldAppProject/res/values/strings.xml \
+/Users/gperez/HelloWorldAppProject/AndroidManifest.xml \

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,19 +0,0 @@
-/* AUTO-GENERATED FILE.  DO NOT MODIFY.
- *
- * This class was automatically generated by the
- * aapt tool from the resource data it found.  It
- * should not be modified by hand.
- */
-
-package com.example.helloworld;
-
-public final class R {
-    public static final class attr {
-    }
-    public static final class layout {
-        public static final int main=0x7f020000;
-    }
-    public static final class string {
-        public static final int app_name=0x7f030000;
-    }
-}

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/gen/com/example/helloworld/R.java	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,19 @@
+/* AUTO-GENERATED FILE.  DO NOT MODIFY.
+ *
+ * This class was automatically generated by the
+ * aapt tool from the resource data it found.  It
+ * should not be modified by hand.
+ */
+
+package com.example.helloworld;
+
+public final class R {
+    public static final class attr {
+    }
+    public static final class layout {
+        public static final int main=0x7f020000;
+    }
+    public static final class string {
+        public static final int app_name=0x7f030000;
+    }
+}

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/proguard.cfg	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,40 +0,0 @@
--optimizationpasses 5
--dontusemixedcaseclassnames
--dontskipnonpubliclibraryclasses
--dontpreverify
--verbose
--optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-
--keep public class * extends android.app.Activity
--keep public class * extends android.app.Application
--keep public class * extends android.app.Service
--keep public class * extends android.content.BroadcastReceiver
--keep public class * extends android.content.ContentProvider
--keep public class * extends android.app.backup.BackupAgentHelper
--keep public class * extends android.preference.Preference
--keep public class com.android.vending.licensing.ILicensingService
-
--keepclasseswithmembernames class * {
-    native <methods>;
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet);
-}
-
--keepclasseswithmembers class * {
-    public <init>(android.content.Context, android.util.AttributeSet, int);
-}
-
--keepclassmembers class * extends android.app.Activity {
-   public void *(android.view.View);
-}
-
--keepclassmembers enum * {
-    public static **[] values();
-    public static ** valueOf(java.lang.String);
-}
-
--keep class * implements android.os.Parcelable {
-  public static final android.os.Parcelable$Creator *;
-}

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/proguard.cfg)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/proguard.cfg	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+   public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+  public static final android.os.Parcelable$Creator *;
+}

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/project.properties	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-#
-# This file must be checked in Version Control Systems.
-#
-# To customize properties used by the Ant build system use,
-# "ant.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-7

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/project.properties)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/project.properties	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/res/layout/main.xml	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:text="Hello World, HelloWorldAppActivity"
-    />
-</LinearLayout>
-

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/res/layout/main.xml)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/res/layout/main.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+<TextView  
+    android:layout_width="fill_parent" 
+    android:layout_height="wrap_content" 
+    android:text="Hello World, HelloWorldAppActivity"
+    />
+</LinearLayout>
+

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/res/values/strings.xml	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-    <string name="app_name">HelloWorldAppActivity</string>
-</resources>

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/res/values/strings.xml)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/res/values/strings.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">HelloWorldAppActivity</string>
+</resources>

Deleted: issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java
===================================================================
--- issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +0,0 @@
-package com.example.helloworld;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class HelloWorldAppActivity extends Activity
-{
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState)
-    {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-    }
-}

Copied: issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java (from rev 11526, issm/trunk-jpl/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java)
===================================================================
--- issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java	                        (rev 0)
+++ issm/trunk/externalpackages/android/HelloWorldAppProject/src/com/example/helloworld/HelloWorldAppActivity.java	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,15 @@
+package com.example.helloworld;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class HelloWorldAppActivity extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.main);
+    }
+}

Deleted: issm/trunk/externalpackages/android/README
===================================================================
--- issm/trunk-jpl/externalpackages/android/README	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/android/README	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,19 +0,0 @@
-//Written by: Gilberto Perez
-//Last Modified 2/21/2012
-/*
- * This is a temporary readme file for the installation of the Android emulator.
- */
-1) Download the Android SDK <http://developer.android.com/sdk/index.html>. 
-2) Add to your PATH the following:
-	ANDROID_HOME=~/android-sdk-macosx
-	PATH=${PATH}:ANDROID_HOME/platforms/android-15/:~ANDROID_HOME/platform-tools/:ANDROID_HOME/tools/
-3) Run Android and install the newest Android distribution(as of the last update: android-15)
-4) Navigate to the project directory and run Android update project ./
-5) Run ant debug.
-6) Initiate an emulator by entering:
-	1) android list targets (this will produce a list of available of system image targets)
-	2) android create avd -n <name> -t<targetID> (Choose targetID to match android-15)
-7) Start up the emulator by entering: emulator -avd <avd_name>
-8) Install the app by entering: adb install <path_to_your_bin>.apk
-
-The app should be installed and ready to run from the virtual device!

Copied: issm/trunk/externalpackages/android/README (from rev 11526, issm/trunk-jpl/externalpackages/android/README)
===================================================================
--- issm/trunk/externalpackages/android/README	                        (rev 0)
+++ issm/trunk/externalpackages/android/README	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,19 @@
+//Written by: Gilberto Perez
+//Last Modified 2/21/2012
+/*
+ * This is a temporary readme file for the installation of the Android emulator.
+ */
+1) Download the Android SDK <http://developer.android.com/sdk/index.html>. 
+2) Add to your PATH the following:
+	ANDROID_HOME=~/android-sdk-macosx
+	PATH=${PATH}:ANDROID_HOME/platforms/android-15/:~ANDROID_HOME/platform-tools/:ANDROID_HOME/tools/
+3) Run Android and install the newest Android distribution(as of the last update: android-15)
+4) Navigate to the project directory and run Android update project ./
+5) Run ant debug.
+6) Initiate an emulator by entering:
+	1) android list targets (this will produce a list of available of system image targets)
+	2) android create avd -n <name> -t<targetID> (Choose targetID to match android-15)
+7) Start up the emulator by entering: emulator -avd <avd_name>
+8) Install the app by entering: adb install <path_to_your_bin>.apk
+
+The app should be installed and ready to run from the virtual device!

Deleted: issm/trunk/externalpackages/autoconf/autoconf-2.63.tar.gz
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/autoconf/autoconf-2.68.tar.gz (from rev 11526, issm/trunk-jpl/externalpackages/autoconf/autoconf-2.68.tar.gz)
===================================================================
(Binary files differ)

Modified: issm/trunk/externalpackages/autoconf/install.sh
===================================================================
--- issm/trunk/externalpackages/autoconf/install.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/autoconf/install.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,16 +1,16 @@
 #!/bin/bash
 
 #Some cleanup
-rm -rf install autoconf-2.63 src
+rm -rf install autoconf-2.68 src
 
 #Create install directories
 mkdir install
 
 #Untar 
-tar -zxvf  autoconf-2.63.tar.gz
+tar -zxvf  autoconf-2.68.tar.gz
 
 #Move autoconf into src directory
-mv autoconf-2.63 src
+mv autoconf-2.68 src
 
 #Compile autoconf
 cd src 

Deleted: issm/trunk/externalpackages/automake/automake-1.10.2.tar.gz
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/automake/automake-1.11.3.tar.gz (from rev 11526, issm/trunk-jpl/externalpackages/automake/automake-1.11.3.tar.gz)
===================================================================
(Binary files differ)

Modified: issm/trunk/externalpackages/automake/install.sh
===================================================================
--- issm/trunk/externalpackages/automake/install.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/automake/install.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,14 +1,14 @@
 #!/bin/bash
 
 #Some cleanup
-rm -rf install automake-1.10.2 src
+rm -rf install automake-1.11.3 src
 
 #Create install directories
 mkdir install
 
 #Untar 
-tar -zxvf  automake-1.10.2.tar.gz
-mv automake-1.10.2 src
+tar -zxvf  automake-1.11.3.tar.gz
+mv automake-1.11.3 src
 
 #Compile automake
 cd src 

Deleted: issm/trunk/externalpackages/bsdtar/install-win7.sh
===================================================================
--- issm/trunk-jpl/externalpackages/bsdtar/install-win7.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/bsdtar/install-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,17 +0,0 @@
-#!/bin/bash
-
-#Some cleanup
-rm -rf install src libarchive-3.0.3
-mkdir install src
-
-#Untar 
-tar -zxvf  libarchive-3.0.3.tar.gz
-
-#Move libarchive into src directory
-mv libarchive-3.0.3/* src
-rm -rf libarchive-3.0.3
-
-cd src 
-./configure --prefix="$ISSM_TIER/externalpackages/bsdtar/install" 
-make
-make install

Copied: issm/trunk/externalpackages/bsdtar/install-win7.sh (from rev 11526, issm/trunk-jpl/externalpackages/bsdtar/install-win7.sh)
===================================================================
--- issm/trunk/externalpackages/bsdtar/install-win7.sh	                        (rev 0)
+++ issm/trunk/externalpackages/bsdtar/install-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install src libarchive-3.0.3
+mkdir install src
+
+#Untar 
+tar -zxvf  libarchive-3.0.3.tar.gz
+
+#Move libarchive into src directory
+mv libarchive-3.0.3/* src
+rm -rf libarchive-3.0.3
+
+cd src 
+./configure --prefix="$ISSM_TIER/externalpackages/bsdtar/install" 
+make
+make install

Deleted: issm/trunk/externalpackages/bsdtar/libarchive-3.0.3.tar.gz
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/bsdtar/libarchive-3.0.3.tar.gz (from rev 11526, issm/trunk-jpl/externalpackages/bsdtar/libarchive-3.0.3.tar.gz)
===================================================================
(Binary files differ)


Property changes on: issm/trunk/externalpackages/cccl
___________________________________________________________________
Added: svn:ignore
   + install


Deleted: issm/trunk/externalpackages/cccl/cccl-0.03.tar.gz
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/cccl/cccl-0.03.tar.gz (from rev 11526, issm/trunk-jpl/externalpackages/cccl/cccl-0.03.tar.gz)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/cccl/install-win7.orig.sh
===================================================================
--- issm/trunk-jpl/externalpackages/cccl/install-win7.orig.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/cccl/install-win7.orig.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,20 +0,0 @@
-#!/bin/bash
-
-#Some cleanup
-rm -rf src install cccl-0.03
-mkdir install src
-
-#Untar 
-tar -zxvf  cccl-0.03.tar.gz
-
-#Move cccl into install directory
-mv cccl-0.03/* src
-rm -rf cccl-0.03
-
-cd src 
-
-#Compile
-./configure --prefix="$ISSM_TIER/externalpackages/cccl/install"
-
-make
-make install

Copied: issm/trunk/externalpackages/cccl/install-win7.orig.sh (from rev 11526, issm/trunk-jpl/externalpackages/cccl/install-win7.orig.sh)
===================================================================
--- issm/trunk/externalpackages/cccl/install-win7.orig.sh	                        (rev 0)
+++ issm/trunk/externalpackages/cccl/install-win7.orig.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf src install cccl-0.03
+mkdir install src
+
+#Untar 
+tar -zxvf  cccl-0.03.tar.gz
+
+#Move cccl into install directory
+mv cccl-0.03/* src
+rm -rf cccl-0.03
+
+cd src 
+
+#Compile
+./configure --prefix="$ISSM_TIER/externalpackages/cccl/install"
+
+make
+make install

Deleted: issm/trunk/externalpackages/cccl/install-win7.sh
===================================================================
--- issm/trunk-jpl/externalpackages/cccl/install-win7.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/cccl/install-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,9 +0,0 @@
-#!/bin/bash
-
-#Some cleanup
-rm -rf install src cccl-0.03
-mkdir install 
-mkdir install/bin
-
-#Move cccl into install directory
-cp issm/cccl install/bin

Copied: issm/trunk/externalpackages/cccl/install-win7.sh (from rev 11526, issm/trunk-jpl/externalpackages/cccl/install-win7.sh)
===================================================================
--- issm/trunk/externalpackages/cccl/install-win7.sh	                        (rev 0)
+++ issm/trunk/externalpackages/cccl/install-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install src cccl-0.03
+mkdir install 
+mkdir install/bin
+
+#Move cccl into install directory
+cp issm/cccl install/bin

Deleted: issm/trunk/externalpackages/cccl/issm/cccl
===================================================================
--- issm/trunk-jpl/externalpackages/cccl/issm/cccl	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/cccl/issm/cccl	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,90 +0,0 @@
-#!/bin/sh
-
-# cccl 
-# Wrapper around MS's cl.exe and link.exe to make them act more like
-# Unix cc and ld
-#
-# Copyright (C) 2000-2003 Geoffrey Wossum (gwossum at acm.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 optsion) 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.
-#
-
-usage()
-{
-    cat <<EOF
-Usage: cccl [OPTIONS]
-
-cccl is a wrapper around Microsoft's cl.exe and link.exe.  It translates
-parameters that Unix cc's and ld's understand to parameters that cl and link
-understand.
-EOF
-    exit $1
-}
-
-prog=cl
-
-### Run through every optsion and convert it to the proper MS one
-while test $# -gt 0; do
-
-    case "$1" in
-    --version)
-	cat <<EOF
-cccl 0.03
-
-Copyright 2000-2003 Geoffrey Wossum
-This is free software; see the source for copying conditions.  There is NO
-waranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-EOF
-	exit 1;
-	;;
-
-    -o)
-	# specifying output file, is it an object or an executable
-	shift
-	case "$1" in
-			
-		*.exe)
-			opts="$opts /Fe$1";
-		;;
-
-
-		*.mex*)
-			opts="$opts -o $1"
-		;;
-
-		*.o | *.obj)
-			opts="$opts /Fo$1"
-		;;
-
-		*)
-			opts="$opts /Fo$1"
-		;;
-    esac
-	;;
-	*)
-		#do nothing
-		opts="$opts $1"
-	;;
-
-	
-    esac
-    shift
-done
-
-echo "$prog $opts"
-exec $prog $opts
-exit 0
-
-    

Copied: issm/trunk/externalpackages/cccl/issm/cccl (from rev 11526, issm/trunk-jpl/externalpackages/cccl/issm/cccl)
===================================================================
--- issm/trunk/externalpackages/cccl/issm/cccl	                        (rev 0)
+++ issm/trunk/externalpackages/cccl/issm/cccl	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,90 @@
+#!/bin/sh
+
+# cccl 
+# Wrapper around MS's cl.exe and link.exe to make them act more like
+# Unix cc and ld
+#
+# Copyright (C) 2000-2003 Geoffrey Wossum (gwossum at acm.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 optsion) 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.
+#
+
+usage()
+{
+    cat <<EOF
+Usage: cccl [OPTIONS]
+
+cccl is a wrapper around Microsoft's cl.exe and link.exe.  It translates
+parameters that Unix cc's and ld's understand to parameters that cl and link
+understand.
+EOF
+    exit $1
+}
+
+prog=cl
+
+### Run through every optsion and convert it to the proper MS one
+while test $# -gt 0; do
+
+    case "$1" in
+    --version)
+	cat <<EOF
+cccl 0.03
+
+Copyright 2000-2003 Geoffrey Wossum
+This is free software; see the source for copying conditions.  There is NO
+waranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+EOF
+	exit 1;
+	;;
+
+    -o)
+	# specifying output file, is it an object or an executable
+	shift
+	case "$1" in
+			
+		*.exe)
+			opts="$opts /Fe$1";
+		;;
+
+
+		*.mex*)
+			opts="$opts -o $1"
+		;;
+
+		*.o | *.obj)
+			opts="$opts /Fo$1"
+		;;
+
+		*)
+			opts="$opts /Fo$1"
+		;;
+    esac
+	;;
+	*)
+		#do nothing
+		opts="$opts $1"
+	;;
+
+	
+    esac
+    shift
+done
+
+echo "$prog $opts"
+exec $prog $opts
+exit 0
+
+    

Modified: issm/trunk/externalpackages/doxygen/install.sh
===================================================================
--- issm/trunk/externalpackages/doxygen/install.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/doxygen/install.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,24 +1,13 @@
 #!/bin/bash
 
-#wget http://ftp.stack.nl/pub/users/dimitri/doxygen-1.7.4.src.tar.gz
-
 #Some cleanup
-rm -rf src
 rm -rf install
-rm -rf doxygen-1.7.4
 
-#Create src and install directories
-mkdir src install
+#Download latest version
+svn co https://doxygen.svn.sourceforge.net/svnroot/doxygen/trunk install
 
-#Untar 
-tar -zxvf  doxygen-1.7.4.src.tar.gz
-
-#Move doxygen into src directory
-mv doxygen-1.7.4/* src
-rm -rf doxygen-1.7.4
-
 #Configure doxygen
-cd src && ./configure --prefix "$ISSM_TIER/externalpackages/doxygen/install"
+cd install && ./configure --prefix "$ISSM_TIER/externalpackages/doxygen/install"
 if [ -z $1 ]; then
 	make
 else

Deleted: issm/trunk/externalpackages/flaim/install
===================================================================
--- issm/trunk/externalpackages/flaim/install	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/flaim/install	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1 +0,0 @@
-link /proj/ice/larour/flaim/trunk/
\ No newline at end of file

Modified: issm/trunk/externalpackages/flaim/install.sh
===================================================================
--- issm/trunk/externalpackages/flaim/install.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/flaim/install.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -4,4 +4,4 @@
 rm -rf install
 
 #symlink to flaim directory
-ln -s /proj/ice/larour/flaim/trunk/ ./install
+ln -s /home/jschierm/flaim/svn/trunk ./install

Copied: issm/trunk/externalpackages/intel/intel-windows7.sh (from rev 11526, issm/trunk-jpl/externalpackages/intel/intel-windows7.sh)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch
===================================================================
--- issm/trunk-jpl/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,10 +0,0 @@
-3,5c3
-< CC = gcc
-< OBJ_EXT=o
-< LIB_EXT=a
----
-> CC = icc
-8c6
-< OPTFLAGS = -DLINUX -fPIC
----
-> OPTFLAGS = -O3

Copied: issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch (from rev 11526, issm/trunk-jpl/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch)
===================================================================
--- issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch	                        (rev 0)
+++ issm/trunk/externalpackages/metis/configs/4.0/greenplanet/Makefile.in.patch	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,10 @@
+3,5c3
+< CC = gcc
+< OBJ_EXT=o
+< LIB_EXT=a
+---
+> CC = icc
+8c6
+< OPTFLAGS = -DLINUX -fPIC
+---
+> OPTFLAGS = -O3

Deleted: issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch
===================================================================
--- issm/trunk-jpl/externalpackages/metis/configs/4.0/win7/Makefile.in.patch	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,25 +0,0 @@
-3,5c3,5
-< CC = cl
-< OBJ_EXT=obj
-< LIB_EXT=lib
----
-> CC = gcc
-> OBJ_EXT=o
-> LIB_EXT=a
-8c8
-< OPTFLAGS = -DWIN32 -D__VC__
----
-> OPTFLAGS = -DLINUX -fPIC
-16,17c16,24
-< # What tool to use to create library
-< LIB=lib.exe
----
-> # What archiving to use
-> AR = ar rv
-> 
-> # What to use for indexing the archive
-> RANLIB = ranlib
-> #RANLIB = ar -ts
-> #RANLIB = 
-> 
-> 

Copied: issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch (from rev 11526, issm/trunk-jpl/externalpackages/metis/configs/4.0/win7/Makefile.in.patch)
===================================================================
--- issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch	                        (rev 0)
+++ issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.in.patch	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,25 @@
+3,5c3,5
+< CC = cl
+< OBJ_EXT=obj
+< LIB_EXT=lib
+---
+> CC = gcc
+> OBJ_EXT=o
+> LIB_EXT=a
+8c8
+< OPTFLAGS = -DWIN32 -D__VC__
+---
+> OPTFLAGS = -DLINUX -fPIC
+16,17c16,24
+< # What tool to use to create library
+< LIB=lib.exe
+---
+> # What archiving to use
+> AR = ar rv
+> 
+> # What to use for indexing the archive
+> RANLIB = ranlib
+> #RANLIB = ar -ts
+> #RANLIB = 
+> 
+> 

Deleted: issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch
===================================================================
--- issm/trunk-jpl/externalpackages/metis/configs/4.0/win7/Makefile.patch	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,5 +0,0 @@
-24c24,25
-< 	$(LIB) -out:$@ $(OBJS)
----
-> 	$(AR) $@ $(OBJS)
-> 	$(RANLIB) $@

Copied: issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch (from rev 11526, issm/trunk-jpl/externalpackages/metis/configs/4.0/win7/Makefile.patch)
===================================================================
--- issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch	                        (rev 0)
+++ issm/trunk/externalpackages/metis/configs/4.0/win7/Makefile.patch	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,5 @@
+24c24,25
+< 	$(LIB) -out:$@ $(OBJS)
+---
+> 	$(AR) $@ $(OBJS)
+> 	$(RANLIB) $@

Copied: issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh (from rev 11526, issm/trunk-jpl/externalpackages/metis/install-4.0-greenplanet.sh)
===================================================================
--- issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh	                        (rev 0)
+++ issm/trunk/externalpackages/metis/install-4.0-greenplanet.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install metis-4.0
+mkdir install
+
+#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

Copied: issm/trunk/externalpackages/metis/install-4.0-win7.sh (from rev 11526, issm/trunk-jpl/externalpackages/metis/install-4.0-win7.sh)
===================================================================
--- issm/trunk/externalpackages/metis/install-4.0-win7.sh	                        (rev 0)
+++ issm/trunk/externalpackages/metis/install-4.0-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install metis-4.0
+mkdir install
+
+#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 -R Makefile.in ../configs/4.0/win7/Makefile.in.patch
+
+#Compile
+make

Copied: issm/trunk/externalpackages/petsc/install-2.3.2-win7.sh (from rev 11526, issm/trunk-jpl/externalpackages/petsc/install-2.3.2-win7.sh)
===================================================================
--- issm/trunk/externalpackages/petsc/install-2.3.2-win7.sh	                        (rev 0)
+++ issm/trunk/externalpackages/petsc/install-2.3.2-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-2.3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-2.3.2-p3.tar.gz
+mv petsc-2.3.2-p3/* install/
+rm -rf petsc-2.3.2-p3
+
+#configure
+cd install
+./config/configure.py  \
+	--with-parallel-no \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--PETSC_ARCH=cygwin-intel \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/install" \
+	--with-debugging=0 \
+	--with-mpi=0 \
+	--download-c-blas-lapack=1
+
+#Compile petsc and install it
+make
+make install

Copied: issm/trunk/externalpackages/petsc/install-3.1-win7.sh (from rev 11526, issm/trunk-jpl/externalpackages/petsc/install-3.1-win7.sh)
===================================================================
--- issm/trunk/externalpackages/petsc/install-3.1-win7.sh	                        (rev 0)
+++ issm/trunk/externalpackages/petsc/install-3.1-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.1-p7 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.1-p7.tar.gz
+mv petsc-3.1-p7/* src/
+rm -rf petsc-3.1-p7
+
+#configure
+cd src
+./config/configure.py  \
+	--with-parallel-no \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--PETSC_ARCH=cygwin-intel \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	--with-debugging=0 \
+	--with-mpi=0 \
+	--download-c-blas-lapack=1
+
+#./config/configure.py  \
+# --prefix="$ISSM_TIER/externalpackages/petsc/install" \
+# --PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+# --PETSC_ARCH=macosx-gnu \
+# --with-mpi-dir=$ISSM_TIER/externalpackages/mpich2/install \
+# --with-debugging=0 \
+# --with-shared=0 \
+# --download-mumps=yes \
+# --download-scalapack=yes \
+# --download-blacs=yes \
+# --download-blas=yes \
+# --download-f-blas-lapack=yes \
+# --download-plapack=yes \
+# --FFLAGS="-I$ISSM_TIER/externalpackages/mpich2/install/include -arch i386" \
+# --COPTFLAGS="-march=opteron -O2 -arch i386" \
+# --FOPTFLAGS="-march=opteron -O2 -arch i386" \
+# --CXXOPTFLAGS="-march=opteron -O2 -arch i386" \
+# --download-parmetis=yes
+
+#Compile petsc and install it
+make
+make install

Copied: issm/trunk/externalpackages/petsc/install-3.2-greenplanet.sh (from rev 11526, issm/trunk-jpl/externalpackages/petsc/install-3.2-greenplanet.sh)
===================================================================
--- issm/trunk/externalpackages/petsc/install-3.2-greenplanet.sh	                        (rev 0)
+++ issm/trunk/externalpackages/petsc/install-3.2-greenplanet.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install petsc-3.2-p3 src
+mkdir install src
+
+#Untar and move petsc to install directory
+tar -zxvf  petsc-3.2-p3.tar.gz
+mv petsc-3.2-p3/* src/
+rm -rf petsc-3.2-p3
+
+#configure
+cd src
+./config/configure.py \
+	--prefix="$ISSM_TIER/externalpackages/petsc/install" \
+	--PETSC_DIR="$ISSM_TIER/externalpackages/petsc/src" \
+	--PETSC_ARCH="$ISSM_ARCH" \
+	--with-batch=1 \
+	--with-debugging=0 \
+	--with-shared-libraries=0 \
+	--known-mpi-shared-libraries=1 \
+	--with-mpi-dir=/sopt/mpi/openmpi-1.5.4_psm/intel/ \
+	--with-blas-lapack-dir=/opt/intel/mkl/10.2.4.032/ \
+	--download-mumps=yes \
+	--download-scalapack=yes \
+	--download-blacs=yes \
+	--download-plapack=yes \
+	--download-parmetis=yes \
+	--with-pic=1
+
+echo "== Follow PETSc's instructions"

Modified: issm/trunk/externalpackages/tao/install.sh
===================================================================
--- issm/trunk/externalpackages/tao/install.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/tao/install.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +1,17 @@
 #!/bin/bash
+#http://www.mcs.anl.gov/research/projects/tao/download/index.html
+#wget http://www.mcs.anl.gov/research/projects/tao/download/tao-2.0-p3.tar.gz
 
 #Some cleanup
-rm -rf install tao-1.10.1-p1
+rm -rf install tao-2.0-p3
 mkdir install
 
 #Untar 
-tar -zxvf  tao-1.10.1-p1.tar.gz
+tar -zxvf  tao-2.0-p3.tar.gz
 
 #move into place
-mv tao-1.10.1-p1/* install/
-rm -rf tao-1.10.1-p1
+mv tao-2.0-p3/* install/
+rm -rf tao-2.0-p3
 cd install
 export TAO_DIR="$ISSM_TIER/externalpackages/tao/install/"
 

Deleted: issm/trunk/externalpackages/tao/tao-1.10.1-p1.tar.gz
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/tao/tao-2.0-p3.tar.gz (from rev 11526, issm/trunk-jpl/externalpackages/tao/tao-2.0-p3.tar.gz)
===================================================================
(Binary files differ)

Deleted: issm/trunk/externalpackages/triangle/configs/win7/configure.make
===================================================================
--- issm/trunk-jpl/externalpackages/triangle/configs/win7/configure.make	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/triangle/configs/win7/configure.make	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +0,0 @@
-CC=cl
-CSWITCHES = $(CFLAGS) -I$(MATLAB_DIR)/extern/include  -I$(MATLAB_DIR)/include -DWIN32
-OBJ_EXT=obj
-LIB_EXT=lib

Copied: issm/trunk/externalpackages/triangle/configs/win7/configure.make (from rev 11526, issm/trunk-jpl/externalpackages/triangle/configs/win7/configure.make)
===================================================================
--- issm/trunk/externalpackages/triangle/configs/win7/configure.make	                        (rev 0)
+++ issm/trunk/externalpackages/triangle/configs/win7/configure.make	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,4 @@
+CC=cl
+CSWITCHES = $(CFLAGS) -I$(MATLAB_DIR)/extern/include  -I$(MATLAB_DIR)/include -DWIN32
+OBJ_EXT=obj
+LIB_EXT=lib

Deleted: issm/trunk/externalpackages/triangle/configs/win7/makefile
===================================================================
--- issm/trunk-jpl/externalpackages/triangle/configs/win7/makefile	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/triangle/configs/win7/makefile	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,21 +0,0 @@
-#Adaptation of Triangle makefile to compile only the triangle.c file, 
-#into a standalone library that can then be used to compile mex modules
-
-include ./configure.make
-
-AR = ar
-
-TRILIBDEFS = -DTRILIBRARY
-
-all: triangle.$(LIB_EXT)
-
-OBJECTS=triangle.$(OBJ_EXT)
-
-triangle.$(LIB_EXT): $(OBJECTS)
-	lib -out:triangle.$(LIB_EXT) $(OBJECTS)
-
-triangle.$(OBJ_EXT): triangle.c triangle.h
-	$(CC) $(CSWITCHES) $(TRILIBDEFS) -c triangle.c
-
-clean: 
-	rm -rf *.$(LIB_EXT) *.$(OBJ_EXT) *.LIB *.LST *.$(OBJ_EXT)bj *.BAK

Copied: issm/trunk/externalpackages/triangle/configs/win7/makefile (from rev 11526, issm/trunk-jpl/externalpackages/triangle/configs/win7/makefile)
===================================================================
--- issm/trunk/externalpackages/triangle/configs/win7/makefile	                        (rev 0)
+++ issm/trunk/externalpackages/triangle/configs/win7/makefile	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,21 @@
+#Adaptation of Triangle makefile to compile only the triangle.c file, 
+#into a standalone library that can then be used to compile mex modules
+
+include ./configure.make
+
+AR = ar
+
+TRILIBDEFS = -DTRILIBRARY
+
+all: triangle.$(LIB_EXT)
+
+OBJECTS=triangle.$(OBJ_EXT)
+
+triangle.$(LIB_EXT): $(OBJECTS)
+	lib -out:triangle.$(LIB_EXT) $(OBJECTS)
+
+triangle.$(OBJ_EXT): triangle.c triangle.h
+	$(CC) $(CSWITCHES) $(TRILIBDEFS) -c triangle.c
+
+clean: 
+	rm -rf *.$(LIB_EXT) *.$(OBJ_EXT) *.LIB *.LST *.$(OBJ_EXT)bj *.BAK

Copied: issm/trunk/externalpackages/triangle/install-win7.sh (from rev 11526, issm/trunk-jpl/externalpackages/triangle/install-win7.sh)
===================================================================
--- issm/trunk/externalpackages/triangle/install-win7.sh	                        (rev 0)
+++ issm/trunk/externalpackages/triangle/install-win7.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+#Some cleanup 
+rm -rf install triangle
+mkdir install
+
+#Untar 
+cd install
+cp ../triangle.zip ./
+unzip triangle.zip
+
+#copy new makefile
+cp ../configs/win7/configure.make ./
+cp ../configs/win7/makefile ./
+
+#Patch triangle.c 
+patch triangle.c ../triangle.c.patch
+
+#Compile triangle
+make
+
+#Patch triangle.h
+patch triangle.h ../triangle.h.patch

Modified: issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim
===================================================================
--- issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim	2012-02-24 16:12:47 UTC (rev 11527)
@@ -403,7 +403,7 @@
 "   please try to keep the alphabetical ordering                                                                    "
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 "ISSM containers:
-syn keyword	cType		Constraints DataSet Elements Inputs Loads Materials Parameters Results Vertices
+syn keyword	cType		Constraints DataSet Elements Inputs Loads Materials Nodes Parameters Results Vertices
 "Petsc
 syn keyword	cType		Vec Mat 
 "other ISSM's syntax
@@ -433,6 +433,7 @@
 syn keyword cType Penpair
 syn keyword cType Pengrid
 syn keyword cType Element
+syn keyword cType Load
 syn keyword cType Penta
 syn keyword cType PentaHook
 syn keyword cType PentaRef
@@ -464,6 +465,7 @@
 syn keyword cType KML_Style
 syn keyword cType KML_StyleSelector
 syn keyword cType KML_SubStyle
+syn keyword cType KML_Unknown
 syn keyword cType KMLFileReadUtils
 syn keyword cType Option
 syn keyword cType OptionDouble
@@ -476,15 +478,15 @@
 syn keyword cType BoolInput
 syn keyword cType DoubleInput
 syn keyword cType IntInput
-syn keyword cType PentaVertexInput
-syn keyword cType TriaVertexInput
+syn keyword cType PentaP1Input
+syn keyword cType TriaP1Input
 syn keyword cType ControlInput
 syn keyword cType DatasetInput
 syn keyword cType TransientInput
 syn keyword cType ElementResult
 syn keyword cType DoubleElementResult
-syn keyword cType TriaVertexElementResult
-syn keyword cType PentaVertexElementResult
+syn keyword cType TriaP1ElementResult
+syn keyword cType PentaP1ElementResult
 syn keyword cType BoolElementResult
 syn keyword cType ExternalResult
 syn keyword cType BoolExternalResult
@@ -561,6 +563,7 @@
 syn keyword cConstant ConstantsYtsEnum
 syn keyword cConstant DiagnosticAbstolEnum
 syn keyword cConstant DiagnosticIcefrontEnum
+syn keyword cConstant DiagnosticIsnewtonEnum
 syn keyword cConstant DiagnosticMaxiterEnum
 syn keyword cConstant DiagnosticNumRequestedOutputsEnum
 syn keyword cConstant DiagnosticPenaltyFactorEnum
@@ -604,6 +607,7 @@
 syn keyword cConstant InversionGradientOnlyEnum
 syn keyword cConstant InversionGradientScalingEnum
 syn keyword cConstant InversionIscontrolEnum
+syn keyword cConstant InversionTaoEnum
 syn keyword cConstant InversionMaxParametersEnum
 syn keyword cConstant InversionMaxiterPerStepEnum
 syn keyword cConstant InversionMinParametersEnum
@@ -659,6 +663,7 @@
 syn keyword cConstant MeshZEnum
 syn keyword cConstant MiscellaneousNameEnum
 syn keyword cConstant PrognosticHydrostaticAdjustmentEnum
+syn keyword cConstant PrognosticMinThicknessEnum
 syn keyword cConstant PrognosticPenaltyFactorEnum
 syn keyword cConstant PrognosticSpcthicknessEnum
 syn keyword cConstant PrognosticStabilizationEnum
@@ -784,7 +789,7 @@
 syn keyword cConstant PengridEnum
 syn keyword cConstant PenpairEnum
 syn keyword cConstant PentaEnum
-syn keyword cConstant PentaVertexInputEnum
+syn keyword cConstant PentaP1InputEnum
 syn keyword cConstant PetscMatParamEnum
 syn keyword cConstant PetscVecParamEnum
 syn keyword cConstant RiftfrontEnum
@@ -797,7 +802,7 @@
 syn keyword cConstant StringArrayParamEnum
 syn keyword cConstant StringParamEnum
 syn keyword cConstant TriaEnum
-syn keyword cConstant TriaVertexInputEnum
+syn keyword cConstant TriaP1InputEnum
 syn keyword cConstant VertexEnum
 syn keyword cConstant AirEnum
 syn keyword cConstant IceEnum
@@ -884,6 +889,13 @@
 syn keyword cConstant QmuTemperatureEnum
 syn keyword cConstant HydrologyWaterVxEnum
 syn keyword cConstant HydrologyWaterVyEnum
+syn keyword cConstant StressTensorEnum
+syn keyword cConstant StressTensorxxEnum
+syn keyword cConstant StressTensorxyEnum
+syn keyword cConstant StressTensorxzEnum
+syn keyword cConstant StressTensoryyEnum
+syn keyword cConstant StressTensoryzEnum
+syn keyword cConstant StressTensorzzEnum
 syn keyword cConstant IceVolumeEnum
 syn keyword cConstant P0Enum
 syn keyword cConstant P1Enum
@@ -899,11 +911,11 @@
 syn keyword cConstant PatchEnum
 syn keyword cConstant PatchNodesEnum
 syn keyword cConstant PatchVerticesEnum
-syn keyword cConstant PentaVertexElementResultEnum
+syn keyword cConstant PentaP1ElementResultEnum
 syn keyword cConstant PetscVecExternalResultEnum
 syn keyword cConstant StringExternalResultEnum
 syn keyword cConstant TimeEnum
-syn keyword cConstant TriaVertexElementResultEnum
+syn keyword cConstant TriaP1ElementResultEnum
 syn keyword cConstant WaterColumnOldEnum
 syn keyword cConstant MinVelEnum
 syn keyword cConstant MaxVelEnum

Deleted: issm/trunk/externalpackages/win7/notes
===================================================================
--- issm/trunk-jpl/externalpackages/win7/notes	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/win7/notes	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,8 +0,0 @@
-Compiling ISSM using Matlab compatible  compilers. 
-
-At: http://www.mathworks.com/support/compilers/R2011b/win64.html#n2 
-you will find a list of Matlab supported compilers. 
-
-
-
-We'll try the compile with the Microsoft Windows SDK 7.1: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279

Copied: issm/trunk/externalpackages/win7/notes (from rev 11526, issm/trunk-jpl/externalpackages/win7/notes)
===================================================================
--- issm/trunk/externalpackages/win7/notes	                        (rev 0)
+++ issm/trunk/externalpackages/win7/notes	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,8 @@
+Compiling ISSM using Matlab compatible  compilers. 
+
+At: http://www.mathworks.com/support/compilers/R2011b/win64.html#n2 
+you will find a list of Matlab supported compilers. 
+
+
+
+We'll try the compile with the Microsoft Windows SDK 7.1: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8279

Deleted: issm/trunk/externalpackages/win7/sdk7.1.32bits.sh
===================================================================
--- issm/trunk-jpl/externalpackages/win7/sdk7.1.32bits.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/win7/sdk7.1.32bits.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,73 +0,0 @@
-declare -x ALLUSERSPROFILE="C:\\ProgramData"
-declare -x APPDATA="C:\\Users\\larour\\AppData\\Roaming"
-declare -x APPVER="6.1"
-declare -x CL="/AI C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319"
-declare -x COMMONPROGRAMFILES="C:\\Program Files (x86)\\Common Files"
-declare -x COMPUTERNAME="WIN-IH1FCG0JVB1"
-declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
-declare -x CURRENT_CPU="x64"
-declare -x CommandPromptType="Cross"
-declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
-declare -x Configuration="Debug"
-declare -x FP_NO_HOST_CHECK="NO"
-declare -x FrameworkVersion="v4.0.30319"
-declare -x GREP_COLOR="00;38;5;226"
-declare -x GREP_OPTIONS="--binary-file=without-match"
-declare -x HOME="/home/larour"
-declare -x HOMEDRIVE="C:"
-declare -x HOMEPATH="\\Users\\larour"
-declare -x HOSTNAME="WIN-IH1FCG0JVB1"
-declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE\\gl;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\INCLUDE;"
-declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:"
-declare -x LANG="en_US.UTF-8"
-declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;"
-declare -x LIBPATH="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib;"
-declare -x LOCALAPPDATA="C:\\Users\\larour\\AppData\\Local"
-declare -x LOGONSERVER="\\\\WIN-IH1FCG0JVB1"
-declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
-declare -x NUMBER_OF_PROCESSORS="8"
-declare -x OS="Windows_NT"
-declare -x PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/VCPackages:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/NETFX 4.0 Tools:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit:/cygdrive/c/MATLAB/R2011b32/runtime/win32:/cygdrive/c/MATLAB/R2011b32/bin:/cygdrive/c/MATLAB/R2011b/runtime/win64:/cygdrive/c/MATLAB/R2011b/bin:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/cygdrive/c/Program Files/Microsoft Network Monitor 3"
-declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
-declare -x PRINTER="137.78.140.129#:1"
-declare -x PROCESSOR_ARCHITECTURE="x86"
-declare -x PROCESSOR_ARCHITEW6432="AMD64"
-declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
-declare -x PROCESSOR_LEVEL="6"
-declare -x PROCESSOR_REVISION="2a07"
-declare -x PROGRAMFILES="C:\\Program Files (x86)"
-declare -x PROMPT="\$P\$G"
-declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ "
-declare -x PSModulePath="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\"
-declare -x PUBLIC="C:\\Users\\Public"
-declare -x PWD="/cygdrive/c/issm-uci/trunk-jpl-32/externalpackages/win7"
-declare -x PlatformToolset="Windows7.1SDK"
-declare -x ProgramData="C:\\ProgramData"
-declare -x ProgramW6432="C:\\Program Files"
-declare -x REPO="jpl"
-declare -x SESSIONNAME="Console"
-declare -x SHELL="/bin/bash"
-declare -x SHLVL="1"
-declare -x SVN_EDITOR="/usr/bin/vim"
-declare -x SYSTEMDRIVE="C:"
-declare -x SYSTEMROOT="C:\\Windows"
-declare -x TARGET_CPU="x86"
-declare -x TARGET_PLATFORM="WIN7"
-declare -x TEMP="/tmp"
-declare -x TERM="cygwin"
-declare -x TMP="/tmp"
-declare -x TZ="America/Los_Angeles"
-declare -x ToolsVersion="4.0"
-declare -x USER="larour"
-declare -x USERDOMAIN="WIN-IH1FCG0JVB1"
-declare -x USERNAME="larour"
-declare -x USERPROFILE="C:\\Users\\larour"
-declare -x VS100COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\"
-declare -x WINDIR="C:\\Windows"
-declare -x WindowsSDKDir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
-declare -x WindowsSDKVersionOverride="v7.1"
-declare -x sdkdir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
-declare -x temp="C:\\Users\\larour\\AppData\\Local\\Temp"
-declare -x tmp="C:\\Users\\larour\\AppData\\Local\\Temp"
-declare -x windows_tracing_flags="3"
-declare -x windows_tracing_logfile="C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"

Copied: issm/trunk/externalpackages/win7/sdk7.1.32bits.sh (from rev 11526, issm/trunk-jpl/externalpackages/win7/sdk7.1.32bits.sh)
===================================================================
--- issm/trunk/externalpackages/win7/sdk7.1.32bits.sh	                        (rev 0)
+++ issm/trunk/externalpackages/win7/sdk7.1.32bits.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,73 @@
+declare -x ALLUSERSPROFILE="C:\\ProgramData"
+declare -x APPDATA="C:\\Users\\larour\\AppData\\Roaming"
+declare -x APPVER="6.1"
+declare -x CL="/AI C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319"
+declare -x COMMONPROGRAMFILES="C:\\Program Files (x86)\\Common Files"
+declare -x COMPUTERNAME="WIN-IH1FCG0JVB1"
+declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
+declare -x CURRENT_CPU="x64"
+declare -x CommandPromptType="Cross"
+declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
+declare -x Configuration="Debug"
+declare -x FP_NO_HOST_CHECK="NO"
+declare -x FrameworkVersion="v4.0.30319"
+declare -x GREP_COLOR="00;38;5;226"
+declare -x GREP_OPTIONS="--binary-file=without-match"
+declare -x HOME="/home/larour"
+declare -x HOMEDRIVE="C:"
+declare -x HOMEPATH="\\Users\\larour"
+declare -x HOSTNAME="WIN-IH1FCG0JVB1"
+declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE\\gl;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\INCLUDE;"
+declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:"
+declare -x LANG="en_US.UTF-8"
+declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\ATLMFC\\LIB;"
+declare -x LIBPATH="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib;"
+declare -x LOCALAPPDATA="C:\\Users\\larour\\AppData\\Local"
+declare -x LOGONSERVER="\\\\WIN-IH1FCG0JVB1"
+declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
+declare -x NUMBER_OF_PROCESSORS="8"
+declare -x OS="Windows_NT"
+declare -x PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/VCPackages:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/NETFX 4.0 Tools:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit:/cygdrive/c/MATLAB/R2011b32/runtime/win32:/cygdrive/c/MATLAB/R2011b32/bin:/cygdrive/c/MATLAB/R2011b/runtime/win64:/cygdrive/c/MATLAB/R2011b/bin:/cygdrive/c/Program Files (x86)/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/Tools/Binn:/cygdrive/c/Program Files/Microsoft SQL Server/100/DTS/Binn:/cygdrive/c/Program Files/Microsoft Network Monitor 3"
+declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
+declare -x PRINTER="137.78.140.129#:1"
+declare -x PROCESSOR_ARCHITECTURE="x86"
+declare -x PROCESSOR_ARCHITEW6432="AMD64"
+declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
+declare -x PROCESSOR_LEVEL="6"
+declare -x PROCESSOR_REVISION="2a07"
+declare -x PROGRAMFILES="C:\\Program Files (x86)"
+declare -x PROMPT="\$P\$G"
+declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ "
+declare -x PSModulePath="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\"
+declare -x PUBLIC="C:\\Users\\Public"
+declare -x PWD="/cygdrive/c/issm-uci/trunk-jpl-32/externalpackages/win7"
+declare -x PlatformToolset="Windows7.1SDK"
+declare -x ProgramData="C:\\ProgramData"
+declare -x ProgramW6432="C:\\Program Files"
+declare -x REPO="jpl"
+declare -x SESSIONNAME="Console"
+declare -x SHELL="/bin/bash"
+declare -x SHLVL="1"
+declare -x SVN_EDITOR="/usr/bin/vim"
+declare -x SYSTEMDRIVE="C:"
+declare -x SYSTEMROOT="C:\\Windows"
+declare -x TARGET_CPU="x86"
+declare -x TARGET_PLATFORM="WIN7"
+declare -x TEMP="/tmp"
+declare -x TERM="cygwin"
+declare -x TMP="/tmp"
+declare -x TZ="America/Los_Angeles"
+declare -x ToolsVersion="4.0"
+declare -x USER="larour"
+declare -x USERDOMAIN="WIN-IH1FCG0JVB1"
+declare -x USERNAME="larour"
+declare -x USERPROFILE="C:\\Users\\larour"
+declare -x VS100COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\"
+declare -x WINDIR="C:\\Windows"
+declare -x WindowsSDKDir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
+declare -x WindowsSDKVersionOverride="v7.1"
+declare -x sdkdir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
+declare -x temp="C:\\Users\\larour\\AppData\\Local\\Temp"
+declare -x tmp="C:\\Users\\larour\\AppData\\Local\\Temp"
+declare -x windows_tracing_flags="3"
+declare -x windows_tracing_logfile="C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"

Deleted: issm/trunk/externalpackages/win7/sdk7.1.64bits.sh
===================================================================
--- issm/trunk-jpl/externalpackages/win7/sdk7.1.64bits.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/win7/sdk7.1.64bits.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,69 +0,0 @@
-declare -x ALLUSERSPROFILE="C:\\ProgramData"
-declare -x APPDATA="C:\\Users\\larour\\AppData\\Roaming"
-declare -x APPVER="6.1"
-declare -x CL="/AI C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319"
-declare -x COMMONPROGRAMFILES="C:\\Program Files (x86)\\Common Files"
-declare -x COMPUTERNAME="WIN-IH1FCG0JVB1"
-declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
-declare -x CURRENT_CPU="x64"
-declare -x CommandPromptType="Native"
-declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
-declare -x Configuration="Debug"
-declare -x FP_NO_HOST_CHECK="NO"
-declare -x FrameworkVersion="v4.0.30319"
-declare -x GREP_COLOR="00;38;5;226"
-declare -x GREP_OPTIONS="--binary-file=without-match"
-declare -x HOME="/home/larour"
-declare -x HOMEDRIVE="C:"
-declare -x HOMEPATH="\\Users\\larour"
-declare -x HOSTNAME="WIN-IH1FCG0JVB1"
-declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE\\gl;"
-declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:"
-declare -x LANG="C.UTF-8"
-declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib\\amd64;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\X64;"
-declare -x LIBPATH="C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework64\\v3.5;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib\\amd64;"
-declare -x LOCALAPPDATA="C:\\Users\\larour\\AppData\\Local"
-declare -x LOGONSERVER="\\\\WIN-IH1FCG0JVB1"
-declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
-declare -x NUMBER_OF_PROCESSORS="1"
-declare -x OLDPWD="/cygdrive/c/issm-uci/trunk-jpl/externalpackages"
-declare -x OS="Windows_NT"
-declare -x PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework64/v3.5:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/amd64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/VCPackages:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/NETFX 4.0 Tools/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit:/cygdrive/c/MATLAB/R2011b/runtime/win64:/cygdrive/c/MATLAB/R2011b/bin"
-declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
-declare -x PRINTER="137.78.140.129#:1"
-declare -x PROCESSOR_ARCHITECTURE="x86"
-declare -x PROCESSOR_ARCHITEW6432="AMD64"
-declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
-declare -x PROCESSOR_LEVEL="6"
-declare -x PROCESSOR_REVISION="2a07"
-declare -x PROGRAMFILES="C:\\Program Files (x86)"
-declare -x PROMPT="\$P\$G"
-declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ "
-declare -x PSModulePath="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\"
-declare -x PUBLIC="C:\\Users\\Public"
-declare -x PWD="/cygdrive/c/issm-uci/trunk-jpl/externalpackages/win7"
-declare -x PlatformToolset="Windows7.1SDK"
-declare -x ProgramData="C:\\ProgramData"
-declare -x ProgramW6432="C:\\Program Files"
-declare -x REPO="jpl"
-declare -x SESSIONNAME="Console"
-declare -x SHLVL="1"
-declare -x SYSTEMDRIVE="C:"
-declare -x SYSTEMROOT="C:\\Windows"
-declare -x TARGET_CPU="x64"
-declare -x TARGET_PLATFORM="WIN7"
-declare -x TEMP="/tmp"
-declare -x TERM="cygwin"
-declare -x TMP="/tmp"
-declare -x ToolsVersion="4.0"
-declare -x USER="larour"
-declare -x USERDOMAIN="WIN-IH1FCG0JVB1"
-declare -x USERNAME="larour"
-declare -x USERPROFILE="C:\\Users\\larour"
-declare -x VS100COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\"
-declare -x WINDIR="C:\\Windows"
-declare -x WindowsSDKDir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
-declare -x WindowsSDKVersionOverride="v7.1"
-declare -x sdkdir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
-declare -x windows_tracing_flags="3"
-declare -x windows_tracing_logfile="C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"

Copied: issm/trunk/externalpackages/win7/sdk7.1.64bits.sh (from rev 11526, issm/trunk-jpl/externalpackages/win7/sdk7.1.64bits.sh)
===================================================================
--- issm/trunk/externalpackages/win7/sdk7.1.64bits.sh	                        (rev 0)
+++ issm/trunk/externalpackages/win7/sdk7.1.64bits.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,69 @@
+declare -x ALLUSERSPROFILE="C:\\ProgramData"
+declare -x APPDATA="C:\\Users\\larour\\AppData\\Roaming"
+declare -x APPVER="6.1"
+declare -x CL="/AI C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319"
+declare -x COMMONPROGRAMFILES="C:\\Program Files (x86)\\Common Files"
+declare -x COMPUTERNAME="WIN-IH1FCG0JVB1"
+declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
+declare -x CURRENT_CPU="x64"
+declare -x CommandPromptType="Native"
+declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
+declare -x Configuration="Debug"
+declare -x FP_NO_HOST_CHECK="NO"
+declare -x FrameworkVersion="v4.0.30319"
+declare -x GREP_COLOR="00;38;5;226"
+declare -x GREP_OPTIONS="--binary-file=without-match"
+declare -x HOME="/home/larour"
+declare -x HOMEDRIVE="C:"
+declare -x HOMEPATH="\\Users\\larour"
+declare -x HOSTNAME="WIN-IH1FCG0JVB1"
+declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\INCLUDE\\gl;"
+declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:"
+declare -x LANG="C.UTF-8"
+declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib\\amd64;C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\X64;"
+declare -x LIBPATH="C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework64\\v3.5;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\Lib\\amd64;"
+declare -x LOCALAPPDATA="C:\\Users\\larour\\AppData\\Local"
+declare -x LOGONSERVER="\\\\WIN-IH1FCG0JVB1"
+declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
+declare -x NUMBER_OF_PROCESSORS="1"
+declare -x OLDPWD="/cygdrive/c/issm-uci/trunk-jpl/externalpackages"
+declare -x OS="Windows_NT"
+declare -x PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework64/v3.5:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/amd64:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/Bin/VCPackages:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/NETFX 4.0 Tools/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin/x64:/cygdrive/c/Program Files/Microsoft SDKs/Windows/v7.1/Bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit:/cygdrive/c/MATLAB/R2011b/runtime/win64:/cygdrive/c/MATLAB/R2011b/bin"
+declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
+declare -x PRINTER="137.78.140.129#:1"
+declare -x PROCESSOR_ARCHITECTURE="x86"
+declare -x PROCESSOR_ARCHITEW6432="AMD64"
+declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
+declare -x PROCESSOR_LEVEL="6"
+declare -x PROCESSOR_REVISION="2a07"
+declare -x PROGRAMFILES="C:\\Program Files (x86)"
+declare -x PROMPT="\$P\$G"
+declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ "
+declare -x PSModulePath="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\"
+declare -x PUBLIC="C:\\Users\\Public"
+declare -x PWD="/cygdrive/c/issm-uci/trunk-jpl/externalpackages/win7"
+declare -x PlatformToolset="Windows7.1SDK"
+declare -x ProgramData="C:\\ProgramData"
+declare -x ProgramW6432="C:\\Program Files"
+declare -x REPO="jpl"
+declare -x SESSIONNAME="Console"
+declare -x SHLVL="1"
+declare -x SYSTEMDRIVE="C:"
+declare -x SYSTEMROOT="C:\\Windows"
+declare -x TARGET_CPU="x64"
+declare -x TARGET_PLATFORM="WIN7"
+declare -x TEMP="/tmp"
+declare -x TERM="cygwin"
+declare -x TMP="/tmp"
+declare -x ToolsVersion="4.0"
+declare -x USER="larour"
+declare -x USERDOMAIN="WIN-IH1FCG0JVB1"
+declare -x USERNAME="larour"
+declare -x USERPROFILE="C:\\Users\\larour"
+declare -x VS100COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\"
+declare -x WINDIR="C:\\Windows"
+declare -x WindowsSDKDir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
+declare -x WindowsSDKVersionOverride="v7.1"
+declare -x sdkdir="C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\"
+declare -x windows_tracing_flags="3"
+declare -x windows_tracing_logfile="C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"

Deleted: issm/trunk/externalpackages/win7/vs10.0.sh
===================================================================
--- issm/trunk-jpl/externalpackages/win7/vs10.0.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/externalpackages/win7/vs10.0.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,64 +0,0 @@
-declare -x ALLUSERSPROFILE="C:\\ProgramData"
-declare -x APPDATA="C:\\Users\\larour\\AppData\\Roaming"
-declare -x COMMONPROGRAMFILES="C:\\Program Files (x86)\\Common Files"
-declare -x COMPUTERNAME="WIN-IH1FCG0JVB1"
-declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
-declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
-declare -x DevEnvDir="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\"
-declare -x FP_NO_HOST_CHECK="NO"
-declare -x Framework35Version="v3.5"
-declare -x FrameworkDIR32="C:\\Windows\\Microsoft.NET\\Framework\\"
-declare -x FrameworkDir="C:\\Windows\\Microsoft.NET\\Framework\\"
-declare -x FrameworkVersion="v4.0.30319"
-declare -x FrameworkVersion32="v4.0.30319"
-declare -x GREP_COLOR="00;38;5;226"
-declare -x GREP_OPTIONS="--binary-file=without-match"
-declare -x HOME="/home/larour"
-declare -x HOMEDRIVE="C:"
-declare -x HOMEPATH="\\Users\\larour"
-declare -x HOSTNAME="WIN-IH1FCG0JVB1"
-declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;"
-declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:"
-declare -x LANG="C.UTF-8"
-declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\lib;"
-declare -x LIBPATH="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;"
-declare -x LOCALAPPDATA="C:\\Users\\larour\\AppData\\Local"
-declare -x LOGONSERVER="\\\\WIN-IH1FCG0JVB1"
-declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
-declare -x NUMBER_OF_PROCESSORS="1"
-declare -x OLDPWD="/cygdrive/c/issm-uci/trunk-jpl"
-declare -x OS="Windows_NT"
-declare -x PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/BIN:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools:/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit"
-declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
-declare -x PRINTER="137.78.140.129#:1"
-declare -x PROCESSOR_ARCHITECTURE="x86"
-declare -x PROCESSOR_ARCHITEW6432="AMD64"
-declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
-declare -x PROCESSOR_LEVEL="6"
-declare -x PROCESSOR_REVISION="2a07"
-declare -x PROGRAMFILES="C:\\Program Files (x86)"
-declare -x PROMPT="\$P\$G"
-declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ "
-declare -x PSModulePath="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\"
-declare -x PUBLIC="C:\\Users\\Public"
-declare -x ProgramData="C:\\ProgramData"
-declare -x ProgramW6432="C:\\Program Files"
-declare -x REPO="jpl"
-declare -x SESSIONNAME="Console"
-declare -x SHLVL="1"
-declare -x SYSTEMDRIVE="C:"
-declare -x SYSTEMROOT="C:\\Windows"
-declare -x TEMP="/tmp"
-declare -x TERM="cygwin"
-declare -x TMP="/tmp"
-declare -x USER="larour"
-declare -x USERDOMAIN="WIN-IH1FCG0JVB1"
-declare -x USERNAME="larour"
-declare -x USERPROFILE="C:\\Users\\larour"
-declare -x VCINSTALLDIR="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\"
-declare -x VS100COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\"
-declare -x VSINSTALLDIR="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\"
-declare -x WINDIR="C:\\Windows"
-declare -x WindowsSdkDir="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\"
-declare -x windows_tracing_flags="3"
-declare -x windows_tracing_logfile="C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"

Copied: issm/trunk/externalpackages/win7/vs10.0.sh (from rev 11526, issm/trunk-jpl/externalpackages/win7/vs10.0.sh)
===================================================================
--- issm/trunk/externalpackages/win7/vs10.0.sh	                        (rev 0)
+++ issm/trunk/externalpackages/win7/vs10.0.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,64 @@
+declare -x ALLUSERSPROFILE="C:\\ProgramData"
+declare -x APPDATA="C:\\Users\\larour\\AppData\\Roaming"
+declare -x COMMONPROGRAMFILES="C:\\Program Files (x86)\\Common Files"
+declare -x COMPUTERNAME="WIN-IH1FCG0JVB1"
+declare -x COMSPEC="C:\\Windows\\system32\\cmd.exe"
+declare -x CommonProgramW6432="C:\\Program Files\\Common Files"
+declare -x DevEnvDir="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\"
+declare -x FP_NO_HOST_CHECK="NO"
+declare -x Framework35Version="v3.5"
+declare -x FrameworkDIR32="C:\\Windows\\Microsoft.NET\\Framework\\"
+declare -x FrameworkDir="C:\\Windows\\Microsoft.NET\\Framework\\"
+declare -x FrameworkVersion="v4.0.30319"
+declare -x FrameworkVersion32="v4.0.30319"
+declare -x GREP_COLOR="00;38;5;226"
+declare -x GREP_OPTIONS="--binary-file=without-match"
+declare -x HOME="/home/larour"
+declare -x HOMEDRIVE="C:"
+declare -x HOMEPATH="\\Users\\larour"
+declare -x HOSTNAME="WIN-IH1FCG0JVB1"
+declare -x INCLUDE="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include;"
+declare -x INFOPATH="/usr/local/info:/usr/share/info:/usr/info:"
+declare -x LANG="C.UTF-8"
+declare -x LIB="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\lib;"
+declare -x LIBPATH="C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319;C:\\Windows\\Microsoft.NET\\Framework\\v3.5;C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\LIB;"
+declare -x LOCALAPPDATA="C:\\Users\\larour\\AppData\\Local"
+declare -x LOGONSERVER="\\\\WIN-IH1FCG0JVB1"
+declare -x MANPATH="/usr/local/man:/usr/share/man:/usr/man:"
+declare -x NUMBER_OF_PROCESSORS="1"
+declare -x OLDPWD="/cygdrive/c/issm-uci/trunk-jpl"
+declare -x OS="Windows_NT"
+declare -x PATH="/usr/local/bin:/usr/bin:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/BIN:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/Tools:/cygdrive/c/Windows/Microsoft.NET/Framework/v4.0.30319:/cygdrive/c/Windows/Microsoft.NET/Framework/v3.5:/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/VCPackages:/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin/NETFX 4.0 Tools:/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/bin:/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/Wbem:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0:/cygdrive/c/Program Files/Microsoft Windows Performance Toolkit"
+declare -x PATHEXT=".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
+declare -x PRINTER="137.78.140.129#:1"
+declare -x PROCESSOR_ARCHITECTURE="x86"
+declare -x PROCESSOR_ARCHITEW6432="AMD64"
+declare -x PROCESSOR_IDENTIFIER="Intel64 Family 6 Model 42 Stepping 7, GenuineIntel"
+declare -x PROCESSOR_LEVEL="6"
+declare -x PROCESSOR_REVISION="2a07"
+declare -x PROGRAMFILES="C:\\Program Files (x86)"
+declare -x PROMPT="\$P\$G"
+declare -x PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ "
+declare -x PSModulePath="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules\\"
+declare -x PUBLIC="C:\\Users\\Public"
+declare -x ProgramData="C:\\ProgramData"
+declare -x ProgramW6432="C:\\Program Files"
+declare -x REPO="jpl"
+declare -x SESSIONNAME="Console"
+declare -x SHLVL="1"
+declare -x SYSTEMDRIVE="C:"
+declare -x SYSTEMROOT="C:\\Windows"
+declare -x TEMP="/tmp"
+declare -x TERM="cygwin"
+declare -x TMP="/tmp"
+declare -x USER="larour"
+declare -x USERDOMAIN="WIN-IH1FCG0JVB1"
+declare -x USERNAME="larour"
+declare -x USERPROFILE="C:\\Users\\larour"
+declare -x VCINSTALLDIR="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\"
+declare -x VS100COMNTOOLS="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\Tools\\"
+declare -x VSINSTALLDIR="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\"
+declare -x WINDIR="C:\\Windows"
+declare -x WindowsSdkDir="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\"
+declare -x windows_tracing_flags="3"
+declare -x windows_tracing_logfile="C:\\BVTBin\\Tests\\installpackage\\csilogfile.log"

Deleted: issm/trunk/externalpackages/win7/winsdk_web.exe
===================================================================
(Binary files differ)

Copied: issm/trunk/externalpackages/win7/winsdk_web.exe (from rev 11526, issm/trunk-jpl/externalpackages/win7/winsdk_web.exe)
===================================================================
(Binary files differ)

Deleted: issm/trunk/installers/macosx/ISSM.pmdoc/index.xml
===================================================================
--- issm/trunk-jpl/installers/macosx/ISSM.pmdoc/index.xml	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/installers/macosx/ISSM.pmdoc/index.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1 +0,0 @@
-<pkmkdoc spec="1.12"><properties><organization>http://issm.jpl.nasa.gov</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents/><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/></pkmkdoc>
\ No newline at end of file

Copied: issm/trunk/installers/macosx/ISSM.pmdoc/index.xml (from rev 11526, issm/trunk-jpl/installers/macosx/ISSM.pmdoc/index.xml)
===================================================================
--- issm/trunk/installers/macosx/ISSM.pmdoc/index.xml	                        (rev 0)
+++ issm/trunk/installers/macosx/ISSM.pmdoc/index.xml	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+<pkmkdoc spec="1.12"><properties><organization>http://issm.jpl.nasa.gov</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents/><resources bg-scale="none" bg-align="topleft"><locale lang="en"/></resources><flags/></pkmkdoc>
\ No newline at end of file

Deleted: issm/trunk/installers/win7/ISSM.initial.aip
===================================================================
(Binary files differ)

Copied: issm/trunk/installers/win7/ISSM.initial.aip (from rev 11526, issm/trunk-jpl/installers/win7/ISSM.initial.aip)
===================================================================
(Binary files differ)

Deleted: issm/trunk/installers/win7/ISSMlogo.ico
===================================================================
(Binary files differ)

Copied: issm/trunk/installers/win7/ISSMlogo.ico (from rev 11526, issm/trunk-jpl/installers/win7/ISSMlogo.ico)
===================================================================
(Binary files differ)

Deleted: issm/trunk/installers/win7/aic.sh
===================================================================
--- issm/trunk-jpl/installers/win7/aic.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/installers/win7/aic.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-#get brand new project: 
-rm -rf ISSM.aip  ISSM-SetupFiles ISSM.msi
-cp ISSM.initial.aip ISSM.aip
-
-#build list of files to put into the installer: 
-rm -rf ISSM.aic 
-cat << END > ISSM.aic
-;aic
-SetVersion "1.0"
-SetPackageName "ISSM.msi"
-END
-
-ls $ISSM_TIER_WIN/scripts/*.bat $ISSM_TIER_WIN/bin/startup.m $ISSM_TIER_WIN/bin/*.h | awk '{printf("AddFile APPDIR %s\n",$1);}' | sed 's/\//\\/g' >> ISSM.aic
-
-cat << END >> ISSM.aic
-AddFolder PersonalFolder $ISSM_TIER_WIN\test
-AddFolder APPDIR $ISSM_TIER_WIN\bin
-DelEnvironment ISSM_TESTS
-NewEnvironment -name ISSM_TESTS -value [test_Dir]
-DelEnvironment ISSM_TIER
-NewEnvironment -name ISSM_TIER -value [APPDIR]
-DelEnvironment ISSM_TIER_WIN
-NewEnvironment -name ISSM_TIER_WIN -value [APPDIR]
-Save
-Rebuild
-END
-
-#Run installer: 
-"C:/Program Files (x86)/Caphyon/Advanced Installer 8.9/bin/x86/AdvancedInstaller.com" /execute  ./ISSM.aip ./ISSM.aic
-
-#Get rid of temporary files: 
-cp ISSM-SetupFiles/ISSM.msi ./
-rm -rf ISSM.aip ISSM-SetupFiles ISSM.aic

Copied: issm/trunk/installers/win7/aic.sh (from rev 11526, issm/trunk-jpl/installers/win7/aic.sh)
===================================================================
--- issm/trunk/installers/win7/aic.sh	                        (rev 0)
+++ issm/trunk/installers/win7/aic.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+#get brand new project: 
+rm -rf ISSM.aip  ISSM-SetupFiles ISSM.msi
+cp ISSM.initial.aip ISSM.aip
+
+#build list of files to put into the installer: 
+rm -rf ISSM.aic 
+cat << END > ISSM.aic
+;aic
+SetVersion "1.0"
+SetPackageName "ISSM.msi"
+END
+
+ls $ISSM_TIER_WIN/scripts/*.bat $ISSM_TIER_WIN/bin/startup.m $ISSM_TIER_WIN/bin/*.h | awk '{printf("AddFile APPDIR %s\n",$1);}' | sed 's/\//\\/g' >> ISSM.aic
+
+cat << END >> ISSM.aic
+AddFolder PersonalFolder $ISSM_TIER_WIN\test
+AddFolder APPDIR $ISSM_TIER_WIN\bin
+DelEnvironment ISSM_TESTS
+NewEnvironment -name ISSM_TESTS -value [test_Dir]
+DelEnvironment ISSM_TIER
+NewEnvironment -name ISSM_TIER -value [APPDIR]
+DelEnvironment ISSM_TIER_WIN
+NewEnvironment -name ISSM_TIER_WIN -value [APPDIR]
+Save
+Rebuild
+END
+
+#Run installer: 
+"C:/Program Files (x86)/Caphyon/Advanced Installer 8.9/bin/x86/AdvancedInstaller.com" /execute  ./ISSM.aip ./ISSM.aic
+
+#Get rid of temporary files: 
+cp ISSM-SetupFiles/ISSM.msi ./
+rm -rf ISSM.aip ISSM-SetupFiles ISSM.aic

Copied: issm/trunk/m4/ar-lib.m4 (from rev 11526, issm/trunk-jpl/m4/ar-lib.m4)
===================================================================
--- issm/trunk/m4/ar-lib.m4	                        (rev 0)
+++ issm/trunk/m4/ar-lib.m4	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,61 @@
+##                                                          -*- Autoconf -*-
+# Copyright (C) 2011 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
+])

Modified: issm/trunk/m4/issm_options.m4
===================================================================
--- issm/trunk/m4/issm_options.m4	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/m4/issm_options.m4	2012-02-24 16:12:47 UTC (rev 11527)
@@ -28,6 +28,8 @@
 	AC_MSG_CHECKING(for parallel compilation)
 	AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
 	AC_MSG_RESULT($PARALLEL_VALUE) 
+	ISSMEXT=".exe"
+	AC_SUBST([ISSMEXT])
 	dnl }}}
 	dnl Serial or Parallel check {{{1
 	dnl Check that at least serial or parallel builds have been requested!
@@ -39,6 +41,50 @@
 	dnl }}}
 
 	dnl ISSM's externalpackages
+	dnl vendor{{{1
+	AC_ARG_WITH([vendor],
+			  AS_HELP_STRING([--with-vendor = VENDOR], [vendor name, ex: intel]), [VENDOR=$withval],[VENDOR=""]) 
+	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_"
+		elif  test $VENDOR = intel-win7-32; then
+			export CC=cccl
+			export CXX=cccl
+			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
+			export CFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
+			export AR=lib
+			export RANLIB=true
+			OSLIBS="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib"
+		elif  test $VENDOR = intel-win7-64; then
+			export CC=cccl
+			export CXX=cccl
+			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
+			export CFLAGS="-DWIN32 -D_INTEL_WIN_ -EHsc"
+			export AR=lib
+			export RANLIB=true
+			OSLIBS="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 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-pleiades; then
+			export CC=icc
+			export CXX=icpc
+			export CXXFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
+			export CFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
+		else
+		AC_MSG_ERROR([unknow compiler vendor!])
+		fi
+	fi
+	AC_SUBST([OSLIBS]) 
+	AC_MSG_RESULT(done)
+	dnl }}}
 	dnl Matlab {{{1
 	AC_ARG_WITH([matlab-dir],
 			  AS_HELP_STRING([--with-matlab-dir = DIR],
@@ -75,22 +121,26 @@
 				dnl mex -v gives all the flags for compilation of mex files
 				dnl if matlab version is 7.10 or more, we must use mexmaci64 (64 bits)
 				MEXLINK="-O -Wl,-flat_namespace -undefined suppress -arch i386 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
+				MEXLIB=" -L$MATLAB_ROOT/bin/maci/ -lmx -lmex -lmat -lstdc++ -largeArrayDims"
 				if test $MATLAB_MAJOR -ge 7; then 
 					 if test $MATLAB_MINOR -ge 10; then 
 						  MEXLINK="-O -Wl,-flat_namespace -undefined suppress -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci64/mexFunction.map"
+							 MEXLIB=" -L$MATLAB_ROOT/bin/maci64/ -lmx -lmex -lmat -lstdc++"
 					 fi
 				fi
 
-				MEXLIB=" mexversion.o -L$MATLAB_ROOT/bin/maci/ -lmx -lmex -lmat -lstdc++ -largeArrayDims"
 				MEXEXT=`$MATLAB_ROOT/bin/mexext`
 				MEXEXT=".$MEXEXT"
 
 				dnl Old MEXLINK
 				dnl MEXLINK="-Wl,-twolevel_namespace -undefined error -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
 			;;
-			*cygwin*)
-				MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO"
-
+			*cygwin*) 
+				if  test $VENDOR = intel-win7-32; then
+					MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO -manifest" 
+				elif  test $VENDOR = intel-win7-64; then
+					MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win64\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO -manifest" 
+				fi
 				MEXEXT=`$MATLAB_ROOT/bin/mexext.bat`
 				MEXEXT=".$MEXEXT"
 			;;
@@ -129,6 +179,10 @@
 							largearrays=yes 
 						fi
 					;;
+					*cygwin*)
+						largearrays=yes 
+					;;
+
 					*darwin*)
 						if test $MATLAB_MAJOR -ge 7; then 
 							if test $MATLAB_MINOR -ge 10; then
@@ -154,8 +208,19 @@
 		dnl defaults
 		HAVE_TRIANGLE=yes
 		TRIANGLEINCL=-I$TRIANGLE_ROOT/
-		TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
 
+		case "${host_os}" in
+				*cygwin*)
+				TRIANGLELIB=$TRIANGLE_ROOT/triangle.lib
+				;;
+				*linux*)
+				TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+				;;
+				*darwin*)
+				TRIANGLELIB=$TRIANGLE_ROOT/triangle.a
+				;;
+			esac
+
 		AC_DEFINE([_HAVE_TRIANGLE_],[1],[with Triangle in ISSM src])
 		AC_SUBST([TRIANGLEINCL])
 		AC_SUBST([TRIANGLELIB])
@@ -314,7 +379,8 @@
 		
 					                          
 		if test "$METIS_VERSION" = "4" ; then
-
+   			
+			METISINCL=-I"$METIS_ROOT/Lib" 
 			case "${host_os}" in
 				*cygwin*)
 				METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib"
@@ -327,7 +393,6 @@
 				;;
 			esac
 
-   			METISINCL=-I"$METIS_ROOT/Lib" 
    			AC_DEFINE([_METIS_VERSION_],[4],[ Metis version number])
 		fi
 		if test "$METIS_VERSION" = "5" ; then
@@ -431,13 +496,18 @@
 	
 	AC_MSG_CHECKING(for Petsc headers and libraries in $PETSC_ROOT for architecture $PETSC_ARCH)
 	
+	
 	if test -d "$PETSC_ROOT"; then
 
 		PETSCINCL="-I$PETSC_ROOT/$PETSC_ARCH/include -I$PETSC_ROOT/include/$PETSC_ARCH/ -I$PETSC_ROOT/include -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
 	
 		case "${host_os}" in
 			*cygwin*)
-			PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib  libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetscsnes.lib libpetscts.lib libmpiuni.lib libpetsc.lib"
+			if test "$PETSC_MAJOR" = "2" ; then
+				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib  libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetscsnes.lib libpetscts.lib libmpiuni.lib libpetsc.lib"
+			else
+				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetsc.lib"
+			fi
 			;;
 			*linux*)
 			if test "$PETSC_MAJOR" = "2" ; then
@@ -481,7 +551,7 @@
 		dnl defaults
 		  HAVE_TAO=yes
 		  TAOINCL="-I$TAO_ROOT/ -I$TAO_ROOT/include -I$TAO_ROOT/bmake/ "
-		  TAOLIB="-L$TAO_ROOT/lib -ltao -ltaopetsc -lpetsc"
+		  TAOLIB="-L$TAO_ROOT/lib -ltao -lpetsc"
 
 		  AC_DEFINE([_HAVE_TAO_],[1],[with Tao in ISSM src])
 		  AC_SUBST([TAOINCL])
@@ -500,7 +570,7 @@
 
 		case "${host_os}" in
 			*cygwin*)
-			MPILIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libmpiuni.lib"
+			dnl MPILIB="-link -LIBPATH:\"$PETSC_ROOT/$PETSC_ARCH/lib\" -LIBPATH:\"$PETSC_ROOT/lib\" -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libmpiuni.lib"
 			;;
 			*linux*)
 			MPILIB="-L$PETSC_ROOT/$PETSC_ARCH/lib -L$PETSC_ROOT/lib -L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
@@ -819,30 +889,6 @@
 	fi
 	AC_MSG_RESULT(done)
 	dnl }}}
-	dnl vendor{{{1
-	AC_ARG_WITH([vendor],
-			  AS_HELP_STRING([--with-vendor = VENDOR], [vendor name, ex: intel]), [VENDOR=$withval],[VENDOR=""]) 
-	AC_MSG_CHECKING(for vendor compilers)
-	if test -n "$VENDOR"; then
-
-		if  test $VENDOR = intel-win; then
-			export CC=icl
-			export CXX=icl
-			export CXXFLAGS="-DWIN32 -D_INTEL_WIN_"
-		elif test $VENDOR = intel-linux; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS=" -D_INTEL_LINUX_"
-		elif test $VENDOR = intel-pleiades; then
-			export CC=icc
-			export CXX=icpc
-			export CXXFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
-		else
-		AC_MSG_ERROR([unknow compiler vendor!])
-		fi
-	fi
-	AC_MSG_RESULT(done)
-	dnl }}}
 	dnl with-steadystate{{{1
 	AC_ARG_WITH([steadystate],AS_HELP_STRING([--with-steadystate = YES], [compile with steadystate capabilities (default is yes)]),[STEADYSTATE=$withval],[STEADYSTATE=yes]) 
 	AC_MSG_CHECKING(for steadystate capability compilation)

Modified: issm/trunk/scripts/Update.sh
===================================================================
--- issm/trunk/scripts/Update.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/scripts/Update.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -10,6 +10,7 @@
 	exit 1
 fi
 
+cat $FILE | sed -e "s/md\.name/md.miscellaneous.name/g" > $FILE$$.bak && mv $FILE$$.bak $FILE
 cat $FILE | sed -e "s/md\.spcvx/md.diagnostic.spcvx/g" > $FILE$$.bak && mv $FILE$$.bak $FILE
 cat $FILE | sed -e "s/md\.spcvy/md.diagnostic.spcvy/g" > $FILE$$.bak && mv $FILE$$.bak $FILE
 cat $FILE | sed -e "s/md\.spcvz/md.diagnostic.spcvz/g" > $FILE$$.bak && mv $FILE$$.bak $FILE

Modified: issm/trunk/scripts/cloc2html.py
===================================================================
--- issm/trunk/scripts/cloc2html.py	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/scripts/cloc2html.py	2012-02-24 16:12:47 UTC (rev 11527)
@@ -78,7 +78,7 @@
 	outfile.write(mystr)
 
 #write header
-outfile.write('</table>\n\n')
+outfile.write('</table>\n')
 
 #close all files
 infile.close()

Modified: issm/trunk/scripts/getloc.sh
===================================================================
--- issm/trunk/scripts/getloc.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/scripts/getloc.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,6 +1,6 @@
 #!/bin/bash
 #get number of lines of code
-cloc-1.55.pl $ISSM_TIER/src --exclude-dir=.svn --exclude-ext=exp --exclude-lang=make --out=temp
+cloc-1.55.pl $ISSM_TIER/src $ISSM_TIER/m4 --exclude-dir=.svn --exclude-ext=exp --exclude-lang=make --out=temp
 cat temp
 ./cloc2html.py
 rm temp

Copied: issm/trunk/scripts/intel-compile.sh (from rev 11526, issm/trunk-jpl/scripts/intel-compile.sh)
===================================================================
--- issm/trunk/scripts/intel-compile.sh	                        (rev 0)
+++ issm/trunk/scripts/intel-compile.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,21 @@
+#!/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

Copied: issm/trunk/scripts/matlabissm.bat (from rev 11526, issm/trunk-jpl/scripts/matlabissm.bat)
===================================================================
--- issm/trunk/scripts/matlabissm.bat	                        (rev 0)
+++ issm/trunk/scripts/matlabissm.bat	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,2 @@
+ at echo off
+matlab 

Copied: issm/trunk/scripts/wincron.sh (from rev 11526, issm/trunk-jpl/scripts/wincron.sh)
===================================================================
--- issm/trunk/scripts/wincron.sh	                        (rev 0)
+++ issm/trunk/scripts/wincron.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,5 @@
+#/bin/bash
+#Launch cron as a windows service, using cygrunsrv: 
+
+cygrunsrv --install cron --path /usr/sbin/cron --args -n
+net start cron

Modified: issm/trunk/src/Makefile.am
===================================================================
--- issm/trunk/src/Makefile.am	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,5 +1,5 @@
-EXTRA_DIST = m  perl  pro
-SUBDIRS = c mex
+EXTRA_DIST =  perl  pro
+SUBDIRS = c mex m
 
 if ADIC2
 SUBDIRS += ad

Modified: issm/trunk/src/ad/wrappers.txt
===================================================================
--- issm/trunk/src/ad/wrappers.txt	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/ad/wrappers.txt	2012-02-24 16:12:47 UTC (rev 11527)
@@ -126,6 +126,7 @@
 KSPSetOperators
 KSPSetFromOptions
 KSPGetPC
+KSPSetUp
 KSPSolve
 KSPGetIterationNumber
 PCFactorSetMatSolverPackage
@@ -139,7 +140,6 @@
 MatMultPatch
 PetscOptionsGetString
 PetscOptionsDetermineSolverType
-KSPFree
 VecMergex
 VecToMPISerial
 VecFree


Property changes on: issm/trunk/src/c
___________________________________________________________________
Modified: svn:ignore
   - Makefile
Makefile.in
.ignore.txt
*.o
*.exe
appscan.*
ouncemake*
list
*.ppf_cache
.deps
config
g++results
probe.results
stXXXX*


   + Makefile
Makefile.in
.ignore.txt
*.o
*.obj
*.exe
appscan.*
ouncemake*
list
*.ppf_cache
.deps
config
g++results
probe.results
stXXXX*



Modified: issm/trunk/src/c/Container/DataSet.cpp
===================================================================
--- issm/trunk/src/c/Container/DataSet.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/Container/DataSet.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -223,16 +223,16 @@
 				tria->Demarshall(&marshalled_dataset);
 				dataset->AddObject(tria);}
 				break;
-			case TriaVertexInputEnum:{
-				TriaVertexInput* triavertexinput=NULL;
-				triavertexinput=new TriaVertexInput();
+			case TriaP1InputEnum:{
+				TriaP1Input* triavertexinput=NULL;
+				triavertexinput=new TriaP1Input();
 				triavertexinput->Demarshall(&marshalled_dataset);
 				dataset->AddObject(triavertexinput);}
 				break;
 			#ifdef _HAVE_THREED_
-			case PentaVertexInputEnum:{
-				PentaVertexInput* pentavertexinput=NULL;
-				pentavertexinput=new PentaVertexInput();
+			case PentaP1InputEnum:{
+				PentaP1Input* pentavertexinput=NULL;
+				pentavertexinput=new PentaP1Input();
 				pentavertexinput->Demarshall(&marshalled_dataset);
 				dataset->AddObject(pentavertexinput);}
 				break;
@@ -257,16 +257,16 @@
 				datasetinputinput->Demarshall(&marshalled_dataset);
 				dataset->AddObject(datasetinputinput);}
 				break;
-			case TriaVertexElementResultEnum:{
-				TriaVertexElementResult* triavertexelementresult=NULL;
-				triavertexelementresult=new TriaVertexElementResult();
+			case TriaP1ElementResultEnum:{
+				TriaP1ElementResult* triavertexelementresult=NULL;
+				triavertexelementresult=new TriaP1ElementResult();
 				triavertexelementresult->Demarshall(&marshalled_dataset);
 				dataset->AddObject(triavertexelementresult);}
 				break;
 			 #ifdef _HAVE_THREED_
-			case PentaVertexElementResultEnum:{
-				PentaVertexElementResult* pentavertexelementresult=NULL;
-				pentavertexelementresult=new PentaVertexElementResult();
+			case PentaP1ElementResultEnum:{
+				PentaP1ElementResult* pentavertexelementresult=NULL;
+				pentavertexelementresult=new PentaP1ElementResult();
 				pentavertexelementresult->Demarshall(&marshalled_dataset);
 				dataset->AddObject(pentavertexelementresult);}
 				break;

Modified: issm/trunk/src/c/Container/Nodes.cpp
===================================================================
--- issm/trunk/src/c/Container/Nodes.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/Container/Nodes.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -59,7 +59,6 @@
 	extern int my_rank;
 
 	int  i;
-	
 	int  dofcount=0;
 	int  maxdofspernode=0;
 	int* alldofcount=NULL;
@@ -68,9 +67,9 @@
 	int  numnodes=0;
 
 	/*some check: */
-	if ((setenum!=GsetEnum) && (setenum!=FsetEnum) && (setenum!=SsetEnum))_error_("%s%s%s"," dof distribution for set of enum type ",EnumToStringx(setenum)," not supported yet!");
+	_assert_(setenum==GsetEnum || setenum==FsetEnum || setenum==SsetEnum);
 
-	/*Go through objects, and distribute dofs locally, from 0 to numberofdofs: */
+	/*Go through objects, and distribute dofs locally, from 0 to numberofdofsperobject*/
 	for (i=0;i<this->Size();i++){
 		Node* node=(Node*)this->GetObjectByOffset(i);
 
@@ -80,64 +79,52 @@
 		}
 	}
 
-	/*Ok, now every object 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 object: */
-
+	/* Now every object has distributed dofs, but locally, and with a dof count starting from 
+	 * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of eache
+	 * cpus by the total last dofs of the previus cpu, starting from 0.
+	 * First: bet number of dofs for each cpu*/
 	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. : */
+	/* 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{
+	if(my_rank!=0){
 		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 (i=0;i<this->Size();i++){
-
 		/*Check that this node corresponds to our analysis currently being carried out: */
 		Node* node=(Node*)this->GetObjectByOffset(i);
 		if (node->InAnalysis(analysis_type)){
 			node->OffsetDofs(dofcount,setenum);
 		}
-
 	}
 
-	/*Finally, remember that cpus may have skipped some objects, because they were clones. For every 
+	/* Finally, remember that cpus may have skipped some objects, because they were clones. For every 
 	 * object that is not a clone, tell them to show their dofs, so that later on, they can get picked 
 	 * up by their clones: */
 	maxdofspernode=this->MaxNumDofs(analysis_type,setenum);
 	numnodes=this->NumberOfNodes(analysis_type);
-
-	if (numnodes*maxdofspernode){
-		truedofs=(int*)xcalloc(numnodes*maxdofspernode,sizeof(int)); //initialize to 0, so that we can pick up the max
+	if(numnodes*maxdofspernode){
+		truedofs=   (int*)xcalloc(numnodes*maxdofspernode,sizeof(int)); //initialize to 0, so that we can pick up the max
 		alltruedofs=(int*)xcalloc(numnodes*maxdofspernode,sizeof(int));
 	}
 
 	for (i=0;i<this->Size();i++){
-		/*Check that this node corresponds to our analysis currently being carried out: */
 		Node* node=(Node*)this->GetObjectByOffset(i);
 		if (node->InAnalysis(analysis_type)){
 			node->ShowTrueDofs(truedofs,maxdofspernode,setenum);//give maxdofspernode, column size, so that nodes can index into truedofs
 		}
 	}
-
 	MPI_Allreduce ( (void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
 
-	/*Ok, now every cpu knows the true dofs of everyone else that is not a clone. Let the clones recover those true dofs: */
+	/* Now every cpu knows the true dofs of everyone else that is not a clone*/
 	for (i=0;i<this->Size();i++){
-		/*Check that this node corresponds to our analysis currently being carried out: */
 		Node* node=(Node*)this->GetObjectByOffset(i);
 		if (node->InAnalysis(analysis_type)){
-			node->UpdateCloneDofs(alltruedofs,maxdofspernode,setenum); //give maxdofspernode, column size, so that nodes can index into alltruedofs
+			node->UpdateCloneDofs(alltruedofs,maxdofspernode,setenum);
 		}
 	}
 
@@ -145,8 +132,6 @@
 	xfree((void**)&alldofcount);
 	xfree((void**)&truedofs);
 	xfree((void**)&alltruedofs);
-
-
 }
 /*}}}*/
 /*FUNCTION Nodes::FlagClones{{{1*/

Modified: issm/trunk/src/c/Container/Vertices.cpp
===================================================================
--- issm/trunk/src/c/Container/Vertices.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/Container/Vertices.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -44,59 +44,49 @@
 	extern int my_rank;
 
 	int  i;
-	
 	int  dofcount=0;
 	int* alldofcount=NULL;
 	int* truedofs=NULL;
 	int* alltruedofs=NULL;
 
-	/*Go through objects, and distribute dofs locally, from 0 to numberofdofsperobject: */
+	/*Go through objects, and distribute dofs locally, from 0 to numberofdofsperobject*/
 	for (i=0;i<this->Size();i++){
 		Vertex* vertex=(Vertex*)this->GetObjectByOffset(i);
 		vertex->DistributeDofs(&dofcount);
 	}
 
-	/*Ok, now every object 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 object: */
-
+	/* Now every object has distributed dofs, but locally, and with a dof count starting from 
+	 * 0. This means the dofs between all the cpus are not unique. We now offset the dofs of eache
+	 * cpus by the total last dofs of the previus cpu, starting from 0.
+	 * First: bet number of dofs for each cpu*/
 	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. : */
+	/* 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{
+	if(my_rank!=0){
 		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 (i=0;i<this->Size();i++){
 		Vertex* vertex=(Vertex*)this->GetObjectByOffset(i);
 		vertex->OffsetDofs(dofcount);
 	}
 
-	/*Finally, remember that cpus may have skipped some objects, because they were clones. For every 
+	/* Finally, remember that cpus may have skipped some objects, because they were clones. For every 
 	 * object that is not a clone, tell them to show their dofs, so that later on, they can get picked 
 	 * up by their clones: */
-	truedofs=(int*)xcalloc(numberofobjects*numberofdofsperobject,sizeof(int));
+	truedofs   =(int*)xcalloc(numberofobjects*numberofdofsperobject,sizeof(int));
 	alltruedofs=(int*)xcalloc(numberofobjects*numberofdofsperobject,sizeof(int));
-
 	for (i=0;i<this->Size();i++){
 		Vertex* vertex=(Vertex*)this->GetObjectByOffset(i);
 		vertex->ShowTrueDofs(truedofs);
 	}
-	
-	MPI_Allreduce ( (void*)truedofs,(void*)alltruedofs,numberofobjects*numberofdofsperobject,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
+	MPI_Allreduce((void*)truedofs,(void*)alltruedofs,numberofobjects*numberofdofsperobject,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
 
-	/*Ok, now every cpu knows the true dofs of everyone else that is not a clone. Let the clones recover those true dofs: */
+	/* Now every cpu knows the true dofs of everyone else that is not a clone*/
 	for (i=0;i<this->Size();i++){
 		Vertex* vertex=(Vertex*)this->GetObjectByOffset(i);
 		vertex->UpdateCloneDofs(alltruedofs);
@@ -106,7 +96,6 @@
 	xfree((void**)&alldofcount);
 	xfree((void**)&truedofs);
 	xfree((void**)&alltruedofs);
-
 }
 /*}}}*/
 /*FUNCTION Vertices::FlagClones{{{1*/

Modified: issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
===================================================================
--- issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -27,6 +27,7 @@
 	ConstantsYtsEnum,
 	DiagnosticAbstolEnum,
 	DiagnosticIcefrontEnum,
+	DiagnosticIsnewtonEnum,
 	DiagnosticMaxiterEnum,
 	DiagnosticNumRequestedOutputsEnum,
 	DiagnosticPenaltyFactorEnum,
@@ -70,6 +71,8 @@
 	InversionGradientOnlyEnum,
 	InversionGradientScalingEnum,
 	InversionIscontrolEnum,
+	InversionTaoEnum,
+	InversionIncompleteAdjointEnum,
 	InversionMaxParametersEnum,
 	InversionMaxiterPerStepEnum,
 	InversionMinParametersEnum,
@@ -149,8 +152,7 @@
 	SteadystateReltolEnum,
 	SteadystateRequestedOutputsEnum,
 	SurfaceEnum,
-	SurfaceforcingsAblationRateEnum,
-	SurfaceforcingsAccumulationRateEnum,
+	SurfaceforcingsPrecipitationEnum,
 	SurfaceforcingsMassBalanceEnum,
 	ThermalMaxiterEnum,
 	ThermalPenaltyFactorEnum,
@@ -158,6 +160,7 @@
 	ThermalPenaltyThresholdEnum,
 	ThermalSpctemperatureEnum,
 	ThermalStabilizationEnum,
+	ThermalIsenthalpyEnum,
 	ThicknessEnum,
 	TimesteppingCflCoefficientEnum,
 	TimesteppingFinalTimeEnum,
@@ -259,7 +262,7 @@
 	PengridEnum,
 	PenpairEnum,
 	PentaEnum,
-	PentaVertexInputEnum,
+	PentaP1InputEnum,
 	PetscMatParamEnum,
 	PetscVecParamEnum,
 	RiftfrontEnum,
@@ -272,7 +275,7 @@
 	StringArrayParamEnum,
 	StringParamEnum,
 	TriaEnum,
-	TriaVertexInputEnum,
+	TriaP1InputEnum,
 	VertexEnum,
 	/*}}}*/
 	/*Fill {{{1*/
@@ -391,11 +394,11 @@
 	PatchEnum,
 	PatchNodesEnum,
 	PatchVerticesEnum,
-	PentaVertexElementResultEnum,
+	PentaP1ElementResultEnum,
 	PetscVecExternalResultEnum,
 	StringExternalResultEnum,
 	TimeEnum,
-	TriaVertexElementResultEnum,
+	TriaP1ElementResultEnum,
 	WaterColumnOldEnum,
 	/*}}}*/
 	/*Responses{{{1*/

Modified: issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp
===================================================================
--- issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/EnumDefinitions/EnumToModelField.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -22,8 +22,6 @@
 		case VyEnum : return "vy";
 		case InversionVyObsEnum : return "vy_obs";
 		case BasalforcingsMeltingRateEnum : return "basal_melting_rate";
-      case SurfaceforcingsAccumulationRateEnum : return "surface_accumulation_rate";
-		case SurfaceforcingsAblationRateEnum : return "surface_ablation_rate";
 		case SurfaceforcingsMassBalanceEnum : return "surface_mass_balance";
 		default : _error_("No model field is associated to enum %s",EnumToStringx(en));
 	}

Modified: issm/trunk/src/c/EnumDefinitions/Synchronize.sh
===================================================================
--- issm/trunk/src/c/EnumDefinitions/Synchronize.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/EnumDefinitions/Synchronize.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,6 +9,9 @@
 rm $ISSM_TIER/src/c/modules/EnumToStringx/EnumToStringx.cpp
 rm $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
 
+#Get number of enums
+NUMENUMS=$(wc -l temp | awk '{printf("%s",$1);}');
+
 #Take care of EnumToModelField.m first (easy)
 #Build EnumToModelField.m {{{1
 cat <<END > $ISSM_TIER/src/m/enum/EnumToModelField.m
@@ -94,22 +97,35 @@
 
 int  StringToEnumx(const char* name){
 
+   int  stage=1;
+
 END
+
 #core
-cat temp |  awk '{print "\t" ((NR==1)?"if":"else if") " (strcmp(name,\"" substr($2,1,length($2)-4) "\")==0) return " $2 ";"}' >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
-#Footer
+i1=1;
+i2=120;
+for (( i=1 ; i<=100 ; i++ )); do
+	echo "   if(stage==$i){" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
+	awk -v i1=$i1 -v i2=$i2 '{if(NR>=i1 && NR<=i2) print $0 }' temp |
+	awk '{print "\t" ((NR==1)?"      if":"      else if") " (strcmp(name,\"" substr($2,1,length($2)-4) "\")==0) return " $2 ";"}' >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
+	echo "         else stage=$(($i+1));" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
+	echo "   }" >> $ISSM_TIER//src/c/modules/StringToEnumx/StringToEnumx.cpp
+	
+	if [ $i2 -ge $NUMENUMS ]; then break; fi
+	let i1=$i1+120
+	let i2=$i2+120
+done
+
+#footer
 cat <<END >> $ISSM_TIER/src/c/modules/StringToEnumx/StringToEnumx.cpp
-	else _error_("Enum %s not found",name);
-
+	/*If we reach this point, the string provided has not been found*/
+   _error_("Enum %s not found",name);
 }
 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
+for (( i=1 ; i<=$NUMENUMS ; i++ )); do
 
 	#Get name and enum of the line i
 	NAMEENUM=$(cat temp | grep "^[ ]*$i " | awk '{printf("%s",$2);}');
@@ -122,15 +138,15 @@
 	if [ $i -lt 10 ]
 	then
 		printf "\r                                                                      "
-		printf "\r  $i/$NUMBEROFLINES Adding "$NAME"..."
+		printf "\r  $i/$NUMENUMS Adding "$NAME"..."
 	else
 		if [ $i -lt 100 ]
 		then
 			printf "\r                                                                      "
-			printf "\r $i/$NUMBEROFLINES Adding "$NAME"..."
+			printf "\r $i/$NUMENUMS Adding "$NAME"..."
 		else
 			printf "\r                                                                      "
-			printf "\r$i/$NUMBEROFLINES Adding "$NAME"..."
+			printf "\r$i/$NUMENUMS Adding "$NAME"..."
 		fi
 	fi
 	#}}}
@@ -152,7 +168,6 @@
 
 done
 
-
 #clean up{{{
 rm temp
 #}}}

Modified: issm/trunk/src/c/Makefile.am
===================================================================
--- issm/trunk/src/c/Makefile.am	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +1,5 @@
 INCLUDES = @DAKOTAINCL@ @SHAPELIBINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@  @METISINCL@  @CHACOINCL@ @SCOTCHINCL@ @PLAPACKINCL@  @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@  @TRIANGLEINCL@ @HYPREINCL@ @MLINCL@ @TAOINCL@
+EXEEXT=$(ISSMEXT)
 
 #Library declaration {{{1
 #Compile serial library, and then try and compile parallel library
@@ -60,8 +61,8 @@
 					./objects/ElementResults/ElementResultLocal.h\
 					./objects/ElementResults/DoubleElementResult.h\
 					./objects/ElementResults/DoubleElementResult.cpp\
-					./objects/ElementResults/TriaVertexElementResult.h\
-					./objects/ElementResults/TriaVertexElementResult.cpp\
+					./objects/ElementResults/TriaP1ElementResult.h\
+					./objects/ElementResults/TriaP1ElementResult.cpp\
 					./objects/ElementResults/BoolElementResult.h\
 					./objects/ElementResults/BoolElementResult.cpp\
 					./objects/ExternalResults/ExternalResult.h\
@@ -87,8 +88,8 @@
 					./objects/Elements/TriaRef.cpp\
 					./objects/Inputs/Input.h\
 					./objects/Inputs/InputLocal.h\
-					./objects/Inputs/TriaVertexInput.h\
-					./objects/Inputs/TriaVertexInput.cpp\
+					./objects/Inputs/TriaP1Input.h\
+					./objects/Inputs/TriaP1Input.cpp\
 					./objects/Inputs/BoolInput.h\
 					./objects/Inputs/BoolInput.cpp\
 					./objects/Inputs/IntInput.h\
@@ -184,6 +185,8 @@
 					./shared/Numerics/GaussPoints.h\
 					./shared/Numerics/GaussPoints.cpp\
 					./shared/Numerics/cross.cpp\
+					./shared/Numerics/isnan.h\
+					./shared/Numerics/isnan.cpp\
 					./shared/Numerics/extrema.cpp\
 					./shared/Numerics/XZvectorsToCoordinateSystem.cpp\
 					./shared/Numerics/UnitConversion.cpp\
@@ -308,6 +311,8 @@
 					./modules/ComputeStrainRatex/ComputeStrainRatex.cpp\
 					./modules/SpcNodesx/SpcNodesx.h\
 					./modules/SpcNodesx/SpcNodesx.cpp\
+					./modules/PositiveDegreeDayx/PositiveDegreeDayx.h\
+					./modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp\
 					./modules/UpdateConstraintsx/UpdateConstraintsx.h\
 					./modules/UpdateConstraintsx/UpdateConstraintsx.cpp\
 					./modules/MeshPartitionx/MeshPartitionx.cpp\
@@ -322,6 +327,8 @@
 					./modules/StringToEnumx/StringToEnumx.h\
 					./modules/SystemMatricesx/SystemMatricesx.cpp\
 					./modules/SystemMatricesx/SystemMatricesx.h\
+					./modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp\
+					./modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h\
 					./modules/ConstraintsStatex/ConstraintsStatex.cpp\
 					./modules/ConstraintsStatex/ConstraintsStatex.h\
 					./modules/ConstraintsStatex/ConstraintsStateLocal.h\
@@ -351,7 +358,8 @@
 					./solutions/AnalysisConfiguration.cpp\
 					./solutions/CorePointerFromSolutionEnum.cpp\
 					./solvers/solver_linear.cpp\
-					./solvers/solver_nonlinear.cpp
+					./solvers/solver_nonlinear.cpp\
+					./solvers/solver_newton.cpp
 #}}}
 #DAKOTA sources  {{{1
 dakota_sources = ./objects/DakotaPlugin.h\
@@ -412,6 +420,7 @@
 thermal_psources = ./solutions/thermal_core.cpp\
 					    ./solutions/thermal_core_step.cpp\
 					    ./solutions/enthalpy_core.cpp\
+					    ./solutions/enthalpy_core_step.cpp\
 					    ./solvers/solver_thermal_nonlinear.cpp
 #}}}
 #Control sources  {{{1
@@ -421,6 +430,10 @@
 					  ./modules/ControlInputSetGradientx/ControlInputSetGradientx.h\
 					  ./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp\
 					  ./modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h\
+					  ./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp\
+					  ./modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h\
+					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp\
+					  ./modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h\
 					  ./modules/ModelProcessorx/Control/CreateParametersControl.cpp\
 					  ./modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp\
 					  ./modules/InputControlUpdatex/InputControlUpdatex.h\
@@ -557,10 +570,10 @@
 #3D sources  {{{1
 threed_sources = ./objects/Gauss/GaussPenta.h\
 				     ./objects/Gauss/GaussPenta.cpp\
-				     ./objects/ElementResults/PentaVertexElementResult.h\
-				     ./objects/ElementResults/PentaVertexElementResult.cpp\
-				     ./objects/Inputs/PentaVertexInput.h\
-				     ./objects/Inputs/PentaVertexInput.cpp\
+				     ./objects/ElementResults/PentaP1ElementResult.h\
+				     ./objects/ElementResults/PentaP1ElementResult.cpp\
+				     ./objects/Inputs/PentaP1Input.h\
+				     ./objects/Inputs/PentaP1Input.cpp\
 				     ./objects/Elements/Penta.h\
 				     ./objects/Elements/Penta.cpp\
 				     ./objects/Elements/PentaHook.h\
@@ -641,10 +654,10 @@
 			     ./modules/Kml2Expx/Kml2Expx.cpp\
 			     ./modules/Shp2Kmlx/Shp2Kmlx.h\
 			     ./modules/Shp2Kmlx/Shp2Kmlx.cpp\
+			     ./modules/KMLFileReadx/KMLFileReadx.h\
+			     ./modules/KMLFileReadx/KMLFileReadx.cpp\
 			     ./modules/KMLMeshWritex/KMLMeshWritex.h\
 			     ./modules/KMLMeshWritex/KMLMeshWritex.cpp\
-			     ./modules/KMLMeshWritex/KMLFileReadx.h\
-			     ./modules/KMLMeshWritex/KMLFileReadx.cpp\
 			     ./modules/KMLOverlayx/KMLOverlayx.h\
 			     ./modules/KMLOverlayx/KMLOverlayx.cpp\
 			     ./objects/KML/KML_Attribute.cpp\
@@ -697,6 +710,8 @@
 			     ./objects/KML/KML_StyleSelector.h\
 			     ./objects/KML/KML_SubStyle.cpp\
 			     ./objects/KML/KML_SubStyle.h\
+			     ./objects/KML/KML_Unknown.cpp\
+			     ./objects/KML/KML_Unknown.h\
 			     ./objects/KML/KMLFileReadUtils.cpp\
 			     ./objects/KML/KMLFileReadUtils.h
 #}}}
@@ -732,8 +747,6 @@
 			./shared/Threads/issm_threads.h\
 			./shared/Threads/LaunchThread.cpp\
 			./shared/Threads/PartitionRange.cpp\
-			./shared/Numerics/isnan.h\
-			./shared/Numerics/isnan.cpp\
 			./shared/Exp/exp.h\
 			./shared/Exp/IsInPoly.cpp\
 			./shared/Exp/IsInPolySerial.cpp\
@@ -883,7 +896,7 @@
 libISSM_a_SOURCES += $(kml_sources)
 libISSM_a_SOURCES += $(matlab_sources)
 
-libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_  $(CXXOPTFLAGS)
+libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_  $(CXXFLAGS) $(CXXOPTFLAGS) 
 if LARGEARRAYS
 libISSM_a_CXXFLAGS += -D__GCC4BUILD__  
 else
@@ -893,26 +906,26 @@
 #ISSM parallel library {{{1
 libpISSM_a_SOURCES  = $(issm_sources)
 libpISSM_a_SOURCES += $(issm_psources)
-libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_   -D_C_ $(CXXOPTFLAGS) 
+libpISSM_a_CXXFLAGS = -fPIC -D_PARALLEL_   -D_C_ $(CXXFLAGS) $(CXXOPTFLAGS) 
 #}}}
 #Overload library, to overload any non-standard symbols. {{{1
 libOverload_a_SOURCES = ./shared/String/stricmp.c
-libOverload_a_CFLAGS  = -fPIC -D_PARALLEL_   -D_C_ $(COPTFLAGS)
+libOverload_a_CFLAGS  = -fPIC -D_PARALLEL_   -D_C_ $(COPTFLAGS) $(CFLAGS)
 #}}}
 
 #Executable {{{1
 if NOPARALLEL
 bin_PROGRAMS = 
 else 
-bin_PROGRAMS = issm.exe
+bin_PROGRAMS = issm
 endif
 
 #Standard libraries
 LDADD =      ./libpISSM.a ./libOverload.a
 
 #External packages
-LDADD += $(PETSCLIB) $(TAOLIB) $(FLIBS) $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(ADIC2LIB) 
+LDADD += $(PETSCLIB) $(TAOLIB) $(FLIBS) $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB) $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MKLLIB) $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(ADIC2LIB)  $(OSLIBS)
 
-issm_exe_SOURCES = solutions/issm.cpp
-issm_exe_CXXFLAGS= -fPIC -D_PARALLEL_  $(CXXOPTFLAGS) $(COPTFLAGS) 
+issm_SOURCES = solutions/issm.cpp
+issm_CXXFLAGS= -fPIC -D_PARALLEL_  $(CXXFLAGS) $(CXXOPTFLAGS) $(COPTFLAGS) 
 #}}}

Modified: issm/trunk/src/c/include/typedefs.h
===================================================================
--- issm/trunk/src/c/include/typedefs.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/include/typedefs.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -22,8 +22,21 @@
 
 /*Windows specific typefefs: */
 #ifdef _INTEL_WIN_
-#define NAN 0.0/0.0
-#define INFINITY 1.0/0.0
+
+/*Complicated way, which does not handle INFINITY though: */
+/*#ifndef NAN
+	static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
+	#define NAN (*(const float *) __nan)
+#endif*/
+
+//For reference, for Intel compile on win64
+//#define NAN 0.0/0.0 
+//#define INFINITY 1.0/0.0
+
+//Most generic way it would seem:
+#define INFINITY (DBL_MAX+DBL_MAX)
+#define NAN (INFINITY-INFINITY)
+	
 #endif
 
 

Deleted: issm/trunk/src/c/intel-compile.sh
===================================================================
--- issm/trunk/src/c/intel-compile.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/intel-compile.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,21 +0,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
-ar cru libISSM.a *.obj

Modified: issm/trunk/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp
===================================================================
--- issm/trunk/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/BamgTriangulatex/BamgTriangulatex.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -16,5 +16,6 @@
 	Mesh Th(x,y,nods);
 	Th.WriteIndex(pindex,pnels);
 	//delete &Th;
+	return 0;
 
 }

Modified: issm/trunk/src/c/modules/Chacox/Chacox.cpp
===================================================================
--- issm/trunk/src/c/modules/Chacox/Chacox.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Chacox/Chacox.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -190,5 +190,7 @@
 	return(0);
 
 
-	#endif //ifdef _HAVE_CHACO_
+	#else //ifdef _HAVE_CHACO_
+	return (0);
+	#endif
 }

Modified: issm/trunk/src/c/modules/Chacox/input_parse.cpp
===================================================================
--- issm/trunk/src/c/modules/Chacox/input_parse.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Chacox/input_parse.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -261,5 +261,7 @@
 
 	return(0);
 
-	#endif //#ifdef _HAVE_CHACO_ 
+	#else //#ifdef _HAVE_CHACO_ 
+	return(0);
+	#endif
 }

Modified: issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp
===================================================================
--- issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ContourToMeshx/ContourToMeshxt.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -68,4 +68,6 @@
 		IsInPoly(in_nod,xc,yc,numnodes,x,y,i0,i1,edgevalue);
 	}
 
+	return NULL;
+
 }

Modified: issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp
===================================================================
--- issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ContourToNodesx/ContourToNodesx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -35,5 +35,6 @@
 
 	/*Assign output pointers: */
 	*pflags=flags;
-
+	
+	return 1;
 }

Modified: issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp
===================================================================
--- issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -8,19 +8,31 @@
 #include "../../toolkits/toolkits.h"
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void ControlInputGetGradientx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name){
+void ControlInputGetGradientx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
 
-	Vec gradient=NULL;
-	gradient=NewVec(vertices->NumberOfVertices());
+	/*Intermediaries*/
+	int  num_controls;
+	int *control_type = NULL;
+	Vec  gradient=NULL;
 
-	for(int i=0;i<elements->Size();i++){
-		Element* element=(Element*)elements->GetObjectByOffset(i);
-		element->ControlInputGetGradient(gradient,name);
+	/*Retrieve some parameters*/
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+
+	/*Allocate and populate gradient*/
+	gradient=NewVec(num_controls*vertices->NumberOfVertices());
+
+	for(int i=0;i<num_controls;i++){
+		for(int j=0;j<elements->Size();j++){
+			Element* element=(Element*)elements->GetObjectByOffset(j);
+			element->ControlInputGetGradient(gradient,control_type[i],i);
+		}
 	}
 
 	VecAssemblyBegin(gradient);
 	VecAssemblyEnd(gradient);
 
-	/*Assign output pointers:*/
+	/*Clean up and return*/
+	xfree((void**)&control_type);
 	*pgradient=gradient;
 }

Modified: issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h
===================================================================
--- issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ControlInputGetGradientx/ControlInputGetGradientx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,6 +7,6 @@
 #include "../../objects/objects.h"
 #include "../../Container/Container.h"
 
-void	ControlInputGetGradientx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name);
+void	ControlInputGetGradientx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters);
 
 #endif

Modified: issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp
===================================================================
--- issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -8,11 +8,34 @@
 #include "../../toolkits/toolkits.h"
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name,double scale){
+void ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* norm_list,int step){
 
-	for(int i=0;i<elements->Size();i++){
-		Element* element=(Element*)elements->GetObjectByOffset(i);
-		element->ControlInputScaleGradient(name,scale);
+	/*Intermediaries*/
+	int     i,j,num_controls;
+	int    *control_type = NULL;
+	double *scalar_list = NULL;
+	double  scalar;
+
+
+	/*Retrieve some parameters*/
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+	parameters->FindParam(&scalar_list,NULL,NULL,InversionGradientScalingEnum);
+
+	/*Compute scaling factor*/
+	scalar=scalar_list[0]/norm_list[0];
+	for(i=0;i<num_controls;i++){
+		scalar=min(scalar,scalar_list[num_controls*step+i]/norm_list[i]);
 	}
 
+	for(i=0;i<num_controls;i++){
+		for(j=0;j<elements->Size();j++){
+			Element* element=(Element*)elements->GetObjectByOffset(j);
+			element->ControlInputScaleGradient(control_type[i],scalar);
+		}
+	}
+
+	/*Clean up and return*/
+	xfree((void**)&control_type);
+	xfree((void**)&scalar_list);
 }

Modified: issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h
===================================================================
--- issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ControlInputScaleGradientx/ControlInputScaleGradientx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,6 +7,6 @@
 #include "../../objects/objects.h"
 #include "../../Container/Container.h"
 
-void	ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,double scale);
+void	ControlInputScaleGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* norm_list,int step);
 
 #endif

Modified: issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp
===================================================================
--- issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -8,21 +8,34 @@
 #include "../../toolkits/toolkits.h"
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name,double* gradient){
+void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* gradient){
 
-	for(int i=0;i<elements->Size();i++){
-		Element* element=(Element*)elements->GetObjectByOffset(i);
-		element->ControlInputSetGradient(gradient,name);
+	/*Intermediaries*/
+	int  num_controls;
+	int *control_type = NULL;
+
+	/*Retrieve some parameters*/
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+
+	for(int i=0;i<num_controls;i++){
+		for(int j=0;j<elements->Size();j++){
+			Element* element=(Element*)elements->GetObjectByOffset(j);
+			element->ControlInputSetGradient(gradient,control_type[i],i);
+		}
 	}
 
+	/*Clean up and return*/
+	xfree((void**)&control_type);
+
 }
-void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name,Vec gradient){
+void ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec gradient){
 
 	/*Serialize gradient*/
 	double* serial_gradient=NULL;
 	VecToMPISerial(&serial_gradient,gradient);
 
-	ControlInputSetGradientx(elements,nodes,vertices, loads, materials, parameters, name,serial_gradient);
+	ControlInputSetGradientx(elements,nodes,vertices, loads, materials, parameters,serial_gradient);
 
 	/*Clean up and return*/
 	xfree((void**)&serial_gradient);

Modified: issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h
===================================================================
--- issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ControlInputSetGradientx/ControlInputSetGradientx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,7 +7,7 @@
 #include "../../objects/objects.h"
 #include "../../Container/Container.h"
 
-void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,double* gradient);
-void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,int name,Vec gradient);
+void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* gradient);
+void	ControlInputSetGradientx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec gradient);
 
 #endif

Deleted: issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,48 +0,0 @@
-/*!\file CreateJacobianMatrixx
- * \brief: create system matrices (stiffness matrix, loads vector)
- */
-
-#include "./CreateJacobianMatrixx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../io/io.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-void CreateJacobianMatrixx(Mat* pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax){
-	
-	int      i,connectivity;
-	int      numberofdofspernode;
-	int      fsize,configuration_type;
-	Element *element = NULL;
-	Load    *load    = NULL;
-	Mat      Jff     = NULL;
-
-	/*Checks*/
-	_assert_(nodes && elements);
-
-	/*Recover some parameters*/
-	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-	parameters->FindParam(&connectivity,MeshAverageVertexConnectivityEnum);
-	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
-	numberofdofspernode=nodes->MaxNumDofs(configuration_type,GsetEnum);
-
-	/*Initialize Jacobian Matrix*/
-	Jff=NewMat(fsize,fsize,connectivity,numberofdofspernode);
-	
-	/*Create and assemble matrix*/
-	for(i=0;i<elements->Size();i++){
-		element=(Element*)elements->GetObjectByOffset(i);
-		element->CreateJacobianMatrix(Jff);
-	}
-	for (i=0;i<loads->Size();i++){
-		load=(Load*)loads->GetObjectByOffset(i);
-		if(load->InAnalysis(configuration_type)) load->CreateJacobianMatrix(Jff);
-		if(load->InAnalysis(configuration_type)) load->PenaltyCreateJacobianMatrix(Jff,kmax);
-	}
-	MatAssemblyBegin(Jff,MAT_FINAL_ASSEMBLY);
-	MatAssemblyEnd(Jff,MAT_FINAL_ASSEMBLY);
-
-	/*Assign output pointer*/
-	*pJff=Jff;
-}

Copied: issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp (from rev 11526, issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp)
===================================================================
--- issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	                        (rev 0)
+++ issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,48 @@
+/*!\file CreateJacobianMatrixx
+ * \brief: create system matrices (stiffness matrix, loads vector)
+ */
+
+#include "./CreateJacobianMatrixx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../io/io.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void CreateJacobianMatrixx(Mat* pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax){
+	
+	int      i,connectivity;
+	int      numberofdofspernode;
+	int      fsize,configuration_type;
+	Element *element = NULL;
+	Load    *load    = NULL;
+	Mat      Jff     = NULL;
+
+	/*Checks*/
+	_assert_(nodes && elements);
+
+	/*Recover some parameters*/
+	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+	parameters->FindParam(&connectivity,MeshAverageVertexConnectivityEnum);
+	fsize=nodes->NumberOfDofs(configuration_type,FsetEnum);
+	numberofdofspernode=nodes->MaxNumDofs(configuration_type,GsetEnum);
+
+	/*Initialize Jacobian Matrix*/
+	Jff=NewMat(fsize,fsize,connectivity,numberofdofspernode);
+	
+	/*Create and assemble matrix*/
+	for(i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->CreateJacobianMatrix(Jff);
+	}
+	for (i=0;i<loads->Size();i++){
+		load=(Load*)loads->GetObjectByOffset(i);
+		if(load->InAnalysis(configuration_type)) load->CreateJacobianMatrix(Jff);
+		if(load->InAnalysis(configuration_type)) load->PenaltyCreateJacobianMatrix(Jff,kmax);
+	}
+	MatAssemblyBegin(Jff,MAT_FINAL_ASSEMBLY);
+	MatAssemblyEnd(Jff,MAT_FINAL_ASSEMBLY);
+
+	/*Assign output pointer*/
+	*pJff=Jff;
+}

Deleted: issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,14 +0,0 @@
-/*!\file:  CreateJacobianMatrixx.h
- * \brief header file for degree of freedoms distribution routines.
- */ 
-
-#ifndef _CREATEJACOBIANMATRIXX_H
-#define _CREATEJACOBIANMATRIXX_H
-
-#include "../../Container/Container.h"
-#include "../../objects/objects.h"
-
-/* local prototypes: */
-void CreateJacobianMatrixx(Mat* pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax);
-
-#endif  /* _CREATEJACOBIANMATRIXX_H */

Copied: issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h (from rev 11526, issm/trunk-jpl/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h)
===================================================================
--- issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	                        (rev 0)
+++ issm/trunk/src/c/modules/CreateJacobianMatrixx/CreateJacobianMatrixx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,14 @@
+/*!\file:  CreateJacobianMatrixx.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _CREATEJACOBIANMATRIXX_H
+#define _CREATEJACOBIANMATRIXX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void CreateJacobianMatrixx(Mat* pJff,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,double kmax);
+
+#endif  /* _CREATEJACOBIANMATRIXX_H */

Modified: issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
===================================================================
--- issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -31,6 +31,7 @@
 		case ConstantsYtsEnum : return "ConstantsYts";
 		case DiagnosticAbstolEnum : return "DiagnosticAbstol";
 		case DiagnosticIcefrontEnum : return "DiagnosticIcefront";
+		case DiagnosticIsnewtonEnum : return "DiagnosticIsnewton";
 		case DiagnosticMaxiterEnum : return "DiagnosticMaxiter";
 		case DiagnosticNumRequestedOutputsEnum : return "DiagnosticNumRequestedOutputs";
 		case DiagnosticPenaltyFactorEnum : return "DiagnosticPenaltyFactor";
@@ -74,6 +75,8 @@
 		case InversionGradientOnlyEnum : return "InversionGradientOnly";
 		case InversionGradientScalingEnum : return "InversionGradientScaling";
 		case InversionIscontrolEnum : return "InversionIscontrol";
+		case InversionTaoEnum : return "InversionTao";
+		case InversionIncompleteAdjointEnum : return "InversionIncompleteAdjoint";
 		case InversionMaxParametersEnum : return "InversionMaxParameters";
 		case InversionMaxiterPerStepEnum : return "InversionMaxiterPerStep";
 		case InversionMinParametersEnum : return "InversionMinParameters";
@@ -153,8 +156,7 @@
 		case SteadystateReltolEnum : return "SteadystateReltol";
 		case SteadystateRequestedOutputsEnum : return "SteadystateRequestedOutputs";
 		case SurfaceEnum : return "Surface";
-		case SurfaceforcingsAblationRateEnum : return "SurfaceforcingsAblationRate";
-		case SurfaceforcingsAccumulationRateEnum : return "SurfaceforcingsAccumulationRate";
+		case SurfaceforcingsPrecipitationEnum : return "SurfaceforcingsPrecipitation";
 		case SurfaceforcingsMassBalanceEnum : return "SurfaceforcingsMassBalance";
 		case ThermalMaxiterEnum : return "ThermalMaxiter";
 		case ThermalPenaltyFactorEnum : return "ThermalPenaltyFactor";
@@ -162,6 +164,7 @@
 		case ThermalPenaltyThresholdEnum : return "ThermalPenaltyThreshold";
 		case ThermalSpctemperatureEnum : return "ThermalSpctemperature";
 		case ThermalStabilizationEnum : return "ThermalStabilization";
+		case ThermalIsenthalpyEnum : return "ThermalIsenthalpy";
 		case ThicknessEnum : return "Thickness";
 		case TimesteppingCflCoefficientEnum : return "TimesteppingCflCoefficient";
 		case TimesteppingFinalTimeEnum : return "TimesteppingFinalTime";
@@ -255,7 +258,7 @@
 		case PengridEnum : return "Pengrid";
 		case PenpairEnum : return "Penpair";
 		case PentaEnum : return "Penta";
-		case PentaVertexInputEnum : return "PentaVertexInput";
+		case PentaP1InputEnum : return "PentaP1Input";
 		case PetscMatParamEnum : return "PetscMatParam";
 		case PetscVecParamEnum : return "PetscVecParam";
 		case RiftfrontEnum : return "Riftfront";
@@ -268,7 +271,7 @@
 		case StringArrayParamEnum : return "StringArrayParam";
 		case StringParamEnum : return "StringParam";
 		case TriaEnum : return "Tria";
-		case TriaVertexInputEnum : return "TriaVertexInput";
+		case TriaP1InputEnum : return "TriaP1Input";
 		case VertexEnum : return "Vertex";
 		case AirEnum : return "Air";
 		case IceEnum : return "Ice";
@@ -377,11 +380,11 @@
 		case PatchEnum : return "Patch";
 		case PatchNodesEnum : return "PatchNodes";
 		case PatchVerticesEnum : return "PatchVertices";
-		case PentaVertexElementResultEnum : return "PentaVertexElementResult";
+		case PentaP1ElementResultEnum : return "PentaP1ElementResult";
 		case PetscVecExternalResultEnum : return "PetscVecExternalResult";
 		case StringExternalResultEnum : return "StringExternalResult";
 		case TimeEnum : return "Time";
-		case TriaVertexElementResultEnum : return "TriaVertexElementResult";
+		case TriaP1ElementResultEnum : return "TriaP1ElementResult";
 		case WaterColumnOldEnum : return "WaterColumnOld";
 		case MinVelEnum : return "MinVel";
 		case MaxVelEnum : return "MaxVel";

Deleted: issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,55 +0,0 @@
-/*!\file GetVectorFromControlInputsx
- * \brief retrieve vector from inputs in elements
- */
-
-#include "./GetVectorFromControlInputsx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-void GetVectorFromControlInputsx(Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
-
-	int  num_controls;
-	int *control_type = NULL;
-	Vec  vector=NULL;
-
-	/*Retrieve some parameters*/
-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
-	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
-
-	/*Allocate and populate gradient*/
-	vector=NewVec(num_controls*vertices->NumberOfVertices());
-
-	for(int i=0;i<num_controls;i++){
-		for(int j=0;j<elements->Size();j++){
-			Element* element=(Element*)elements->GetObjectByOffset(j);
-			element->GetVectorFromControlInputs(vector,control_type[i],i,data);
-		}
-	}
-
-	VecAssemblyBegin(vector);
-	VecAssemblyEnd(vector);
-
-	/*Assign output pointers:*/
-	xfree((void**)&control_type);
-	*pvector=vector;
-}
-
-void GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){
-	
-	/*output: */
-	double* vector=NULL;
-	
-	/*intermediary: */
-	Vec vec_vector=NULL;
-
-	GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data);
-	VecToMPISerial(&vector,vec_vector);
-
-	/*Free ressources:*/
-	VecFree(&vec_vector);
-
-	/*Assign output pointers:*/
-	*pvector=vector;
-}

Copied: issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp (from rev 11526, issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp)
===================================================================
--- issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	                        (rev 0)
+++ issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,55 @@
+/*!\file GetVectorFromControlInputsx
+ * \brief retrieve vector from inputs in elements
+ */
+
+#include "./GetVectorFromControlInputsx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void GetVectorFromControlInputsx(Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,const char* data){
+
+	int  num_controls;
+	int *control_type = NULL;
+	Vec  vector=NULL;
+
+	/*Retrieve some parameters*/
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+
+	/*Allocate and populate gradient*/
+	vector=NewVec(num_controls*vertices->NumberOfVertices());
+
+	for(int i=0;i<num_controls;i++){
+		for(int j=0;j<elements->Size();j++){
+			Element* element=(Element*)elements->GetObjectByOffset(j);
+			element->GetVectorFromControlInputs(vector,control_type[i],i,data);
+		}
+	}
+
+	VecAssemblyBegin(vector);
+	VecAssemblyEnd(vector);
+
+	/*Assign output pointers:*/
+	xfree((void**)&control_type);
+	*pvector=vector;
+}
+
+void GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, const char* data){
+	
+	/*output: */
+	double* vector=NULL;
+	
+	/*intermediary: */
+	Vec vec_vector=NULL;
+
+	GetVectorFromControlInputsx( &vec_vector, elements,nodes, vertices, loads, materials, parameters,data);
+	VecToMPISerial(&vector,vec_vector);
+
+	/*Free ressources:*/
+	VecFree(&vec_vector);
+
+	/*Assign output pointers:*/
+	*pvector=vector;
+}

Deleted: issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +0,0 @@
-/*!\file:  GetVectorFromControlInputsx.h
- */ 
-
-#ifndef _GETVECTORFROMCONTROLINPUTSXX_H
-#define _GETVECTORFROMCONTROLINPUTSXX_H
-
-#include "../../objects/objects.h"
-#include "../../Container/Container.h"
-
-/* local prototypes: */
-void	GetVectorFromControlInputsx( Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
-void	GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
-
-#endif  /* _GETVECTORFROMCONTROLINPUTSXX_H */
-

Copied: issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h (from rev 11526, issm/trunk-jpl/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h)
===================================================================
--- issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	                        (rev 0)
+++ issm/trunk/src/c/modules/GetVectorFromControlInputsx/GetVectorFromControlInputsx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,15 @@
+/*!\file:  GetVectorFromControlInputsx.h
+ */ 
+
+#ifndef _GETVECTORFROMCONTROLINPUTSXX_H
+#define _GETVECTORFROMCONTROLINPUTSXX_H
+
+#include "../../objects/objects.h"
+#include "../../Container/Container.h"
+
+/* local prototypes: */
+void	GetVectorFromControlInputsx( Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+void	GetVectorFromControlInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,const char* data="value");
+
+#endif  /* _GETVECTORFROMCONTROLINPUTSXX_H */
+

Modified: issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp
===================================================================
--- issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/GetVectorFromInputsx/GetVectorFromInputsx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -10,7 +10,6 @@
 
 void GetVectorFromInputsx( Vec* pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){
 
-
 	int i;
 	Vec vector=NULL;
 
@@ -40,7 +39,6 @@
 
 	/*Assign output pointers:*/
 	*pvector=vector;
-
 }
 
 void GetVectorFromInputsx( double** pvector, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters, int name, int type){

Modified: issm/trunk/src/c/modules/Gradjx/Gradjx.cpp
===================================================================
--- issm/trunk/src/c/modules/Gradjx/Gradjx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Gradjx/Gradjx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,30 +9,62 @@
 #include "../../toolkits/toolkits.h"
 #include "../../EnumDefinitions/EnumDefinitions.h"
 
-void Gradjx( Vec* pgradient, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,int control_type){
+void Gradjx(Vec* pgradient,double** pnorm_list, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters){
 
-	int  i;
-	int  dim;
-	int  numberofvertices;
-	Vec  gradient = NULL;
+	int     i,j,numberofvertices;
+	int     num_controls;
+	double  norm_inf;
+	double *norm_list       = NULL;
+	int    *control_type    = NULL;
+	Vec     gradient        = NULL;
+	Vec    *gradient_list   = NULL;
 	
 	/*retrieve some parameters: */
-	parameters->FindParam(&dim,MeshDimensionEnum);
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);   _assert_(num_controls);
+	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
 	numberofvertices=vertices->NumberOfVertices();
 
-	/*Allocate gradient: */
-	gradient=NewVec(numberofvertices);
+	/*Allocate gradient_list */
+	gradient_list = (Vec*)xmalloc(num_controls*sizeof(Vec));
+	norm_list = (double*)xmalloc(num_controls*sizeof(double));
+	for(i=0;i<num_controls;i++){
+		gradient_list[i]=NewVec(num_controls*numberofvertices);
+	}
+	gradient=NewVec(num_controls*numberofvertices);
 
-	/*Compute gradients: */
-	for (i=0;i<elements->Size();i++){
-		Element* element=(Element*)elements->GetObjectByOffset(i);
-		element->Gradj(gradient,control_type);
+	/*Compute all gradient_list*/
+	for(i=0;i<num_controls;i++){
+
+		for(j=0;j<elements->Size();j++){
+			Element* element=(Element*)elements->GetObjectByOffset(j);
+			element->Gradj(gradient_list[i],control_type[i],i);
+		}
+
+		VecAssemblyBegin(gradient_list[i]);
+		VecAssemblyEnd(gradient_list[i]);
+
+		VecNorm(gradient_list[i],NORM_INFINITY,&norm_list[i]);
 	}
 
-	/*Assemble vector: */
-	VecAssemblyBegin(gradient);
-	VecAssemblyEnd(gradient);
+	/*Add all gradient_list together*/
+	for(i=0;i<num_controls;i++){
+		VecAXPY(gradient,1.,gradient_list[i]);
+		VecFree(&gradient_list[i]);
+	}
 
-	/*Assign output pointers: */
-	*pgradient=gradient;
+	/*Check that gradient is clean*/
+	VecNorm(gradient,NORM_INFINITY,&norm_inf);
+	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
+	if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
+
+	/*Clean-up and assign output pointer*/
+	if(pnorm_list){
+		*pnorm_list=norm_list;
+	}
+	else{
+		xfree((void**)&norm_list);
+	}
+	if(pgradient)  *pgradient=gradient;
+	xfree((void**)&gradient_list);
+	xfree((void**)&control_type);
 }

Modified: issm/trunk/src/c/modules/Gradjx/Gradjx.h
===================================================================
--- issm/trunk/src/c/modules/Gradjx/Gradjx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Gradjx/Gradjx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,7 +9,6 @@
 #include "../../objects/objects.h"
 
 /* local prototypes: */
-void Gradjx(Vec* pgrad_g, Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,  Parameters* parameters, int control_type);
+void Gradjx(Vec* pgrad_g,double** pgrad_norm,Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials,Parameters* parameters);
 
 #endif  /* _GRADJX_H */
-

Modified: issm/trunk/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp
===================================================================
--- issm/trunk/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/InterpFromMesh2dx/InterpFromMesh2dxt.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -125,5 +125,7 @@
 		}
 	}
 	if (debug && my_thread==0) printf("\b\b\b\b\b\b\b%5.2lf %%\n",100.0);
+	
+	return NULL;
 
 }

Deleted: issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,67 +0,0 @@
-/*!\file KMLFileReadx.cpp
- */
-
-#include "./KMLFileReadx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../io/io.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-KML_Object* KMLFileReadx(FILE* fid){
-
-	char*   kstr;
-	KML_File*      kxml=NULL;
-	KML_File*      kdtd=NULL;
-	KML_File*      kfil=NULL;
-
-	clock_t clock0,clock1;
-	time_t  time0, time1;
-
-	clock0=clock();
-	time0 =time(NULL);
-	_printf_(true,"\nKMLFileReadx Module -- %s",ctime(&time0));
-
-/*  read kml file  */
-
-	while (kstr=KMLFileToken(fid,
-							 NULL,NULL)) {
-		if      (!strncmp(kstr,"<?xml"    ,5)) {
-			kxml=new KML_File();
-			KMLFileTagAttrib(kxml,
-							 kstr);
-		}
-		else if (!strncmp(kstr,"<!DOCTYPE",9)) {
-			kdtd=new KML_File();
-			KMLFileTagAttrib(kdtd,
-							 kstr);
-		}
-		else if (!strncmp(kstr,"<kml"     ,4)) {
-			kfil=new KML_File();
-			kfil->Read(fid,kstr);
-//			kfil->DeepEcho();
-		}
-
-//		_printf_(true,"%s\n",kstr);
-		xfree((void**)&kstr);
-	}
-
-	if (kxml) {
-		_printf_(true,"XML declaration:\n");
-		kxml->DeepEcho("  ");
-		delete kxml;
-	}
-	if (kdtd) {
-		_printf_(true,"DTD declaration (not yet implemented):\n");
-		kdtd->DeepEcho("  ");
-		delete kdtd;
-	}
-
-	clock1=clock();
-	time1 =time(NULL);
-	_printf_(true,"KMLFileReadx Module -- %f CPU seconds; %f elapsed seconds.\n\n",
-			 ((double)(clock1-clock0))/CLOCKS_PER_SEC,difftime(time1,time0));
-
-	return(kfil);
-}
-

Copied: issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp (from rev 11526, issm/trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.cpp)
===================================================================
--- issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp	                        (rev 0)
+++ issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,67 @@
+/*!\file KMLFileReadx.cpp
+ */
+
+#include "./KMLFileReadx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../io/io.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+KML_Object* KMLFileReadx(FILE* fid){
+
+	char*   kstr;
+	KML_File*      kxml=NULL;
+	KML_File*      kdtd=NULL;
+	KML_File*      kfil=NULL;
+
+	clock_t clock0,clock1;
+	time_t  time0, time1;
+
+	clock0=clock();
+	time0 =time(NULL);
+	_printf_(true,"\nKMLFileReadx Module -- %s",ctime(&time0));
+
+/*  read kml file  */
+
+	while (kstr=KMLFileToken(fid,
+							 NULL,NULL)) {
+		if      (!strncmp(kstr,"<?xml"    ,5)) {
+			kxml=new KML_File();
+			KMLFileTagAttrib(kxml,
+							 kstr);
+		}
+		else if (!strncmp(kstr,"<!DOCTYPE",9)) {
+			kdtd=new KML_File();
+			KMLFileTagAttrib(kdtd,
+							 kstr);
+		}
+		else if (!strncmp(kstr,"<kml"     ,4)) {
+			kfil=new KML_File();
+			kfil->Read(fid,kstr);
+//			kfil->DeepEcho();
+		}
+
+//		_printf_(true,"%s\n",kstr);
+		xfree((void**)&kstr);
+	}
+
+	if (kxml) {
+		_printf_(true,"XML declaration:\n");
+		kxml->DeepEcho("  ");
+		delete kxml;
+	}
+	if (kdtd) {
+		_printf_(true,"DTD declaration (not yet implemented):\n");
+		kdtd->DeepEcho("  ");
+		delete kdtd;
+	}
+
+	clock1=clock();
+	time1 =time(NULL);
+	_printf_(true,"KMLFileReadx Module -- %f CPU seconds; %f elapsed seconds.\n\n",
+			 ((double)(clock1-clock0))/CLOCKS_PER_SEC,difftime(time1,time0));
+
+	return(kfil);
+}
+

Deleted: issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +0,0 @@
-/*!\file:  KMLFileReadx.h
- * \brief header file for kml mesh writer routines.
- */ 
-
-#ifndef _KMLFILEREADX_H
-#define _KMLFILEREADX_H
-
-#include <float.h>    /*  DBL_MAX  */
-#include "../../Container/Container.h"
-#include "../../objects/objects.h"
-
-/* local prototypes: */
-KML_Object* KMLFileReadx(FILE* fid);
-
-#endif  /* _KMLFILEREADX_H */

Copied: issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h (from rev 11526, issm/trunk-jpl/src/c/modules/KMLFileReadx/KMLFileReadx.h)
===================================================================
--- issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h	                        (rev 0)
+++ issm/trunk/src/c/modules/KMLFileReadx/KMLFileReadx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,15 @@
+/*!\file:  KMLFileReadx.h
+ * \brief header file for kml mesh writer routines.
+ */ 
+
+#ifndef _KMLFILEREADX_H
+#define _KMLFILEREADX_H
+
+#include <float.h>    /*  DBL_MAX  */
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+KML_Object* KMLFileReadx(FILE* fid);
+
+#endif  /* _KMLFILEREADX_H */

Deleted: issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.cpp
===================================================================
--- issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,67 +0,0 @@
-/*!\file KMLFileReadx.cpp
- */
-
-#include "./KMLFileReadx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../io/io.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-KML_Object* KMLFileReadx(FILE* fid){
-
-	char*   kstr;
-	KML_File*      kxml=NULL;
-	KML_File*      kdtd=NULL;
-	KML_File*      kfil=NULL;
-
-	clock_t clock0,clock1;
-	time_t  time0, time1;
-
-	clock0=clock();
-	time0 =time(NULL);
-	_printf_(true,"\nKMLFileReadx Module -- %s",ctime(&time0));
-
-/*  read kml file  */
-
-	while (kstr=KMLFileToken(fid,
-							 NULL,NULL)) {
-		if      (!strncmp(kstr,"<?xml"    ,5)) {
-			kxml=new KML_File();
-			KMLFileTagAttrib(kxml,
-							 kstr);
-		}
-		else if (!strncmp(kstr,"<!DOCTYPE",9)) {
-			kdtd=new KML_File();
-			KMLFileTagAttrib(kdtd,
-							 kstr);
-		}
-		else if (!strncmp(kstr,"<kml"     ,4)) {
-			kfil=new KML_File();
-			kfil->Read(fid,kstr);
-//			kfil->DeepEcho();
-		}
-
-//		_printf_(true,"%s\n",kstr);
-		xfree((void**)&kstr);
-	}
-
-	if (kxml) {
-		_printf_(true,"XML declaration:\n");
-		kxml->DeepEcho("  ");
-		delete kxml;
-	}
-	if (kdtd) {
-		_printf_(true,"DTD declaration (not yet implemented):\n");
-		kdtd->DeepEcho("  ");
-		delete kdtd;
-	}
-
-	clock1=clock();
-	time1 =time(NULL);
-	_printf_(true,"KMLFileReadx Module -- %f CPU seconds; %f elapsed seconds.\n\n",
-			 ((double)(clock1-clock0))/CLOCKS_PER_SEC,difftime(time1,time0));
-
-	return(kfil);
-}
-

Deleted: issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.h
===================================================================
--- issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/KMLMeshWritex/KMLFileReadx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +0,0 @@
-/*!\file:  KMLFileReadx.h
- * \brief header file for kml mesh writer routines.
- */ 
-
-#ifndef _KMLFILEREADX_H
-#define _KMLFILEREADX_H
-
-#include <float.h>    /*  DBL_MAX  */
-#include "../../Container/Container.h"
-#include "../../objects/objects.h"
-
-/* local prototypes: */
-KML_Object* KMLFileReadx(FILE* fid);
-
-#endif  /* _KMLFILEREADX_H */

Modified: issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/Balancethickness/UpdateElementsBalancethickness.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -41,8 +41,6 @@
 	iomodel->FetchDataToInput(elements,VxEnum);
 	iomodel->FetchDataToInput(elements,VyEnum);
 	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAblationRateEnum);
 	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
 	iomodel->FetchDataToInput(elements,BalancethicknessThickeningRateEnum);
 

Modified: issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -39,6 +39,7 @@
 		parameters->AddObject(iomodel->CopyConstantObject(InversionNstepsEnum));
 		parameters->AddObject(iomodel->CopyConstantObject(InversionCostFunctionThresholdEnum));
 		parameters->AddObject(iomodel->CopyConstantObject(InversionGradientOnlyEnum));
+		parameters->AddObject(iomodel->CopyConstantObject(InversionIncompleteAdjointEnum));
 
 		/*What solution type?*/
 		if (solution_type==SteadystateSolutionEnum){

Modified: issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -39,6 +39,7 @@
 	parameters->AddObject(iomodel->CopyConstantObject(DiagnosticRestolEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(DiagnosticReltolEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(DiagnosticAbstolEnum));
+	parameters->AddObject(iomodel->CopyConstantObject(DiagnosticIsnewtonEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(DiagnosticMaxiterEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(SteadystateReltolEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(SteadystateMaxiterEnum));
@@ -77,12 +78,14 @@
 	parameters->AddObject(iomodel->CopyConstantObject(TransientIsprognosticEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(TransientIsthermalEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(TransientIsgroundinglineEnum));
+	parameters->AddObject(iomodel->CopyConstantObject(ThermalIsenthalpyEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(MaterialsRheologyLawEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(AutodiffIsautodiffEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(AutodiffForwardEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(AutodiffReverseEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(QmuIsdakotaEnum));
 	parameters->AddObject(iomodel->CopyConstantObject(InversionIscontrolEnum));
+	parameters->AddObject(iomodel->CopyConstantObject(InversionTaoEnum));
 
 	/*some parameters that did not come with the iomodel: */
 	parameters->AddObject(new IntParam(SolutionTypeEnum,solution_type));

Modified: issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/UpdateElementsDiagnosticHoriz.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -65,8 +65,6 @@
 		iomodel->FetchDataToInput(elements,MeshElementonbedEnum);
 		iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
 		iomodel->FetchDataToInput(elements,VzEnum);
-		iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationRateEnum);
-		iomodel->FetchDataToInput(elements,SurfaceforcingsAblationRateEnum);
 		iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
 		iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
 		iomodel->FetchDataToInput(elements,FlowequationBorderstokesEnum);

Modified: issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/UpdateElementsDiagnosticVert.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -47,8 +47,6 @@
 	iomodel->FetchDataToInput(elements,MeshElementonsurfaceEnum);
 	iomodel->FetchDataToInput(elements,MaskElementonwaterEnum);
 	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAblationRateEnum);
 	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
 	iomodel->FetchDataToInput(elements,VxEnum);
 	iomodel->FetchDataToInput(elements,VyEnum);

Modified: issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -54,9 +54,9 @@
 		/*keep only this partition's nodes:*/
 		if((iomodel->my_vertices[i])){
 
-			if ((int)spctemperature[2*i]){
+			if (!isnan(spctemperature[i])){
 
-				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,heatcapacity*(spctemperature[2*i+1]-referencetemperature),EnthalpyAnalysisEnum));
+				constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,heatcapacity*(spctemperature[i]-referencetemperature),EnthalpyAnalysisEnum));
 				count++;
 
 			}

Modified: issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/UpdateElementsEnthalpy.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -26,7 +26,7 @@
 	if(dim==2)return;
 
 	/*Fetch data needed: */
-	iomodel->FetchData(1,MeshElementsEnum);
+	iomodel->FetchData(4,MeshElementsEnum,TemperatureEnum,WaterfractionEnum,PressureEnum);
 
 	/*Update elements: */
 	int counter=0;
@@ -60,5 +60,5 @@
 	iomodel->FetchDataToInput(elements,VzEnum);
 	
 	/*Free data: */
-	iomodel->DeleteData(1,MeshElementsEnum);
+	iomodel->DeleteData(4,MeshElementsEnum,TemperatureEnum,WaterfractionEnum,PressureEnum);
 }

Modified: issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/Melting/UpdateElementsMelting.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -52,9 +52,6 @@
 	iomodel->FetchDataToInput(elements,FlowequationElementEquationEnum);
 	iomodel->FetchDataToInput(elements,MaterialsRheologyBEnum);
 	iomodel->FetchDataToInput(elements,MaterialsRheologyNEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAblationRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
 	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
 	iomodel->FetchDataToInput(elements,PressureEnum);
 	

Modified: issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -19,7 +19,7 @@
 void ModelProcessorx(Elements** pelements, Nodes** pnodes, Vertices** pvertices, Materials** pmaterials, Constraints** pconstraints, Loads** ploads, Parameters** pparameters, FILE* IOMODEL,const int solution_type,const int nummodels,const int* analysis_type_list){
 
 	int   i,analysis_type,dim,verbose;
-	bool  isthermal,isprognostic,isdiagnostic,isgroundingline;
+	bool  isthermal,isprognostic,isdiagnostic,isgroundingline,isenthalpy;
 	
 	/*output: */
 	Elements    *elements    = NULL;
@@ -38,6 +38,7 @@
 	iomodel->Constant(&dim,MeshDimensionEnum);
 	iomodel->Constant(&verbose,VerboseEnum);
 	iomodel->Constant(&isthermal,TransientIsthermalEnum);
+	iomodel->Constant(&isenthalpy,ThermalIsenthalpyEnum);
 	iomodel->Constant(&isprognostic,TransientIsprognosticEnum);
 	iomodel->Constant(&isdiagnostic,TransientIsdiagnosticEnum);
 	iomodel->Constant(&isgroundingline,TransientIsgroundinglineEnum);
@@ -51,8 +52,13 @@
 		/*Hack for trasient runs (to be improved)*/
 		if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && dim==2) continue;
 		if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && dim==2) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && dim==2) continue;
 		if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isthermal==false) continue;
 		if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isthermal==false) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isthermal==false) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==ThermalAnalysisEnum && isenthalpy==true) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==MeltingAnalysisEnum && isenthalpy==true) continue;
+		if(solution_type==TransientSolutionEnum && analysis_type==EnthalpyAnalysisEnum && isenthalpy==false) continue;
 		if(solution_type==TransientSolutionEnum && analysis_type==PrognosticAnalysisEnum && isprognostic==false && isgroundingline==false) continue;
 		if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticHorizAnalysisEnum && isdiagnostic==false) continue;
 		if(solution_type==TransientSolutionEnum && analysis_type==DiagnosticVertAnalysisEnum && isdiagnostic==false) continue;

Modified: issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp
===================================================================
--- issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/ModelProcessorx/Prognostic/UpdateElementsPrognostic.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -43,8 +43,7 @@
 	iomodel->FetchDataToInput(elements,BathymetryEnum);
 	iomodel->FetchDataToInput(elements,MaskElementonfloatingiceEnum);
 	iomodel->FetchDataToInput(elements,MaskElementonwaterEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAccumulationRateEnum);
-	iomodel->FetchDataToInput(elements,SurfaceforcingsAblationRateEnum);
+	iomodel->FetchDataToInput(elements,SurfaceforcingsPrecipitationEnum);
 	iomodel->FetchDataToInput(elements,SurfaceforcingsMassBalanceEnum);
 	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateEnum);
 	iomodel->FetchDataToInput(elements,BasalforcingsMeltingRateCorrectionEnum);

Modified: issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp
===================================================================
--- issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -35,4 +35,6 @@
 
 	/*Assign output pointers: */
 	*pflags=flags;
+
+	return 1;
 }

Modified: issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp
===================================================================
--- issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/PointCloudFindNeighborsx/PointCloudFindNeighborsxt.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -73,4 +73,6 @@
 
 	/*Free ressources:*/
 	xfree((void**)&already);
+	
+	return NULL;
 }

Deleted: issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,21 +0,0 @@
-/*!\file PositiveDegreeDayx
- * \brief: create system matrices (stiffness matrix, loads vector)
- */
-
-#include "./PositiveDegreeDayx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../io/io.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-void PositiveDegreeDayx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
-	
-	Element* element = NULL;
-
-	for(int i=0;i<elements->Size();i++){
-		element=(Element*)elements->GetObjectByOffset(i);
-		element->PositiveDegreeDay();
-	}
-
-}

Copied: issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp (from rev 11526, issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp)
===================================================================
--- issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	                        (rev 0)
+++ issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,21 @@
+/*!\file PositiveDegreeDayx
+ * \brief: create system matrices (stiffness matrix, loads vector)
+ */
+
+#include "./PositiveDegreeDayx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../io/io.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void PositiveDegreeDayx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters){
+	
+	Element* element = NULL;
+
+	for(int i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->PositiveDegreeDay();
+	}
+
+}

Deleted: issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,14 +0,0 @@
-/*!\file:  PositiveDegreeDayx.h
- * \brief header file for degree of freedoms distribution routines.
- */ 
-
-#ifndef _POSITIVEDEGREEDAYX_H
-#define _POSITIVEDEGREEDAYX_H
-
-#include "../../Container/Container.h"
-#include "../../objects/objects.h"
-
-/* local prototypes: */
-void PositiveDegreeDayx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
-
-#endif  /* _POSITIVEDEGREEDAYX_H*/

Copied: issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h (from rev 11526, issm/trunk-jpl/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h)
===================================================================
--- issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h	                        (rev 0)
+++ issm/trunk/src/c/modules/PositiveDegreeDayx/PositiveDegreeDayx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,14 @@
+/*!\file:  PositiveDegreeDayx.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _POSITIVEDEGREEDAYX_H
+#define _POSITIVEDEGREEDAYX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void PositiveDegreeDayx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters);
+
+#endif  /* _POSITIVEDEGREEDAYX_H*/

Modified: issm/trunk/src/c/modules/Scotchx/Scotchx.cpp
===================================================================
--- issm/trunk/src/c/modules/Scotchx/Scotchx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Scotchx/Scotchx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -338,5 +338,7 @@
 #endif /* COMMON_PTHREAD */
   return (0);
 
-#endif //#ifdef _HAVE_SCOTCH_ 
+#else //#ifdef _HAVE_SCOTCH_ 
+  return(0);
+#endif
 }

Deleted: issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,40 +0,0 @@
-/*!\file SetControlInputsFromVectorx
- * \brief retrieve vector from inputs in elements
- */
-
-#include "./SetControlInputsFromVectorx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vector){
-
-	int  num_controls;
-	int *control_type = NULL;
-
-	/*Retrieve some parameters*/
-	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
-	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
-
-	for(int i=0;i<num_controls;i++){
-		for(int j=0;j<elements->Size();j++){
-			Element* element=(Element*)elements->GetObjectByOffset(j);
-			element->SetControlInputsFromVector(vector,control_type[i],i);
-		}
-	}
-
-	xfree((void**)&control_type);
-}
-
-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector){
-	
-	double* serial_vector=NULL;
-
-	VecToMPISerial(&serial_vector,vector);
-
-	SetControlInputsFromVectorx(elements,nodes, vertices, loads, materials, parameters,serial_vector);
-
-	/*Free ressources:*/
-	xfree((void**)&serial_vector);
-}

Copied: issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp (from rev 11526, issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp)
===================================================================
--- issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	                        (rev 0)
+++ issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,40 @@
+/*!\file SetControlInputsFromVectorx
+ * \brief retrieve vector from inputs in elements
+ */
+
+#include "./SetControlInputsFromVectorx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vector){
+
+	int  num_controls;
+	int *control_type = NULL;
+
+	/*Retrieve some parameters*/
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+	parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
+
+	for(int i=0;i<num_controls;i++){
+		for(int j=0;j<elements->Size();j++){
+			Element* element=(Element*)elements->GetObjectByOffset(j);
+			element->SetControlInputsFromVector(vector,control_type[i],i);
+		}
+	}
+
+	xfree((void**)&control_type);
+}
+
+void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,Vec vector){
+	
+	double* serial_vector=NULL;
+
+	VecToMPISerial(&serial_vector,vector);
+
+	SetControlInputsFromVectorx(elements,nodes, vertices, loads, materials, parameters,serial_vector);
+
+	/*Free ressources:*/
+	xfree((void**)&serial_vector);
+}

Deleted: issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,14 +0,0 @@
-/*!\file:  SetControlInputsFromVectorx.h
- */ 
-
-#ifndef _SETCONTROLINPUTSXFROMVECTOR_H
-#define _SETCONTROLINPUTSXFROMVECTOR_H
-
-#include "../../objects/objects.h"
-#include "../../Container/Container.h"
-
-/* local prototypes: */
-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec vector);
-void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector);
-
-#endif 

Copied: issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h (from rev 11526, issm/trunk-jpl/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h)
===================================================================
--- issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	                        (rev 0)
+++ issm/trunk/src/c/modules/SetControlInputsFromVectorx/SetControlInputsFromVectorx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,14 @@
+/*!\file:  SetControlInputsFromVectorx.h
+ */ 
+
+#ifndef _SETCONTROLINPUTSXFROMVECTOR_H
+#define _SETCONTROLINPUTSXFROMVECTOR_H
+
+#include "../../objects/objects.h"
+#include "../../Container/Container.h"
+
+/* local prototypes: */
+void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,Vec vector);
+void SetControlInputsFromVectorx(Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads, Materials* materials,  Parameters* parameters,double* vector);
+
+#endif 

Modified: issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp
===================================================================
--- issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Shp2Kmlx/Shp2Kmlx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,7 +23,9 @@
 	return(Shp2Kmlx(filshp,filkml,
 					sgn,cm,sp));
 
-	#endif //ifdef _HAVE_SHAPELIB_
+	#else //ifdef _HAVE_SHAPELIB_
+	return 0;
+	#endif
 }
 
 int Shp2Kmlx(char* filshp,char* filkml,
@@ -606,6 +608,8 @@
 
 	return(iret);
 
-	#endif //ifdef _HAVE_SHAPELIB_
+	#else //ifdef _HAVE_SHAPELIB_
+	return 0;
+	#endif
 }
 

Deleted: issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp
===================================================================
--- issm/trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,56 +0,0 @@
-/*!\file SmearFunctionx
- * \brief: create 
- */
-
-#include "./SmearFunctionx.h"
-#include "../../shared/shared.h"
-#include "../../include/include.h"
-#include "../../io/io.h"
-#include "../../toolkits/toolkits.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-
-void SmearFunctionx(Vec* psmearedvector,double (*WeightFunction)(double distance,double radius), int SmearedFieldEnum, double radius,Elements* elements,Nodes* nodes, Parameters* parameters){
-	
-	Element *element = NULL;
-	Vec x=NULL;
-	Vec y=NULL;
-	Vec z=NULL;
-	Vec smearedvector=NULL;
-	int i;
-
-	double* x_serial=NULL;
-	double* y_serial=NULL;
-	double* z_serial=NULL;
-
-	/*retrive parameters: */
-	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
-
-	/*allocate: */
-	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
-	smearedvector=NewVec(gsize);
-	
-	x=NewVec(gsize);
-	y=NewVec(gsize);
-	z=NewVec(gsize);
-
-	for(i=0;i<nodes->Size();i++){
-
-	}
-
-
-
-	/*Fill smearedvector vector: */
-	for (i=0;i<elements->Size();i++){
-		element=(Element*)elements->GetObjectByOffset(i);
-		element->SmearFunction(smearedvector,WeightFunction,SmearedFieldEnum,radius);
-	}
-
-
-	VecAssemblyBegin(smearedvector);
-	VecAssemblyEnd(smearedvector);
-	
-	/*Assign output pointers: */
-	*psmearedvector=smearedvector;
-
-}
-

Copied: issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp (from rev 11526, issm/trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.cpp)
===================================================================
--- issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp	                        (rev 0)
+++ issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,56 @@
+/*!\file SmearFunctionx
+ * \brief: create 
+ */
+
+#include "./SmearFunctionx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../io/io.h"
+#include "../../toolkits/toolkits.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+void SmearFunctionx(Vec* psmearedvector,double (*WeightFunction)(double distance,double radius), int SmearedFieldEnum, double radius,Elements* elements,Nodes* nodes, Parameters* parameters){
+	
+	Element *element = NULL;
+	Vec x=NULL;
+	Vec y=NULL;
+	Vec z=NULL;
+	Vec smearedvector=NULL;
+	int i;
+
+	double* x_serial=NULL;
+	double* y_serial=NULL;
+	double* z_serial=NULL;
+
+	/*retrive parameters: */
+	parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+
+	/*allocate: */
+	gsize=nodes->NumberOfDofs(configuration_type,GsetEnum);
+	smearedvector=NewVec(gsize);
+	
+	x=NewVec(gsize);
+	y=NewVec(gsize);
+	z=NewVec(gsize);
+
+	for(i=0;i<nodes->Size();i++){
+
+	}
+
+
+
+	/*Fill smearedvector vector: */
+	for (i=0;i<elements->Size();i++){
+		element=(Element*)elements->GetObjectByOffset(i);
+		element->SmearFunction(smearedvector,WeightFunction,SmearedFieldEnum,radius);
+	}
+
+
+	VecAssemblyBegin(smearedvector);
+	VecAssemblyEnd(smearedvector);
+	
+	/*Assign output pointers: */
+	*psmearedvector=smearedvector;
+
+}
+

Deleted: issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h
===================================================================
--- issm/trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,15 +0,0 @@
-/*!\file:  SystemMatricesx.h
- * \brief header file for degree of freedoms distribution routines.
- */ 
-
-#ifndef _SYSTEMMATRICESX_H
-#define _SYSTEMMATRICESX_H
-
-#include "../../Container/Container.h"
-#include "../../objects/objects.h"
-
-/* local prototypes: */
-void SystemMatricesx(Mat* pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
-			bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true);
-
-#endif  /* _SYSTEMMATRICESX_H */

Copied: issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h (from rev 11526, issm/trunk-jpl/src/c/modules/SmearFunctionx/SmearFunctionx.h)
===================================================================
--- issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h	                        (rev 0)
+++ issm/trunk/src/c/modules/SmearFunctionx/SmearFunctionx.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,15 @@
+/*!\file:  SystemMatricesx.h
+ * \brief header file for degree of freedoms distribution routines.
+ */ 
+
+#ifndef _SYSTEMMATRICESX_H
+#define _SYSTEMMATRICESX_H
+
+#include "../../Container/Container.h"
+#include "../../objects/objects.h"
+
+/* local prototypes: */
+void SystemMatricesx(Mat* pKff, Mat* pKfs, Vec* ppf, Vec* pdf, double* pkmax,Elements* elements,Nodes* nodes, Vertices* vertices,Loads* loads,Materials* materials, Parameters* parameters,
+			bool kflag=true,bool pflag=true,bool penalty_kflag=true,bool penalty_pflag=true);
+
+#endif  /* _SYSTEMMATRICESX_H */

Modified: issm/trunk/src/c/modules/Solverx/Solverx.cpp
===================================================================
--- issm/trunk/src/c/modules/Solverx/Solverx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/Solverx/Solverx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -107,20 +107,34 @@
 	#endif
 	#endif
 	/*}}}*/
+	/*Check the solver is available: {{{1*/
+	if(solver_type==MUMPSPACKAGE_LU || solver_type==MUMPSPACKAGE_CHOL){
+	#if _PETSC_MAJOR_ >=3
+		#ifndef _HAVE_MUMPS_
+		_error_("requested MUMPS solver, which was not compiled into ISSM!\n");
+		#endif
+
+	#endif
+	}
+	/*}}}*/
 	/*Prepare solver:{{{1*/
 	KSPCreate(MPI_COMM_WORLD,&ksp);
 	KSPSetOperators(ksp,Kff,Kff,DIFFERENT_NONZERO_PATTERN);
 	KSPSetFromOptions(ksp);
 
-	#if defined(_SERIAL_) && _PETSC_VERSION_==3
+	#if defined(_SERIAL_) && _PETSC_MAJOR_==3
 	/*Specific solver?: */
 	KSPGetPC(ksp,&pc);
 	if (solver_type==MUMPSPACKAGE_LU){
+		#if _PETSC_MINOR_==1
 		PCFactorSetMatSolverPackage(pc,MAT_SOLVER_MUMPS);
+		#else
+		PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS);
+		#endif
 	}
 	#endif
 
-	#if defined(_PARALLEL_) && _PETSC_VERSION_==3
+	#if defined(_PARALLEL_) && _PETSC_MAJOR_==3
 	/*Stokes: */
 	if (solver_type==StokesSolverEnum){
 		/*Make indices out of doftypes: */
@@ -129,8 +143,13 @@
 
 		/*Set field splits: */
 		KSPGetPC(ksp,&pc);
+		#if _PETSC_MINOR_==1
 		PCFieldSplitSetIS(pc,isv);
 		PCFieldSplitSetIS(pc,isp);
+		#else
+		PCFieldSplitSetIS(pc,PETSC_NULL,isv);
+		PCFieldSplitSetIS(pc,PETSC_NULL,isp);
+		#endif
 
 	}
 	#endif

Modified: issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
===================================================================
--- issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -13,431 +13,448 @@
 
 int  StringToEnumx(const char* name){
 
-	if (strcmp(name,"AutodiffForward")==0) return AutodiffForwardEnum;
-	else if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
-	else if (strcmp(name,"AutodiffReverse")==0) return AutodiffReverseEnum;
-	else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
-	else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
-	else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
-	else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
-	else if (strcmp(name,"BasalforcingsMeltingRateCorrection")==0) return BasalforcingsMeltingRateCorrectionEnum;
-	else if (strcmp(name,"BasalforcingsMeltingRate")==0) return BasalforcingsMeltingRateEnum;
-	else if (strcmp(name,"Bathymetry")==0) return BathymetryEnum;
-	else if (strcmp(name,"Bed")==0) return BedEnum;
-	else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
-	else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
-	else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum;
-	else if (strcmp(name,"DiagnosticAbstol")==0) return DiagnosticAbstolEnum;
-	else if (strcmp(name,"DiagnosticIcefront")==0) return DiagnosticIcefrontEnum;
-	else if (strcmp(name,"DiagnosticMaxiter")==0) return DiagnosticMaxiterEnum;
-	else if (strcmp(name,"DiagnosticNumRequestedOutputs")==0) return DiagnosticNumRequestedOutputsEnum;
-	else if (strcmp(name,"DiagnosticPenaltyFactor")==0) return DiagnosticPenaltyFactorEnum;
-	else if (strcmp(name,"DiagnosticReferential")==0) return DiagnosticReferentialEnum;
-	else if (strcmp(name,"DiagnosticReltol")==0) return DiagnosticReltolEnum;
-	else if (strcmp(name,"DiagnosticRequestedOutputs")==0) return DiagnosticRequestedOutputsEnum;
-	else if (strcmp(name,"DiagnosticRestol")==0) return DiagnosticRestolEnum;
-	else if (strcmp(name,"DiagnosticRiftPenaltyLock")==0) return DiagnosticRiftPenaltyLockEnum;
-	else if (strcmp(name,"DiagnosticRiftPenaltyThreshold")==0) return DiagnosticRiftPenaltyThresholdEnum;
-	else if (strcmp(name,"DiagnosticShelfDampening")==0) return DiagnosticShelfDampeningEnum;
-	else if (strcmp(name,"DiagnosticSpcvx")==0) return DiagnosticSpcvxEnum;
-	else if (strcmp(name,"DiagnosticSpcvy")==0) return DiagnosticSpcvyEnum;
-	else if (strcmp(name,"DiagnosticSpcvz")==0) return DiagnosticSpcvzEnum;
-	else if (strcmp(name,"DiagnosticStokesreconditioning")==0) return DiagnosticStokesreconditioningEnum;
-	else if (strcmp(name,"DiagnosticVertexPairing")==0) return DiagnosticVertexPairingEnum;
-	else if (strcmp(name,"DiagnosticViscosityOvershoot")==0) return DiagnosticViscosityOvershootEnum;
-	else if (strcmp(name,"FlowequationBordermacayeal")==0) return FlowequationBordermacayealEnum;
-	else if (strcmp(name,"FlowequationBorderpattyn")==0) return FlowequationBorderpattynEnum;
-	else if (strcmp(name,"FlowequationBorderstokes")==0) return FlowequationBorderstokesEnum;
-	else if (strcmp(name,"FlowequationElementEquation")==0) return FlowequationElementEquationEnum;
-	else if (strcmp(name,"FlowequationIshutter")==0) return FlowequationIshutterEnum;
-	else if (strcmp(name,"FlowequationIsmacayealpattyn")==0) return FlowequationIsmacayealpattynEnum;
-	else if (strcmp(name,"FlowequationIsstokes")==0) return FlowequationIsstokesEnum;
-	else if (strcmp(name,"FlowequationVertexEquation")==0) return FlowequationVertexEquationEnum;
-	else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
-	else if (strcmp(name,"FrictionP")==0) return FrictionPEnum;
-	else if (strcmp(name,"FrictionQ")==0) return FrictionQEnum;
-	else if (strcmp(name,"GeometryHydrostaticRatio")==0) return GeometryHydrostaticRatioEnum;
-	else if (strcmp(name,"HydrologyCR")==0) return HydrologyCREnum;
-	else if (strcmp(name,"HydrologyKn")==0) return HydrologyKnEnum;
-	else if (strcmp(name,"HydrologyN")==0) return HydrologyNEnum;
-	else if (strcmp(name,"HydrologyP")==0) return HydrologyPEnum;
-	else if (strcmp(name,"HydrologyQ")==0) return HydrologyQEnum;
-	else if (strcmp(name,"HydrologySpcwatercolumn")==0) return HydrologySpcwatercolumnEnum;
-	else if (strcmp(name,"HydrologyStabilization")==0) return HydrologyStabilizationEnum;
-	else if (strcmp(name,"InversionControlParameters")==0) return InversionControlParametersEnum;
-	else if (strcmp(name,"InversionCostFunction")==0) return InversionCostFunctionEnum;
-	else if (strcmp(name,"InversionCostFunctionThreshold")==0) return InversionCostFunctionThresholdEnum;
-	else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
-	else if (strcmp(name,"InversionCostFunctions")==0) return InversionCostFunctionsEnum;
-	else if (strcmp(name,"InversionGradientOnly")==0) return InversionGradientOnlyEnum;
-	else if (strcmp(name,"InversionGradientScaling")==0) return InversionGradientScalingEnum;
-	else if (strcmp(name,"InversionIscontrol")==0) return InversionIscontrolEnum;
-	else if (strcmp(name,"InversionMaxParameters")==0) return InversionMaxParametersEnum;
-	else if (strcmp(name,"InversionMaxiterPerStep")==0) return InversionMaxiterPerStepEnum;
-	else if (strcmp(name,"InversionMinParameters")==0) return InversionMinParametersEnum;
-	else if (strcmp(name,"InversionNsteps")==0) return InversionNstepsEnum;
-	else if (strcmp(name,"InversionNumControlParameters")==0) return InversionNumControlParametersEnum;
-	else if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
-	else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
-	else if (strcmp(name,"InversionThicknessObs")==0) return InversionThicknessObsEnum;
-	else if (strcmp(name,"InversionVelObs")==0) return InversionVelObsEnum;
-	else if (strcmp(name,"InversionVxObs")==0) return InversionVxObsEnum;
-	else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
-	else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
-	else if (strcmp(name,"MaskElementonfloatingice")==0) return MaskElementonfloatingiceEnum;
-	else if (strcmp(name,"MaskElementongroundedice")==0) return MaskElementongroundediceEnum;
-	else if (strcmp(name,"MaskElementonwater")==0) return MaskElementonwaterEnum;
-	else if (strcmp(name,"MaskVertexonfloatingice")==0) return MaskVertexonfloatingiceEnum;
-	else if (strcmp(name,"MaskVertexongroundedice")==0) return MaskVertexongroundediceEnum;
-	else if (strcmp(name,"MaskVertexonwater")==0) return MaskVertexonwaterEnum;
-	else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
-	else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
-	else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
-	else if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
-	else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
-	else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum;
-	else if (strcmp(name,"MaterialsRheologyBbar")==0) return MaterialsRheologyBbarEnum;
-	else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
-	else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
-	else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
-	else if (strcmp(name,"MaterialsRhoWater")==0) return MaterialsRhoWaterEnum;
-	else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
-	else if (strcmp(name,"MaterialsThermalExchangeVelocity")==0) return MaterialsThermalExchangeVelocityEnum;
-	else if (strcmp(name,"MaterialsThermalconductivity")==0) return MaterialsThermalconductivityEnum;
-	else if (strcmp(name,"MeshAverageVertexConnectivity")==0) return MeshAverageVertexConnectivityEnum;
-	else if (strcmp(name,"MeshDimension")==0) return MeshDimensionEnum;
-	else if (strcmp(name,"MeshEdges")==0) return MeshEdgesEnum;
-	else if (strcmp(name,"MeshElementconnectivity")==0) return MeshElementconnectivityEnum;
-	else if (strcmp(name,"MeshElementonbed")==0) return MeshElementonbedEnum;
-	else if (strcmp(name,"MeshElementonsurface")==0) return MeshElementonsurfaceEnum;
-	else if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum;
-	else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
-	else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum;
-	else if (strcmp(name,"MeshNumberofedges")==0) return MeshNumberofedgesEnum;
-	else if (strcmp(name,"MeshNumberofelements2d")==0) return MeshNumberofelements2dEnum;
-	else if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum;
-	else if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum;
-	else if (strcmp(name,"MeshNumberofvertices2d")==0) return MeshNumberofvertices2dEnum;
-	else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum;
-	else if (strcmp(name,"MeshUpperelements")==0) return MeshUpperelementsEnum;
-	else if (strcmp(name,"MeshVertexonbed")==0) return MeshVertexonbedEnum;
-	else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
-	else if (strcmp(name,"MeshX")==0) return MeshXEnum;
-	else if (strcmp(name,"MeshY")==0) return MeshYEnum;
-	else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
-	else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
-	else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
-	else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum;
-	else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
-	else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
-	else if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum;
-	else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum;
-	else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum;
-	else if (strcmp(name,"QmuMassFluxSegments")==0) return QmuMassFluxSegmentsEnum;
-	else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
-	else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
-	else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
-	else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
-	else if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
-	else if (strcmp(name,"RiftsNumrifts")==0) return RiftsNumriftsEnum;
-	else if (strcmp(name,"RiftsRiftstruct")==0) return RiftsRiftstructEnum;
-	else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
-	else if (strcmp(name,"SettingsLowmem")==0) return SettingsLowmemEnum;
-	else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
-	else if (strcmp(name,"SettingsResultsAsPatches")==0) return SettingsResultsAsPatchesEnum;
-	else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
-	else if (strcmp(name,"SteadystateMaxiter")==0) return SteadystateMaxiterEnum;
-	else if (strcmp(name,"SteadystateNumRequestedOutputs")==0) return SteadystateNumRequestedOutputsEnum;
-	else if (strcmp(name,"SteadystateReltol")==0) return SteadystateReltolEnum;
-	else if (strcmp(name,"SteadystateRequestedOutputs")==0) return SteadystateRequestedOutputsEnum;
-	else if (strcmp(name,"Surface")==0) return SurfaceEnum;
-	else if (strcmp(name,"SurfaceforcingsAblationRate")==0) return SurfaceforcingsAblationRateEnum;
-	else if (strcmp(name,"SurfaceforcingsAccumulationRate")==0) return SurfaceforcingsAccumulationRateEnum;
-	else if (strcmp(name,"SurfaceforcingsMassBalance")==0) return SurfaceforcingsMassBalanceEnum;
-	else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
-	else if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
-	else if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
-	else if (strcmp(name,"ThermalPenaltyThreshold")==0) return ThermalPenaltyThresholdEnum;
-	else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
-	else if (strcmp(name,"ThermalStabilization")==0) return ThermalStabilizationEnum;
-	else if (strcmp(name,"Thickness")==0) return ThicknessEnum;
-	else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
-	else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
-	else if (strcmp(name,"TimesteppingTimeAdapt")==0) return TimesteppingTimeAdaptEnum;
-	else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
-	else if (strcmp(name,"TransientIsdiagnostic")==0) return TransientIsdiagnosticEnum;
-	else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
-	else if (strcmp(name,"TransientIsprognostic")==0) return TransientIsprognosticEnum;
-	else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum;
-	else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
-	else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
-	else if (strcmp(name,"SolutionType")==0) return SolutionTypeEnum;
-	else if (strcmp(name,"AnalysisType")==0) return AnalysisTypeEnum;
-	else if (strcmp(name,"ConfigurationType")==0) return ConfigurationTypeEnum;
-	else if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
-	else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
-	else if (strcmp(name,"AdjointSolution")==0) return AdjointSolutionEnum;
-	else if (strcmp(name,"AnalysisCounter")==0) return AnalysisCounterEnum;
-	else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum;
-	else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum;
-	else if (strcmp(name,"BedSlopeAnalysis")==0) return BedSlopeAnalysisEnum;
-	else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
-	else if (strcmp(name,"BedSlopeXAnalysis")==0) return BedSlopeXAnalysisEnum;
-	else if (strcmp(name,"BedSlopeYAnalysis")==0) return BedSlopeYAnalysisEnum;
-	else if (strcmp(name,"DiagnosticHorizAnalysis")==0) return DiagnosticHorizAnalysisEnum;
-	else if (strcmp(name,"DiagnosticHutterAnalysis")==0) return DiagnosticHutterAnalysisEnum;
-	else if (strcmp(name,"DiagnosticSolution")==0) return DiagnosticSolutionEnum;
-	else if (strcmp(name,"DiagnosticVertAnalysis")==0) return DiagnosticVertAnalysisEnum;
-	else if (strcmp(name,"EnthalpyAnalysis")==0) return EnthalpyAnalysisEnum;
-	else if (strcmp(name,"EnthalpySolution")==0) return EnthalpySolutionEnum;
-	else if (strcmp(name,"FlaimAnalysis")==0) return FlaimAnalysisEnum;
-	else if (strcmp(name,"FlaimSolution")==0) return FlaimSolutionEnum;
-	else if (strcmp(name,"HydrologyAnalysis")==0) return HydrologyAnalysisEnum;
-	else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
-	else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
-	else if (strcmp(name,"NoneAnalysis")==0) return NoneAnalysisEnum;
-	else if (strcmp(name,"PrognosticAnalysis")==0) return PrognosticAnalysisEnum;
-	else if (strcmp(name,"PrognosticSolution")==0) return PrognosticSolutionEnum;
-	else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
-	else if (strcmp(name,"SurfaceSlopeAnalysis")==0) return SurfaceSlopeAnalysisEnum;
-	else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
-	else if (strcmp(name,"SurfaceSlopeXAnalysis")==0) return SurfaceSlopeXAnalysisEnum;
-	else if (strcmp(name,"SurfaceSlopeYAnalysis")==0) return SurfaceSlopeYAnalysisEnum;
-	else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
-	else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
-	else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;
-	else if (strcmp(name,"Approximation")==0) return ApproximationEnum;
-	else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum;
-	else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum;
-	else if (strcmp(name,"MacAyealPattynApproximation")==0) return MacAyealPattynApproximationEnum;
-	else if (strcmp(name,"MacAyealStokesApproximation")==0) return MacAyealStokesApproximationEnum;
-	else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
-	else if (strcmp(name,"PattynApproximation")==0) return PattynApproximationEnum;
-	else if (strcmp(name,"PattynStokesApproximation")==0) return PattynStokesApproximationEnum;
-	else if (strcmp(name,"StokesApproximation")==0) return StokesApproximationEnum;
-	else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
-	else if (strcmp(name,"Loads")==0) return LoadsEnum;
-	else if (strcmp(name,"Materials")==0) return MaterialsEnum;
-	else if (strcmp(name,"Nodes")==0) return NodesEnum;
-	else if (strcmp(name,"Parameters")==0) return ParametersEnum;
-	else if (strcmp(name,"Vertices")==0) return VerticesEnum;
-	else if (strcmp(name,"Results")==0) return ResultsEnum;
-	else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
-	else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
-	else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
-	else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
-	else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
-	else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
-	else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
-	else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
-	else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
-	else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
-	else if (strcmp(name,"Element")==0) return ElementEnum;
-	else if (strcmp(name,"ElementResult")==0) return ElementResultEnum;
-	else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
-	else if (strcmp(name,"FileParam")==0) return FileParamEnum;
-	else if (strcmp(name,"Hook")==0) return HookEnum;
-	else if (strcmp(name,"Icefront")==0) return IcefrontEnum;
-	else if (strcmp(name,"Input")==0) return InputEnum;
-	else if (strcmp(name,"IntInput")==0) return IntInputEnum;
-	else if (strcmp(name,"IntParam")==0) return IntParamEnum;
-	else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
-	else if (strcmp(name,"MacAyeal2dIceFront")==0) return MacAyeal2dIceFrontEnum;
-	else if (strcmp(name,"MacAyeal3dIceFront")==0) return MacAyeal3dIceFrontEnum;
-	else if (strcmp(name,"Matice")==0) return MaticeEnum;
-	else if (strcmp(name,"Matpar")==0) return MatparEnum;
-	else if (strcmp(name,"Node")==0) return NodeEnum;
-	else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
-	else if (strcmp(name,"Param")==0) return ParamEnum;
-	else if (strcmp(name,"PattynIceFront")==0) return PattynIceFrontEnum;
-	else if (strcmp(name,"Pengrid")==0) return PengridEnum;
-	else if (strcmp(name,"Penpair")==0) return PenpairEnum;
-	else if (strcmp(name,"Penta")==0) return PentaEnum;
-	else if (strcmp(name,"PentaVertexInput")==0) return PentaVertexInputEnum;
-	else if (strcmp(name,"PetscMatParam")==0) return PetscMatParamEnum;
-	else if (strcmp(name,"PetscVecParam")==0) return PetscVecParamEnum;
-	else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
-	else if (strcmp(name,"Segment")==0) return SegmentEnum;
-	else if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
-	else if (strcmp(name,"SpcDynamic")==0) return SpcDynamicEnum;
-	else if (strcmp(name,"SpcStatic")==0) return SpcStaticEnum;
-	else if (strcmp(name,"SpcTransient")==0) return SpcTransientEnum;
-	else if (strcmp(name,"StokesIceFront")==0) return StokesIceFrontEnum;
-	else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
-	else if (strcmp(name,"StringParam")==0) return StringParamEnum;
-	else if (strcmp(name,"Tria")==0) return TriaEnum;
-	else if (strcmp(name,"TriaVertexInput")==0) return TriaVertexInputEnum;
-	else if (strcmp(name,"Vertex")==0) return VertexEnum;
-	else if (strcmp(name,"Air")==0) return AirEnum;
-	else if (strcmp(name,"Ice")==0) return IceEnum;
-	else if (strcmp(name,"Melange")==0) return MelangeEnum;
-	else if (strcmp(name,"Water")==0) return WaterEnum;
-	else if (strcmp(name,"Closed")==0) return ClosedEnum;
-	else if (strcmp(name,"Free")==0) return FreeEnum;
-	else if (strcmp(name,"Open")==0) return OpenEnum;
-	else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
-	else if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
-	else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
-	else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
-	else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
-	else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
-	else if (strcmp(name,"Boundary")==0) return BoundaryEnum;
-	else if (strcmp(name,"Constant")==0) return ConstantEnum;
-	else if (strcmp(name,"Converged")==0) return ConvergedEnum;
-	else if (strcmp(name,"ExtToIu")==0) return ExtToIuEnum;
-	else if (strcmp(name,"Fill")==0) return FillEnum;
-	else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
-	else if (strcmp(name,"Friction")==0) return FrictionEnum;
-	else if (strcmp(name,"GroundinglineMeltingRate")==0) return GroundinglineMeltingRateEnum;
-	else if (strcmp(name,"Internal")==0) return InternalEnum;
-	else if (strcmp(name,"IuToExt")==0) return IuToExtEnum;
-	else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
-	else if (strcmp(name,"MaxPenetration")==0) return MaxPenetrationEnum;
-	else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
-	else if (strcmp(name,"Misfit")==0) return MisfitEnum;
-	else if (strcmp(name,"NumberNodeToElementConnectivity")==0) return NumberNodeToElementConnectivityEnum;
-	else if (strcmp(name,"Pressure")==0) return PressureEnum;
-	else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
-	else if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
-	else if (strcmp(name,"QmuVx")==0) return QmuVxEnum;
-	else if (strcmp(name,"QmuVy")==0) return QmuVyEnum;
-	else if (strcmp(name,"QmuVz")==0) return QmuVzEnum;
-	else if (strcmp(name,"QmuThickness")==0) return QmuThicknessEnum;
-	else if (strcmp(name,"QmuBed")==0) return QmuBedEnum;
-	else if (strcmp(name,"QmuSurface")==0) return QmuSurfaceEnum;
-	else if (strcmp(name,"QmuMelting")==0) return QmuMeltingEnum;
-	else if (strcmp(name,"ResetPenalties")==0) return ResetPenaltiesEnum;
-	else if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
-	else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum;
-	else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum;
-	else if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum;
-	else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;
-	else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
-	else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum;
-	else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum;
-	else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
-	else if (strcmp(name,"Temperature")==0) return TemperatureEnum;
-	else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum;
-	else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
-	else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum;
-	else if (strcmp(name,"Type")==0) return TypeEnum;
-	else if (strcmp(name,"Vel")==0) return VelEnum;
-	else if (strcmp(name,"Velocity")==0) return VelocityEnum;
-	else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
-	else if (strcmp(name,"Vx")==0) return VxEnum;
-	else if (strcmp(name,"VxPicard")==0) return VxPicardEnum;
-	else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
-	else if (strcmp(name,"Vy")==0) return VyEnum;
-	else if (strcmp(name,"VyPicard")==0) return VyPicardEnum;
-	else if (strcmp(name,"Vz")==0) return VzEnum;
-	else if (strcmp(name,"VzMacAyeal")==0) return VzMacAyealEnum;
-	else if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
-	else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
-	else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
-	else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
-	else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
-	else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
-	else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
-	else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
-	else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
-	else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
-	else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
-	else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
-	else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
-	else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
-	else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
-	else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
-	else if (strcmp(name,"Watercolumn")==0) return WatercolumnEnum;
-	else if (strcmp(name,"BasalFriction")==0) return BasalFrictionEnum;
-	else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
-	else if (strcmp(name,"QmuTemperature")==0) return QmuTemperatureEnum;
-	else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
-	else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
-	else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
-	else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
-	else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
-	else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
-	else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
-	else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
-	else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
-	else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
-	else if (strcmp(name,"P0")==0) return P0Enum;
-	else if (strcmp(name,"P1")==0) return P1Enum;
-	else if (strcmp(name,"P1DG")==0) return P1DGEnum;
-	else if (strcmp(name,"BoolElementResult")==0) return BoolElementResultEnum;
-	else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
-	else if (strcmp(name,"DoubleElementResult")==0) return DoubleElementResultEnum;
-	else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
-	else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
-	else if (strcmp(name,"DoubleVecExternalResult")==0) return DoubleVecExternalResultEnum;
-	else if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
-	else if (strcmp(name,"J")==0) return JEnum;
-	else if (strcmp(name,"Patch")==0) return PatchEnum;
-	else if (strcmp(name,"PatchNodes")==0) return PatchNodesEnum;
-	else if (strcmp(name,"PatchVertices")==0) return PatchVerticesEnum;
-	else if (strcmp(name,"PentaVertexElementResult")==0) return PentaVertexElementResultEnum;
-	else if (strcmp(name,"PetscVecExternalResult")==0) return PetscVecExternalResultEnum;
-	else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
-	else if (strcmp(name,"Time")==0) return TimeEnum;
-	else if (strcmp(name,"TriaVertexElementResult")==0) return TriaVertexElementResultEnum;
-	else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
-	else if (strcmp(name,"MinVel")==0) return MinVelEnum;
-	else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
-	else if (strcmp(name,"MinVx")==0) return MinVxEnum;
-	else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
-	else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
-	else if (strcmp(name,"MinVy")==0) return MinVyEnum;
-	else if (strcmp(name,"MaxVy")==0) return MaxVyEnum;
-	else if (strcmp(name,"MaxAbsVy")==0) return MaxAbsVyEnum;
-	else if (strcmp(name,"MinVz")==0) return MinVzEnum;
-	else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
-	else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
-	else if (strcmp(name,"Relative")==0) return RelativeEnum;
-	else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
-	else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
-	else if (strcmp(name,"AgressiveMigration")==0) return AgressiveMigrationEnum;
-	else if (strcmp(name,"None")==0) return NoneEnum;
-	else if (strcmp(name,"SoftMigration")==0) return SoftMigrationEnum;
-	else if (strcmp(name,"StokesSolver")==0) return StokesSolverEnum;
-	else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
-	else if (strcmp(name,"Colinear")==0) return ColinearEnum;
-	else if (strcmp(name,"ControlSteady")==0) return ControlSteadyEnum;
-	else if (strcmp(name,"Fset")==0) return FsetEnum;
-	else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
-	else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
-	else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
-	else if (strcmp(name,"Gradient")==0) return GradientEnum;
-	else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
-	else if (strcmp(name,"Gset")==0) return GsetEnum;
-	else if (strcmp(name,"Index")==0) return IndexEnum;
-	else if (strcmp(name,"Indexed")==0) return IndexedEnum;
-	else if (strcmp(name,"Intersect")==0) return IntersectEnum;
-	else if (strcmp(name,"Nodal")==0) return NodalEnum;
-	else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
-	else if (strcmp(name,"OutputFilePointer")==0) return OutputFilePointerEnum;
-	else if (strcmp(name,"PetscOptionsAnalyses")==0) return PetscOptionsAnalysesEnum;
-	else if (strcmp(name,"PetscOptionsStrings")==0) return PetscOptionsStringsEnum;
-	else if (strcmp(name,"QmuErrName")==0) return QmuErrNameEnum;
-	else if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
-	else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
-	else if (strcmp(name,"Regular")==0) return RegularEnum;
-	else if (strcmp(name,"Scaled")==0) return ScaledEnum;
-	else if (strcmp(name,"Separate")==0) return SeparateEnum;
-	else if (strcmp(name,"Sset")==0) return SsetEnum;
-	else if (strcmp(name,"Verbose")==0) return VerboseEnum;
-	else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
-	else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
-	else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
-	else if (strcmp(name,"XY")==0) return XYEnum;
-	else if (strcmp(name,"XYZP")==0) return XYZPEnum;
-	else if (strcmp(name,"Option")==0) return OptionEnum;
-	else if (strcmp(name,"OptionCell")==0) return OptionCellEnum;
-	else if (strcmp(name,"OptionChar")==0) return OptionCharEnum;
-	else if (strcmp(name,"OptionStruct")==0) return OptionStructEnum;
-	else if (strcmp(name,"OptionDouble")==0) return OptionDoubleEnum;
-	else if (strcmp(name,"OptionLogical")==0) return OptionLogicalEnum;
-	else if (strcmp(name,"Paterson")==0) return PatersonEnum;
-	else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum;
-	else _error_("Enum %s not found",name);
+   int  stage=1;
 
+   if(stage==1){
+	      if (strcmp(name,"AutodiffForward")==0) return AutodiffForwardEnum;
+	      else if (strcmp(name,"AutodiffIsautodiff")==0) return AutodiffIsautodiffEnum;
+	      else if (strcmp(name,"AutodiffReverse")==0) return AutodiffReverseEnum;
+	      else if (strcmp(name,"BalancethicknessSpcthickness")==0) return BalancethicknessSpcthicknessEnum;
+	      else if (strcmp(name,"BalancethicknessStabilization")==0) return BalancethicknessStabilizationEnum;
+	      else if (strcmp(name,"BalancethicknessThickeningRate")==0) return BalancethicknessThickeningRateEnum;
+	      else if (strcmp(name,"BasalforcingsGeothermalflux")==0) return BasalforcingsGeothermalfluxEnum;
+	      else if (strcmp(name,"BasalforcingsMeltingRateCorrection")==0) return BasalforcingsMeltingRateCorrectionEnum;
+	      else if (strcmp(name,"BasalforcingsMeltingRate")==0) return BasalforcingsMeltingRateEnum;
+	      else if (strcmp(name,"Bathymetry")==0) return BathymetryEnum;
+	      else if (strcmp(name,"Bed")==0) return BedEnum;
+	      else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum;
+	      else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum;
+	      else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum;
+	      else if (strcmp(name,"DiagnosticAbstol")==0) return DiagnosticAbstolEnum;
+	      else if (strcmp(name,"DiagnosticIcefront")==0) return DiagnosticIcefrontEnum;
+	      else if (strcmp(name,"DiagnosticIsnewton")==0) return DiagnosticIsnewtonEnum;
+	      else if (strcmp(name,"DiagnosticMaxiter")==0) return DiagnosticMaxiterEnum;
+	      else if (strcmp(name,"DiagnosticNumRequestedOutputs")==0) return DiagnosticNumRequestedOutputsEnum;
+	      else if (strcmp(name,"DiagnosticPenaltyFactor")==0) return DiagnosticPenaltyFactorEnum;
+	      else if (strcmp(name,"DiagnosticReferential")==0) return DiagnosticReferentialEnum;
+	      else if (strcmp(name,"DiagnosticReltol")==0) return DiagnosticReltolEnum;
+	      else if (strcmp(name,"DiagnosticRequestedOutputs")==0) return DiagnosticRequestedOutputsEnum;
+	      else if (strcmp(name,"DiagnosticRestol")==0) return DiagnosticRestolEnum;
+	      else if (strcmp(name,"DiagnosticRiftPenaltyLock")==0) return DiagnosticRiftPenaltyLockEnum;
+	      else if (strcmp(name,"DiagnosticRiftPenaltyThreshold")==0) return DiagnosticRiftPenaltyThresholdEnum;
+	      else if (strcmp(name,"DiagnosticShelfDampening")==0) return DiagnosticShelfDampeningEnum;
+	      else if (strcmp(name,"DiagnosticSpcvx")==0) return DiagnosticSpcvxEnum;
+	      else if (strcmp(name,"DiagnosticSpcvy")==0) return DiagnosticSpcvyEnum;
+	      else if (strcmp(name,"DiagnosticSpcvz")==0) return DiagnosticSpcvzEnum;
+	      else if (strcmp(name,"DiagnosticStokesreconditioning")==0) return DiagnosticStokesreconditioningEnum;
+	      else if (strcmp(name,"DiagnosticVertexPairing")==0) return DiagnosticVertexPairingEnum;
+	      else if (strcmp(name,"DiagnosticViscosityOvershoot")==0) return DiagnosticViscosityOvershootEnum;
+	      else if (strcmp(name,"FlowequationBordermacayeal")==0) return FlowequationBordermacayealEnum;
+	      else if (strcmp(name,"FlowequationBorderpattyn")==0) return FlowequationBorderpattynEnum;
+	      else if (strcmp(name,"FlowequationBorderstokes")==0) return FlowequationBorderstokesEnum;
+	      else if (strcmp(name,"FlowequationElementEquation")==0) return FlowequationElementEquationEnum;
+	      else if (strcmp(name,"FlowequationIshutter")==0) return FlowequationIshutterEnum;
+	      else if (strcmp(name,"FlowequationIsmacayealpattyn")==0) return FlowequationIsmacayealpattynEnum;
+	      else if (strcmp(name,"FlowequationIsstokes")==0) return FlowequationIsstokesEnum;
+	      else if (strcmp(name,"FlowequationVertexEquation")==0) return FlowequationVertexEquationEnum;
+	      else if (strcmp(name,"FrictionCoefficient")==0) return FrictionCoefficientEnum;
+	      else if (strcmp(name,"FrictionP")==0) return FrictionPEnum;
+	      else if (strcmp(name,"FrictionQ")==0) return FrictionQEnum;
+	      else if (strcmp(name,"GeometryHydrostaticRatio")==0) return GeometryHydrostaticRatioEnum;
+	      else if (strcmp(name,"HydrologyCR")==0) return HydrologyCREnum;
+	      else if (strcmp(name,"HydrologyKn")==0) return HydrologyKnEnum;
+	      else if (strcmp(name,"HydrologyN")==0) return HydrologyNEnum;
+	      else if (strcmp(name,"HydrologyP")==0) return HydrologyPEnum;
+	      else if (strcmp(name,"HydrologyQ")==0) return HydrologyQEnum;
+	      else if (strcmp(name,"HydrologySpcwatercolumn")==0) return HydrologySpcwatercolumnEnum;
+	      else if (strcmp(name,"HydrologyStabilization")==0) return HydrologyStabilizationEnum;
+	      else if (strcmp(name,"InversionControlParameters")==0) return InversionControlParametersEnum;
+	      else if (strcmp(name,"InversionCostFunction")==0) return InversionCostFunctionEnum;
+	      else if (strcmp(name,"InversionCostFunctionThreshold")==0) return InversionCostFunctionThresholdEnum;
+	      else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
+	      else if (strcmp(name,"InversionCostFunctions")==0) return InversionCostFunctionsEnum;
+	      else if (strcmp(name,"InversionGradientOnly")==0) return InversionGradientOnlyEnum;
+	      else if (strcmp(name,"InversionGradientScaling")==0) return InversionGradientScalingEnum;
+	      else if (strcmp(name,"InversionIscontrol")==0) return InversionIscontrolEnum;
+	      else if (strcmp(name,"InversionTao")==0) return InversionTaoEnum;
+	      else if (strcmp(name,"InversionIncompleteAdjoint")==0) return InversionIncompleteAdjointEnum;
+	      else if (strcmp(name,"InversionMaxParameters")==0) return InversionMaxParametersEnum;
+	      else if (strcmp(name,"InversionMaxiterPerStep")==0) return InversionMaxiterPerStepEnum;
+	      else if (strcmp(name,"InversionMinParameters")==0) return InversionMinParametersEnum;
+	      else if (strcmp(name,"InversionNsteps")==0) return InversionNstepsEnum;
+	      else if (strcmp(name,"InversionNumControlParameters")==0) return InversionNumControlParametersEnum;
+	      else if (strcmp(name,"InversionNumCostFunctions")==0) return InversionNumCostFunctionsEnum;
+	      else if (strcmp(name,"InversionStepThreshold")==0) return InversionStepThresholdEnum;
+	      else if (strcmp(name,"InversionThicknessObs")==0) return InversionThicknessObsEnum;
+	      else if (strcmp(name,"InversionVelObs")==0) return InversionVelObsEnum;
+	      else if (strcmp(name,"InversionVxObs")==0) return InversionVxObsEnum;
+	      else if (strcmp(name,"InversionVyObs")==0) return InversionVyObsEnum;
+	      else if (strcmp(name,"InversionVzObs")==0) return InversionVzObsEnum;
+	      else if (strcmp(name,"MaskElementonfloatingice")==0) return MaskElementonfloatingiceEnum;
+	      else if (strcmp(name,"MaskElementongroundedice")==0) return MaskElementongroundediceEnum;
+	      else if (strcmp(name,"MaskElementonwater")==0) return MaskElementonwaterEnum;
+	      else if (strcmp(name,"MaskVertexonfloatingice")==0) return MaskVertexonfloatingiceEnum;
+	      else if (strcmp(name,"MaskVertexongroundedice")==0) return MaskVertexongroundediceEnum;
+	      else if (strcmp(name,"MaskVertexonwater")==0) return MaskVertexonwaterEnum;
+	      else if (strcmp(name,"MaterialsBeta")==0) return MaterialsBetaEnum;
+	      else if (strcmp(name,"MaterialsHeatcapacity")==0) return MaterialsHeatcapacityEnum;
+	      else if (strcmp(name,"MaterialsLatentheat")==0) return MaterialsLatentheatEnum;
+	      else if (strcmp(name,"MaterialsMeltingpoint")==0) return MaterialsMeltingpointEnum;
+	      else if (strcmp(name,"MaterialsMixedLayerCapacity")==0) return MaterialsMixedLayerCapacityEnum;
+	      else if (strcmp(name,"MaterialsRheologyB")==0) return MaterialsRheologyBEnum;
+	      else if (strcmp(name,"MaterialsRheologyBbar")==0) return MaterialsRheologyBbarEnum;
+	      else if (strcmp(name,"MaterialsRheologyLaw")==0) return MaterialsRheologyLawEnum;
+	      else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
+	      else if (strcmp(name,"MaterialsRhoIce")==0) return MaterialsRhoIceEnum;
+	      else if (strcmp(name,"MaterialsRhoWater")==0) return MaterialsRhoWaterEnum;
+	      else if (strcmp(name,"MaterialsMuWater")==0) return MaterialsMuWaterEnum;
+	      else if (strcmp(name,"MaterialsThermalExchangeVelocity")==0) return MaterialsThermalExchangeVelocityEnum;
+	      else if (strcmp(name,"MaterialsThermalconductivity")==0) return MaterialsThermalconductivityEnum;
+	      else if (strcmp(name,"MeshAverageVertexConnectivity")==0) return MeshAverageVertexConnectivityEnum;
+	      else if (strcmp(name,"MeshDimension")==0) return MeshDimensionEnum;
+	      else if (strcmp(name,"MeshEdges")==0) return MeshEdgesEnum;
+	      else if (strcmp(name,"MeshElementconnectivity")==0) return MeshElementconnectivityEnum;
+	      else if (strcmp(name,"MeshElementonbed")==0) return MeshElementonbedEnum;
+	      else if (strcmp(name,"MeshElementonsurface")==0) return MeshElementonsurfaceEnum;
+	      else if (strcmp(name,"MeshElements2d")==0) return MeshElements2dEnum;
+	      else if (strcmp(name,"MeshElements")==0) return MeshElementsEnum;
+	      else if (strcmp(name,"MeshLowerelements")==0) return MeshLowerelementsEnum;
+	      else if (strcmp(name,"MeshNumberofedges")==0) return MeshNumberofedgesEnum;
+	      else if (strcmp(name,"MeshNumberofelements2d")==0) return MeshNumberofelements2dEnum;
+	      else if (strcmp(name,"MeshNumberofelements")==0) return MeshNumberofelementsEnum;
+	      else if (strcmp(name,"MeshNumberoflayers")==0) return MeshNumberoflayersEnum;
+	      else if (strcmp(name,"MeshNumberofvertices2d")==0) return MeshNumberofvertices2dEnum;
+	      else if (strcmp(name,"MeshNumberofvertices")==0) return MeshNumberofverticesEnum;
+	      else if (strcmp(name,"MeshUpperelements")==0) return MeshUpperelementsEnum;
+	      else if (strcmp(name,"MeshVertexonbed")==0) return MeshVertexonbedEnum;
+	      else if (strcmp(name,"MeshVertexonsurface")==0) return MeshVertexonsurfaceEnum;
+	      else if (strcmp(name,"MeshX")==0) return MeshXEnum;
+	      else if (strcmp(name,"MeshY")==0) return MeshYEnum;
+	      else if (strcmp(name,"MeshZ")==0) return MeshZEnum;
+	      else if (strcmp(name,"MiscellaneousName")==0) return MiscellaneousNameEnum;
+	      else if (strcmp(name,"PrognosticHydrostaticAdjustment")==0) return PrognosticHydrostaticAdjustmentEnum;
+	      else if (strcmp(name,"PrognosticMinThickness")==0) return PrognosticMinThicknessEnum;
+	      else if (strcmp(name,"PrognosticPenaltyFactor")==0) return PrognosticPenaltyFactorEnum;
+	      else if (strcmp(name,"PrognosticSpcthickness")==0) return PrognosticSpcthicknessEnum;
+         else stage=2;
+   }
+   if(stage==2){
+	      if (strcmp(name,"PrognosticStabilization")==0) return PrognosticStabilizationEnum;
+	      else if (strcmp(name,"PrognosticVertexPairing")==0) return PrognosticVertexPairingEnum;
+	      else if (strcmp(name,"QmuIsdakota")==0) return QmuIsdakotaEnum;
+	      else if (strcmp(name,"QmuMassFluxSegments")==0) return QmuMassFluxSegmentsEnum;
+	      else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
+	      else if (strcmp(name,"QmuNumberofresponses")==0) return QmuNumberofresponsesEnum;
+	      else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
+	      else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
+	      else if (strcmp(name,"QmuVariabledescriptors")==0) return QmuVariabledescriptorsEnum;
+	      else if (strcmp(name,"RiftsNumrifts")==0) return RiftsNumriftsEnum;
+	      else if (strcmp(name,"RiftsRiftstruct")==0) return RiftsRiftstructEnum;
+	      else if (strcmp(name,"SettingsIoGather")==0) return SettingsIoGatherEnum;
+	      else if (strcmp(name,"SettingsLowmem")==0) return SettingsLowmemEnum;
+	      else if (strcmp(name,"SettingsOutputFrequency")==0) return SettingsOutputFrequencyEnum;
+	      else if (strcmp(name,"SettingsResultsAsPatches")==0) return SettingsResultsAsPatchesEnum;
+	      else if (strcmp(name,"SettingsWaitonlock")==0) return SettingsWaitonlockEnum;
+	      else if (strcmp(name,"SteadystateMaxiter")==0) return SteadystateMaxiterEnum;
+	      else if (strcmp(name,"SteadystateNumRequestedOutputs")==0) return SteadystateNumRequestedOutputsEnum;
+	      else if (strcmp(name,"SteadystateReltol")==0) return SteadystateReltolEnum;
+	      else if (strcmp(name,"SteadystateRequestedOutputs")==0) return SteadystateRequestedOutputsEnum;
+	      else if (strcmp(name,"Surface")==0) return SurfaceEnum;
+	      else if (strcmp(name,"SurfaceforcingsPrecipitation")==0) return SurfaceforcingsPrecipitationEnum;
+	      else if (strcmp(name,"SurfaceforcingsMassBalance")==0) return SurfaceforcingsMassBalanceEnum;
+	      else if (strcmp(name,"ThermalMaxiter")==0) return ThermalMaxiterEnum;
+	      else if (strcmp(name,"ThermalPenaltyFactor")==0) return ThermalPenaltyFactorEnum;
+	      else if (strcmp(name,"ThermalPenaltyLock")==0) return ThermalPenaltyLockEnum;
+	      else if (strcmp(name,"ThermalPenaltyThreshold")==0) return ThermalPenaltyThresholdEnum;
+	      else if (strcmp(name,"ThermalSpctemperature")==0) return ThermalSpctemperatureEnum;
+	      else if (strcmp(name,"ThermalStabilization")==0) return ThermalStabilizationEnum;
+	      else if (strcmp(name,"ThermalIsenthalpy")==0) return ThermalIsenthalpyEnum;
+	      else if (strcmp(name,"Thickness")==0) return ThicknessEnum;
+	      else if (strcmp(name,"TimesteppingCflCoefficient")==0) return TimesteppingCflCoefficientEnum;
+	      else if (strcmp(name,"TimesteppingFinalTime")==0) return TimesteppingFinalTimeEnum;
+	      else if (strcmp(name,"TimesteppingTimeAdapt")==0) return TimesteppingTimeAdaptEnum;
+	      else if (strcmp(name,"TimesteppingTimeStep")==0) return TimesteppingTimeStepEnum;
+	      else if (strcmp(name,"TransientIsdiagnostic")==0) return TransientIsdiagnosticEnum;
+	      else if (strcmp(name,"TransientIsgroundingline")==0) return TransientIsgroundinglineEnum;
+	      else if (strcmp(name,"TransientIsprognostic")==0) return TransientIsprognosticEnum;
+	      else if (strcmp(name,"TransientIsthermal")==0) return TransientIsthermalEnum;
+	      else if (strcmp(name,"TransientNumRequestedOutputs")==0) return TransientNumRequestedOutputsEnum;
+	      else if (strcmp(name,"TransientRequestedOutputs")==0) return TransientRequestedOutputsEnum;
+	      else if (strcmp(name,"SolutionType")==0) return SolutionTypeEnum;
+	      else if (strcmp(name,"AnalysisType")==0) return AnalysisTypeEnum;
+	      else if (strcmp(name,"ConfigurationType")==0) return ConfigurationTypeEnum;
+	      else if (strcmp(name,"AdjointBalancethicknessAnalysis")==0) return AdjointBalancethicknessAnalysisEnum;
+	      else if (strcmp(name,"AdjointHorizAnalysis")==0) return AdjointHorizAnalysisEnum;
+	      else if (strcmp(name,"AdjointSolution")==0) return AdjointSolutionEnum;
+	      else if (strcmp(name,"AnalysisCounter")==0) return AnalysisCounterEnum;
+	      else if (strcmp(name,"BalancethicknessAnalysis")==0) return BalancethicknessAnalysisEnum;
+	      else if (strcmp(name,"BalancethicknessSolution")==0) return BalancethicknessSolutionEnum;
+	      else if (strcmp(name,"BedSlopeAnalysis")==0) return BedSlopeAnalysisEnum;
+	      else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
+	      else if (strcmp(name,"BedSlopeXAnalysis")==0) return BedSlopeXAnalysisEnum;
+	      else if (strcmp(name,"BedSlopeYAnalysis")==0) return BedSlopeYAnalysisEnum;
+	      else if (strcmp(name,"DiagnosticHorizAnalysis")==0) return DiagnosticHorizAnalysisEnum;
+	      else if (strcmp(name,"DiagnosticHutterAnalysis")==0) return DiagnosticHutterAnalysisEnum;
+	      else if (strcmp(name,"DiagnosticSolution")==0) return DiagnosticSolutionEnum;
+	      else if (strcmp(name,"DiagnosticVertAnalysis")==0) return DiagnosticVertAnalysisEnum;
+	      else if (strcmp(name,"EnthalpyAnalysis")==0) return EnthalpyAnalysisEnum;
+	      else if (strcmp(name,"EnthalpySolution")==0) return EnthalpySolutionEnum;
+	      else if (strcmp(name,"FlaimAnalysis")==0) return FlaimAnalysisEnum;
+	      else if (strcmp(name,"FlaimSolution")==0) return FlaimSolutionEnum;
+	      else if (strcmp(name,"HydrologyAnalysis")==0) return HydrologyAnalysisEnum;
+	      else if (strcmp(name,"HydrologySolution")==0) return HydrologySolutionEnum;
+	      else if (strcmp(name,"MeltingAnalysis")==0) return MeltingAnalysisEnum;
+	      else if (strcmp(name,"NoneAnalysis")==0) return NoneAnalysisEnum;
+	      else if (strcmp(name,"PrognosticAnalysis")==0) return PrognosticAnalysisEnum;
+	      else if (strcmp(name,"PrognosticSolution")==0) return PrognosticSolutionEnum;
+	      else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
+	      else if (strcmp(name,"SurfaceSlopeAnalysis")==0) return SurfaceSlopeAnalysisEnum;
+	      else if (strcmp(name,"SurfaceSlopeSolution")==0) return SurfaceSlopeSolutionEnum;
+	      else if (strcmp(name,"SurfaceSlopeXAnalysis")==0) return SurfaceSlopeXAnalysisEnum;
+	      else if (strcmp(name,"SurfaceSlopeYAnalysis")==0) return SurfaceSlopeYAnalysisEnum;
+	      else if (strcmp(name,"ThermalAnalysis")==0) return ThermalAnalysisEnum;
+	      else if (strcmp(name,"ThermalSolution")==0) return ThermalSolutionEnum;
+	      else if (strcmp(name,"TransientSolution")==0) return TransientSolutionEnum;
+	      else if (strcmp(name,"Approximation")==0) return ApproximationEnum;
+	      else if (strcmp(name,"HutterApproximation")==0) return HutterApproximationEnum;
+	      else if (strcmp(name,"MacAyealApproximation")==0) return MacAyealApproximationEnum;
+	      else if (strcmp(name,"MacAyealPattynApproximation")==0) return MacAyealPattynApproximationEnum;
+	      else if (strcmp(name,"MacAyealStokesApproximation")==0) return MacAyealStokesApproximationEnum;
+	      else if (strcmp(name,"NoneApproximation")==0) return NoneApproximationEnum;
+	      else if (strcmp(name,"PattynApproximation")==0) return PattynApproximationEnum;
+	      else if (strcmp(name,"PattynStokesApproximation")==0) return PattynStokesApproximationEnum;
+	      else if (strcmp(name,"StokesApproximation")==0) return StokesApproximationEnum;
+	      else if (strcmp(name,"Constraints")==0) return ConstraintsEnum;
+	      else if (strcmp(name,"Loads")==0) return LoadsEnum;
+	      else if (strcmp(name,"Materials")==0) return MaterialsEnum;
+	      else if (strcmp(name,"Nodes")==0) return NodesEnum;
+	      else if (strcmp(name,"Parameters")==0) return ParametersEnum;
+	      else if (strcmp(name,"Vertices")==0) return VerticesEnum;
+	      else if (strcmp(name,"Results")==0) return ResultsEnum;
+	      else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
+	      else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
+	      else if (strcmp(name,"ControlInput")==0) return ControlInputEnum;
+	      else if (strcmp(name,"DatasetInput")==0) return DatasetInputEnum;
+	      else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum;
+	      else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum;
+	      else if (strcmp(name,"DoubleMatArrayParam")==0) return DoubleMatArrayParamEnum;
+	      else if (strcmp(name,"DoubleMatParam")==0) return DoubleMatParamEnum;
+	      else if (strcmp(name,"DoubleParam")==0) return DoubleParamEnum;
+	      else if (strcmp(name,"DoubleVecParam")==0) return DoubleVecParamEnum;
+	      else if (strcmp(name,"Element")==0) return ElementEnum;
+	      else if (strcmp(name,"ElementResult")==0) return ElementResultEnum;
+	      else if (strcmp(name,"ExternalResult")==0) return ExternalResultEnum;
+	      else if (strcmp(name,"FileParam")==0) return FileParamEnum;
+	      else if (strcmp(name,"Hook")==0) return HookEnum;
+	      else if (strcmp(name,"Icefront")==0) return IcefrontEnum;
+	      else if (strcmp(name,"Input")==0) return InputEnum;
+	      else if (strcmp(name,"IntInput")==0) return IntInputEnum;
+	      else if (strcmp(name,"IntParam")==0) return IntParamEnum;
+	      else if (strcmp(name,"IntVecParam")==0) return IntVecParamEnum;
+	      else if (strcmp(name,"MacAyeal2dIceFront")==0) return MacAyeal2dIceFrontEnum;
+	      else if (strcmp(name,"MacAyeal3dIceFront")==0) return MacAyeal3dIceFrontEnum;
+	      else if (strcmp(name,"Matice")==0) return MaticeEnum;
+	      else if (strcmp(name,"Matpar")==0) return MatparEnum;
+	      else if (strcmp(name,"Node")==0) return NodeEnum;
+	      else if (strcmp(name,"Numericalflux")==0) return NumericalfluxEnum;
+	      else if (strcmp(name,"Param")==0) return ParamEnum;
+	      else if (strcmp(name,"PattynIceFront")==0) return PattynIceFrontEnum;
+         else stage=3;
+   }
+   if(stage==3){
+	      if (strcmp(name,"Pengrid")==0) return PengridEnum;
+	      else if (strcmp(name,"Penpair")==0) return PenpairEnum;
+	      else if (strcmp(name,"Penta")==0) return PentaEnum;
+	      else if (strcmp(name,"PentaP1Input")==0) return PentaP1InputEnum;
+	      else if (strcmp(name,"PetscMatParam")==0) return PetscMatParamEnum;
+	      else if (strcmp(name,"PetscVecParam")==0) return PetscVecParamEnum;
+	      else if (strcmp(name,"Riftfront")==0) return RiftfrontEnum;
+	      else if (strcmp(name,"Segment")==0) return SegmentEnum;
+	      else if (strcmp(name,"SegmentRiftfront")==0) return SegmentRiftfrontEnum;
+	      else if (strcmp(name,"SpcDynamic")==0) return SpcDynamicEnum;
+	      else if (strcmp(name,"SpcStatic")==0) return SpcStaticEnum;
+	      else if (strcmp(name,"SpcTransient")==0) return SpcTransientEnum;
+	      else if (strcmp(name,"StokesIceFront")==0) return StokesIceFrontEnum;
+	      else if (strcmp(name,"StringArrayParam")==0) return StringArrayParamEnum;
+	      else if (strcmp(name,"StringParam")==0) return StringParamEnum;
+	      else if (strcmp(name,"Tria")==0) return TriaEnum;
+	      else if (strcmp(name,"TriaP1Input")==0) return TriaP1InputEnum;
+	      else if (strcmp(name,"Vertex")==0) return VertexEnum;
+	      else if (strcmp(name,"Air")==0) return AirEnum;
+	      else if (strcmp(name,"Ice")==0) return IceEnum;
+	      else if (strcmp(name,"Melange")==0) return MelangeEnum;
+	      else if (strcmp(name,"Water")==0) return WaterEnum;
+	      else if (strcmp(name,"Closed")==0) return ClosedEnum;
+	      else if (strcmp(name,"Free")==0) return FreeEnum;
+	      else if (strcmp(name,"Open")==0) return OpenEnum;
+	      else if (strcmp(name,"Adjointp")==0) return AdjointpEnum;
+	      else if (strcmp(name,"Adjointx")==0) return AdjointxEnum;
+	      else if (strcmp(name,"Adjointy")==0) return AdjointyEnum;
+	      else if (strcmp(name,"Adjointz")==0) return AdjointzEnum;
+	      else if (strcmp(name,"BedSlopeX")==0) return BedSlopeXEnum;
+	      else if (strcmp(name,"BedSlopeY")==0) return BedSlopeYEnum;
+	      else if (strcmp(name,"Boundary")==0) return BoundaryEnum;
+	      else if (strcmp(name,"Constant")==0) return ConstantEnum;
+	      else if (strcmp(name,"Converged")==0) return ConvergedEnum;
+	      else if (strcmp(name,"ExtToIu")==0) return ExtToIuEnum;
+	      else if (strcmp(name,"Fill")==0) return FillEnum;
+	      else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
+	      else if (strcmp(name,"Friction")==0) return FrictionEnum;
+	      else if (strcmp(name,"GroundinglineMeltingRate")==0) return GroundinglineMeltingRateEnum;
+	      else if (strcmp(name,"Internal")==0) return InternalEnum;
+	      else if (strcmp(name,"IuToExt")==0) return IuToExtEnum;
+	      else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
+	      else if (strcmp(name,"MaxPenetration")==0) return MaxPenetrationEnum;
+	      else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
+	      else if (strcmp(name,"Misfit")==0) return MisfitEnum;
+	      else if (strcmp(name,"NumberNodeToElementConnectivity")==0) return NumberNodeToElementConnectivityEnum;
+	      else if (strcmp(name,"Pressure")==0) return PressureEnum;
+	      else if (strcmp(name,"PressurePicard")==0) return PressurePicardEnum;
+	      else if (strcmp(name,"QmuPressure")==0) return QmuPressureEnum;
+	      else if (strcmp(name,"QmuVx")==0) return QmuVxEnum;
+	      else if (strcmp(name,"QmuVy")==0) return QmuVyEnum;
+	      else if (strcmp(name,"QmuVz")==0) return QmuVzEnum;
+	      else if (strcmp(name,"QmuThickness")==0) return QmuThicknessEnum;
+	      else if (strcmp(name,"QmuBed")==0) return QmuBedEnum;
+	      else if (strcmp(name,"QmuSurface")==0) return QmuSurfaceEnum;
+	      else if (strcmp(name,"QmuMelting")==0) return QmuMeltingEnum;
+	      else if (strcmp(name,"ResetPenalties")==0) return ResetPenaltiesEnum;
+	      else if (strcmp(name,"SegmentOnIceShelf")==0) return SegmentOnIceShelfEnum;
+	      else if (strcmp(name,"SurfaceAbsVelMisfit")==0) return SurfaceAbsVelMisfitEnum;
+	      else if (strcmp(name,"SurfaceArea")==0) return SurfaceAreaEnum;
+	      else if (strcmp(name,"SurfaceAverageVelMisfit")==0) return SurfaceAverageVelMisfitEnum;
+	      else if (strcmp(name,"SurfaceLogVelMisfit")==0) return SurfaceLogVelMisfitEnum;
+	      else if (strcmp(name,"SurfaceLogVxVyMisfit")==0) return SurfaceLogVxVyMisfitEnum;
+	      else if (strcmp(name,"SurfaceRelVelMisfit")==0) return SurfaceRelVelMisfitEnum;
+	      else if (strcmp(name,"SurfaceSlopeX")==0) return SurfaceSlopeXEnum;
+	      else if (strcmp(name,"SurfaceSlopeY")==0) return SurfaceSlopeYEnum;
+	      else if (strcmp(name,"Temperature")==0) return TemperatureEnum;
+	      else if (strcmp(name,"TemperatureOld")==0) return TemperatureOldEnum;
+	      else if (strcmp(name,"TemperaturePicard")==0) return TemperaturePicardEnum;
+	      else if (strcmp(name,"ThicknessAbsMisfit")==0) return ThicknessAbsMisfitEnum;
+	      else if (strcmp(name,"Type")==0) return TypeEnum;
+	      else if (strcmp(name,"Vel")==0) return VelEnum;
+	      else if (strcmp(name,"Velocity")==0) return VelocityEnum;
+	      else if (strcmp(name,"VxAverage")==0) return VxAverageEnum;
+	      else if (strcmp(name,"Vx")==0) return VxEnum;
+	      else if (strcmp(name,"VxPicard")==0) return VxPicardEnum;
+	      else if (strcmp(name,"VyAverage")==0) return VyAverageEnum;
+	      else if (strcmp(name,"Vy")==0) return VyEnum;
+	      else if (strcmp(name,"VyPicard")==0) return VyPicardEnum;
+	      else if (strcmp(name,"Vz")==0) return VzEnum;
+	      else if (strcmp(name,"VzMacAyeal")==0) return VzMacAyealEnum;
+	      else if (strcmp(name,"VzPattyn")==0) return VzPattynEnum;
+	      else if (strcmp(name,"VzPicard")==0) return VzPicardEnum;
+	      else if (strcmp(name,"VzStokes")==0) return VzStokesEnum;
+	      else if (strcmp(name,"VxMesh")==0) return VxMeshEnum;
+	      else if (strcmp(name,"VyMesh")==0) return VyMeshEnum;
+	      else if (strcmp(name,"VzMesh")==0) return VzMeshEnum;
+	      else if (strcmp(name,"Enthalpy")==0) return EnthalpyEnum;
+	      else if (strcmp(name,"EnthalpyPicard")==0) return EnthalpyPicardEnum;
+	      else if (strcmp(name,"ThicknessAbsGradient")==0) return ThicknessAbsGradientEnum;
+	      else if (strcmp(name,"StepResponses")==0) return StepResponsesEnum;
+	      else if (strcmp(name,"IntMatParam")==0) return IntMatParamEnum;
+	      else if (strcmp(name,"RheologyBbarAbsGradient")==0) return RheologyBbarAbsGradientEnum;
+	      else if (strcmp(name,"DragCoefficientAbsGradient")==0) return DragCoefficientAbsGradientEnum;
+	      else if (strcmp(name,"TransientInput")==0) return TransientInputEnum;
+	      else if (strcmp(name,"Outputfilename")==0) return OutputfilenameEnum;
+	      else if (strcmp(name,"Waterfraction")==0) return WaterfractionEnum;
+	      else if (strcmp(name,"Watercolumn")==0) return WatercolumnEnum;
+	      else if (strcmp(name,"BasalFriction")==0) return BasalFrictionEnum;
+	      else if (strcmp(name,"ViscousHeating")==0) return ViscousHeatingEnum;
+	      else if (strcmp(name,"QmuTemperature")==0) return QmuTemperatureEnum;
+	      else if (strcmp(name,"HydrologyWaterVx")==0) return HydrologyWaterVxEnum;
+	      else if (strcmp(name,"HydrologyWaterVy")==0) return HydrologyWaterVyEnum;
+	      else if (strcmp(name,"StressTensor")==0) return StressTensorEnum;
+	      else if (strcmp(name,"StressTensorxx")==0) return StressTensorxxEnum;
+	      else if (strcmp(name,"StressTensorxy")==0) return StressTensorxyEnum;
+	      else if (strcmp(name,"StressTensorxz")==0) return StressTensorxzEnum;
+	      else if (strcmp(name,"StressTensoryy")==0) return StressTensoryyEnum;
+	      else if (strcmp(name,"StressTensoryz")==0) return StressTensoryzEnum;
+	      else if (strcmp(name,"StressTensorzz")==0) return StressTensorzzEnum;
+	      else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
+	      else if (strcmp(name,"P0")==0) return P0Enum;
+	      else if (strcmp(name,"P1")==0) return P1Enum;
+	      else if (strcmp(name,"P1DG")==0) return P1DGEnum;
+	      else if (strcmp(name,"BoolElementResult")==0) return BoolElementResultEnum;
+	      else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
+	      else if (strcmp(name,"DoubleElementResult")==0) return DoubleElementResultEnum;
+	      else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum;
+	      else if (strcmp(name,"DoubleMatExternalResult")==0) return DoubleMatExternalResultEnum;
+	      else if (strcmp(name,"DoubleVecExternalResult")==0) return DoubleVecExternalResultEnum;
+         else stage=4;
+   }
+   if(stage==4){
+	      if (strcmp(name,"IntExternalResult")==0) return IntExternalResultEnum;
+	      else if (strcmp(name,"J")==0) return JEnum;
+	      else if (strcmp(name,"Patch")==0) return PatchEnum;
+	      else if (strcmp(name,"PatchNodes")==0) return PatchNodesEnum;
+	      else if (strcmp(name,"PatchVertices")==0) return PatchVerticesEnum;
+	      else if (strcmp(name,"PentaP1ElementResult")==0) return PentaP1ElementResultEnum;
+	      else if (strcmp(name,"PetscVecExternalResult")==0) return PetscVecExternalResultEnum;
+	      else if (strcmp(name,"StringExternalResult")==0) return StringExternalResultEnum;
+	      else if (strcmp(name,"Time")==0) return TimeEnum;
+	      else if (strcmp(name,"TriaP1ElementResult")==0) return TriaP1ElementResultEnum;
+	      else if (strcmp(name,"WaterColumnOld")==0) return WaterColumnOldEnum;
+	      else if (strcmp(name,"MinVel")==0) return MinVelEnum;
+	      else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
+	      else if (strcmp(name,"MinVx")==0) return MinVxEnum;
+	      else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
+	      else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
+	      else if (strcmp(name,"MinVy")==0) return MinVyEnum;
+	      else if (strcmp(name,"MaxVy")==0) return MaxVyEnum;
+	      else if (strcmp(name,"MaxAbsVy")==0) return MaxAbsVyEnum;
+	      else if (strcmp(name,"MinVz")==0) return MinVzEnum;
+	      else if (strcmp(name,"MaxVz")==0) return MaxVzEnum;
+	      else if (strcmp(name,"MaxAbsVz")==0) return MaxAbsVzEnum;
+	      else if (strcmp(name,"Relative")==0) return RelativeEnum;
+	      else if (strcmp(name,"Absolute")==0) return AbsoluteEnum;
+	      else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
+	      else if (strcmp(name,"AgressiveMigration")==0) return AgressiveMigrationEnum;
+	      else if (strcmp(name,"None")==0) return NoneEnum;
+	      else if (strcmp(name,"SoftMigration")==0) return SoftMigrationEnum;
+	      else if (strcmp(name,"StokesSolver")==0) return StokesSolverEnum;
+	      else if (strcmp(name,"Adjoint")==0) return AdjointEnum;
+	      else if (strcmp(name,"Colinear")==0) return ColinearEnum;
+	      else if (strcmp(name,"ControlSteady")==0) return ControlSteadyEnum;
+	      else if (strcmp(name,"Fset")==0) return FsetEnum;
+	      else if (strcmp(name,"Gradient1")==0) return Gradient1Enum;
+	      else if (strcmp(name,"Gradient2")==0) return Gradient2Enum;
+	      else if (strcmp(name,"Gradient3")==0) return Gradient3Enum;
+	      else if (strcmp(name,"Gradient")==0) return GradientEnum;
+	      else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum;
+	      else if (strcmp(name,"Gset")==0) return GsetEnum;
+	      else if (strcmp(name,"Index")==0) return IndexEnum;
+	      else if (strcmp(name,"Indexed")==0) return IndexedEnum;
+	      else if (strcmp(name,"Intersect")==0) return IntersectEnum;
+	      else if (strcmp(name,"Nodal")==0) return NodalEnum;
+	      else if (strcmp(name,"OldGradient")==0) return OldGradientEnum;
+	      else if (strcmp(name,"OutputFilePointer")==0) return OutputFilePointerEnum;
+	      else if (strcmp(name,"PetscOptionsAnalyses")==0) return PetscOptionsAnalysesEnum;
+	      else if (strcmp(name,"PetscOptionsStrings")==0) return PetscOptionsStringsEnum;
+	      else if (strcmp(name,"QmuErrName")==0) return QmuErrNameEnum;
+	      else if (strcmp(name,"QmuInName")==0) return QmuInNameEnum;
+	      else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
+	      else if (strcmp(name,"Regular")==0) return RegularEnum;
+	      else if (strcmp(name,"Scaled")==0) return ScaledEnum;
+	      else if (strcmp(name,"Separate")==0) return SeparateEnum;
+	      else if (strcmp(name,"Sset")==0) return SsetEnum;
+	      else if (strcmp(name,"Verbose")==0) return VerboseEnum;
+	      else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum;
+	      else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum;
+	      else if (strcmp(name,"NearestInterp")==0) return NearestInterpEnum;
+	      else if (strcmp(name,"XY")==0) return XYEnum;
+	      else if (strcmp(name,"XYZP")==0) return XYZPEnum;
+	      else if (strcmp(name,"Option")==0) return OptionEnum;
+	      else if (strcmp(name,"OptionCell")==0) return OptionCellEnum;
+	      else if (strcmp(name,"OptionChar")==0) return OptionCharEnum;
+	      else if (strcmp(name,"OptionStruct")==0) return OptionStructEnum;
+	      else if (strcmp(name,"OptionDouble")==0) return OptionDoubleEnum;
+	      else if (strcmp(name,"OptionLogical")==0) return OptionLogicalEnum;
+	      else if (strcmp(name,"Paterson")==0) return PatersonEnum;
+	      else if (strcmp(name,"Arrhenius")==0) return ArrheniusEnum;
+         else stage=5;
+   }
+	/*If we reach this point, the string provided has not been found*/
+   _error_("Enum %s not found",name);
 }

Modified: issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp
===================================================================
--- issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -142,8 +142,12 @@
 
 	/*Assign output pointers: */
 	if(pKff) *pKff=Kff;
+	else      MatFree(&Kff);
 	if(pKfs) *pKfs=Kfs;
+	else      MatFree(&Kfs);
 	if(ppf)  *ppf=pf;
+	else      VecFree(&pf);
 	if(pdf)  *pdf=df;
+	else      VecFree(&df);
 	if(pkmax) *pkmax=kmax;
 }

Modified: issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp
===================================================================
--- issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/UpdateVertexPositionsx/UpdateVertexPositionsx.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -11,23 +11,35 @@
 
 int UpdateVertexPositionsx(Elements* elements,Nodes* nodes,Vertices* vertices,Loads* loads,Materials* materials,Parameters* parameters){
 
-	int i;
-	Vertex* vertex=NULL;
-	double* thickness=NULL;
-	double* bed=NULL;
+	int     i;
+	Vec     vz        = NULL;
+	Vertex *vertex    = NULL;
+	double *thickness = NULL;
+	double *bed       = NULL;
 
 	/*get vertex vectors for bed and thickness: */
-	GetVectorFromInputsx( &thickness,elements,nodes, vertices, loads, materials, parameters, ThicknessEnum,VertexEnum);
-	GetVectorFromInputsx( &bed      ,elements,nodes, vertices, loads, materials, parameters, BedEnum,      VertexEnum);
+	GetVectorFromInputsx(&thickness,elements,nodes, vertices, loads, materials, parameters, ThicknessEnum,VertexEnum);
+	GetVectorFromInputsx(&bed      ,elements,nodes, vertices, loads, materials, parameters, BedEnum,      VertexEnum);
 
+	/*Allocate vector*/
+	vz=NewVec(vertices->NumberOfVertices());
+
 	/*Update verices new geometry: */
 	for (i=0;i<vertices->Size();i++){
 		vertex=(Vertex*)vertices->GetObjectByOffset(i);
-		vertex->UpdatePosition(thickness,bed);
+		vertex->UpdatePosition(vz,parameters,thickness,bed);
 	}
 
+	/*Assemble mesh velocity*/
+	VecAssemblyBegin(vz);
+	VecAssemblyEnd(vz);
+
+	/*Update element inputs*/
+	InputUpdateFromVectorx(elements,nodes,vertices,loads,materials,parameters,vz,VzMeshEnum,VertexEnum);
+
 	/*Free ressources:*/
 	xfree((void**)&thickness);
 	xfree((void**)&bed);
+	VecFree(&vz);
 	return 1;
 }

Modified: issm/trunk/src/c/modules/modules.h
===================================================================
--- issm/trunk/src/c/modules/modules.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/modules/modules.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -30,6 +30,8 @@
 #include "./StringToEnumx/StringToEnumx.h"
 #include "./GetSolutionFromInputsx/GetSolutionFromInputsx.h"
 #include "./GetVectorFromInputsx/GetVectorFromInputsx.h"
+#include "./GetVectorFromControlInputsx/GetVectorFromControlInputsx.h"
+#include "./SetControlInputsFromVectorx/SetControlInputsFromVectorx.h"
 #include "./Gradjx/Gradjx.h"
 #include "./GroundinglineMigrationx/GroundinglineMigrationx.h"
 #include "./HoleFillerx/HoleFillerx.h"
@@ -52,7 +54,7 @@
 #include "./InputUpdateFromMatrixDakotax/InputUpdateFromMatrixDakotax.h"
 #include "./InputArtificialNoisex/InputArtificialNoisex.h"
 #include "./IoModelToConstraintsx/IoModelToConstraintsx.h"
-#include "./KMLMeshWritex/KMLFileReadx.h"
+#include "./KMLFileReadx/KMLFileReadx.h"
 #include "./KMLMeshWritex/KMLMeshWritex.h"
 #include "./KMLOverlayx/KMLOverlayx.h"
 #include "./Xy2llx/Xy2llx.h"
@@ -105,6 +107,7 @@
 #include "./SpcNodesx/SpcNodesx.h"
 #include "./SurfaceAreax/SurfaceAreax.h"
 #include "./SystemMatricesx/SystemMatricesx.h"
+#include "./CreateJacobianMatrixx/CreateJacobianMatrixx.h"
 #include "./TimeAdaptx/TimeAdaptx.h"
 #include "./TriaSearchx/TriaSearchx.h"
 #include "./ThicknessAbsMisfitx/ThicknessAbsMisfitx.h"

Copied: issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp (from rev 11526, issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.cpp)
===================================================================
--- issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp	                        (rev 0)
+++ issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,210 @@
+/*!\file PentaP1ElementResult.c
+ * \brief: implementation of the PentaP1ElementResult 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 "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../Container/Container.h"
+#include "../../include/include.h"
+
+/*PentaP1ElementResult constructors and destructor*/
+/*FUNCTION PentaP1ElementResult::PentaP1ElementResult(){{{1*/
+PentaP1ElementResult::PentaP1ElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::PentaP1ElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
+PentaP1ElementResult::PentaP1ElementResult(int in_enum_type,double* in_values,int in_step, double in_time){
+
+	int i;
+
+	enum_type=in_enum_type;
+	for(i=0;i<6;i++)values[i]=in_values[i];
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::~PentaP1ElementResult(){{{1*/
+PentaP1ElementResult::~PentaP1ElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object virtual functions definitions:*/
+/*FUNCTION PentaP1ElementResult::Echo {{{1*/
+void PentaP1ElementResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::DeepEcho{{{1*/
+void PentaP1ElementResult::DeepEcho(void){
+
+	printf("PentaP1ElementResult:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
+	printf("   values: [%g %g %g %g %g %g]\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]);
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::Id{{{1*/
+int    PentaP1ElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::MyRank{{{1*/
+int    PentaP1ElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+#ifdef _SERIAL_
+/*FUNCTION PentaP1ElementResult::Marshall{{{1*/
+void  PentaP1ElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of PentaP1ElementResult: */
+	enum_value=PentaP1ElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall PentaP1ElementResult data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::MarshallSize{{{1*/
+int   PentaP1ElementResult::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::Demarshall{{{1*/
+void  PentaP1ElementResult::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+#endif
+/*FUNCTION PentaP1ElementResult::ObjectEnum{{{1*/
+int PentaP1ElementResult::ObjectEnum(void){
+
+	return PentaP1ElementResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::copy{{{1*/
+Object* PentaP1ElementResult::copy() {
+	
+	return new PentaP1ElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+
+/*ElementResult management*/
+/*FUNCTION PentaP1ElementResult::InstanceEnum{{{1*/
+int PentaP1ElementResult::InstanceEnum(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::SpawnTriaElementResult{{{1*/
+ElementResult* PentaP1ElementResult::SpawnTriaElementResult(int* indices){
+
+	/*output*/
+	TriaP1ElementResult* outresult=NULL;
+	double newvalues[3];
+
+	/*Loop over the new indices*/
+	for(int i=0;i<3;i++){
+
+		/*Check index value*/
+		_assert_(indices[i]>=0 && indices[i]<6);
+
+		/*Assign value to new result*/
+		newvalues[i]=this->values[indices[i]];
+	}
+
+	/*Create new Tria result*/
+	outresult=new TriaP1ElementResult(this->enum_type,&newvalues[0],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::ProcessUnits{{{1*/
+void PentaP1ElementResult::ProcessUnits(Parameters* parameters){
+	
+	UnitConversion(this->values,6,IuToExtEnum,this->enum_type);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::NumberOfNodalValues{{{1*/
+int PentaP1ElementResult::NumberOfNodalValues(void){
+	return 6;
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::PatchFill{{{1*/
+void PentaP1ElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,6);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1ElementResult::GetVectorFromResults{{{1*/
+void PentaP1ElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
+
+	double data[6];
+
+	if(numdofs!=6)_error_("Result %s is a PentaP1ElementResult and cannot write vector of %i dofs",numdofs);
+	for(int i=0;i<6;i++) data[i]=this->values[i]/(double)connectivitylist[i];
+	VecSetValues(vector,numdofs,doflist,(const double*)&data,ADD_VALUES);
+
+} /*}}}*/
+/*FUNCTION PentaP1ElementResult::GetElementVectorFromResults{{{1*/
+void PentaP1ElementResult::GetElementVectorFromResults(Vec vector,int dof){
+
+	_error_("Result %s is a PentaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
+} /*}}}*/

Copied: issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h (from rev 11526, issm/trunk-jpl/src/c/objects/ElementResults/PentaP1ElementResult.h)
===================================================================
--- issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h	                        (rev 0)
+++ issm/trunk/src/c/objects/ElementResults/PentaP1ElementResult.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,59 @@
+/*! \file PentaP1ElementResult.h 
+ *  \brief: header file for PentaP1ElementResult object
+ *  this object is just a PentaP1Input with additional time and step info.
+ */
+
+
+#ifndef _PENTAP1ELEMENTRESULT_H_
+#define _PENTAP1ELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class PentaP1ElementResult: public ElementResult{
+
+	private: 
+		int    enum_type;
+		double values[6];
+		int    step;
+		double time;
+
+	public:
+
+		/*PentaP1ElementResult constructors, destructors: {{{1*/
+		PentaP1ElementResult();
+		PentaP1ElementResult(int enum_type,double* values,int step, double time);
+		~PentaP1ElementResult();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		#ifdef _SERIAL_
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		#endif
+		int   ObjectEnum();
+		Object* copy();
+		/*}}}*/
+		/*ElementResult virtual functions definitions: {{{1*/
+		ElementResult* SpawnTriaElementResult(int* indices);
+		double  GetTime(void){return time;};
+		int     GetStep(void){return step;};
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+		/*PentaP1ElementResult management: {{{1*/
+		int   InstanceEnum();
+		void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
+		void GetElementVectorFromResults(Vec vector,int dof);
+		/*}}}*/
+
+};
+#endif  /* _PENTAP1ELEMENTRESULT_H */

Deleted: issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,210 +0,0 @@
-/*!\file PentaVertexElementResult.c
- * \brief: implementation of the PentaVertexElementResult 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 "./ElementResultLocal.h"
-#include "../objects.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-#include "../../shared/shared.h"
-#include "../../Container/Container.h"
-#include "../../include/include.h"
-
-/*PentaVertexElementResult constructors and destructor*/
-/*FUNCTION PentaVertexElementResult::PentaVertexElementResult(){{{1*/
-PentaVertexElementResult::PentaVertexElementResult(){
-	return;
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::PentaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
-PentaVertexElementResult::PentaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){
-
-	int i;
-
-	enum_type=in_enum_type;
-	for(i=0;i<6;i++)values[i]=in_values[i];
-	step=in_step;
-	time=in_time;
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::~PentaVertexElementResult(){{{1*/
-PentaVertexElementResult::~PentaVertexElementResult(){
-	return;
-}
-/*}}}*/
-
-/*Object virtual functions definitions:*/
-/*FUNCTION PentaVertexElementResult::Echo {{{1*/
-void PentaVertexElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::DeepEcho{{{1*/
-void PentaVertexElementResult::DeepEcho(void){
-
-	printf("PentaVertexElementResult:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
-	printf("   values: [%g %g %g %g %g %g]\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]);
-	printf("   step: %i\n",this->step);
-	printf("   time: %g\n",this->time);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::Id{{{1*/
-int    PentaVertexElementResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::MyRank{{{1*/
-int    PentaVertexElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION PentaVertexElementResult::Marshall{{{1*/
-void  PentaVertexElementResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of PentaVertexElementResult: */
-	enum_value=PentaVertexElementResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall PentaVertexElementResult data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::MarshallSize{{{1*/
-int   PentaVertexElementResult::MarshallSize(){
-	
-	return sizeof(values)+
-		+sizeof(enum_type)
-		+sizeof(time)
-		+sizeof(step)
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::Demarshall{{{1*/
-void  PentaVertexElementResult::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-#endif
-/*FUNCTION PentaVertexElementResult::ObjectEnum{{{1*/
-int PentaVertexElementResult::ObjectEnum(void){
-
-	return PentaVertexElementResultEnum;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::copy{{{1*/
-Object* PentaVertexElementResult::copy() {
-	
-	return new PentaVertexElementResult(this->enum_type,this->values,this->step,this->time);
-
-}
-/*}}}*/
-
-/*ElementResult management*/
-/*FUNCTION PentaVertexElementResult::InstanceEnum{{{1*/
-int PentaVertexElementResult::InstanceEnum(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::SpawnTriaElementResult{{{1*/
-ElementResult* PentaVertexElementResult::SpawnTriaElementResult(int* indices){
-
-	/*output*/
-	TriaVertexElementResult* outresult=NULL;
-	double newvalues[3];
-
-	/*Loop over the new indices*/
-	for(int i=0;i<3;i++){
-
-		/*Check index value*/
-		_assert_(indices[i]>=0 && indices[i]<6);
-
-		/*Assign value to new result*/
-		newvalues[i]=this->values[indices[i]];
-	}
-
-	/*Create new Tria result*/
-	outresult=new TriaVertexElementResult(this->enum_type,&newvalues[0],this->step,this->time);
-
-	/*Assign output*/
-	return outresult;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::ProcessUnits{{{1*/
-void PentaVertexElementResult::ProcessUnits(Parameters* parameters){
-	
-	UnitConversion(this->values,6,IuToExtEnum,this->enum_type);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::NumberOfNodalValues{{{1*/
-int PentaVertexElementResult::NumberOfNodalValues(void){
-	return 6;
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::PatchFill{{{1*/
-void PentaVertexElementResult::PatchFill(int row, Patch* patch){
-	
-	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
-	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
-	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
-	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,6);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexElementResult::GetVectorFromResults{{{1*/
-void PentaVertexElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
-
-	double data[6];
-
-	if(numdofs!=6)_error_("Result %s is a PentaVertexElementResult and cannot write vector of %i dofs",numdofs);
-	for(int i=0;i<6;i++) data[i]=this->values[i]/(double)connectivitylist[i];
-	VecSetValues(vector,numdofs,doflist,(const double*)&data,ADD_VALUES);
-
-} /*}}}*/
-/*FUNCTION PentaVertexElementResult::GetElementVectorFromResults{{{1*/
-void PentaVertexElementResult::GetElementVectorFromResults(Vec vector,int dof){
-
-	_error_("Result %s is a PentaVertexElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
-} /*}}}*/

Deleted: issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h
===================================================================
--- issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,59 +0,0 @@
-/*! \file PentaVertexElementResult.h 
- *  \brief: header file for penta vertex result  object. 
- *  this object is just a PentaVertexInput with additional time and step info.
- */
-
-
-#ifndef _PENTAVERTEXELEMENTRESULT_H_
-#define _PENTAVERTEXELEMENTRESULT_H_
-
-/*Headers:*/
-/*{{{1*/
-#include "../Inputs/Input.h"
-#include "../../include/include.h"
-/*}}}*/
-
-class PentaVertexElementResult: public ElementResult{
-
-	private: 
-		int    enum_type;
-		double values[6];
-		int    step;
-		double time;
-
-	public:
-
-		/*PentaVertexElementResult constructors, destructors: {{{1*/
-		PentaVertexElementResult();
-		PentaVertexElementResult(int enum_type,double* values,int step, double time);
-		~PentaVertexElementResult();
-		/*}}}*/
-		/*Object virtual functions definitions:{{{1 */
-		void  Echo();
-		void  DeepEcho();
-		int   Id(); 
-		int   MyRank();
-		#ifdef _SERIAL_
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		void  Demarshall(char** pmarshalled_dataset);
-		#endif
-		int   ObjectEnum();
-		Object* copy();
-		/*}}}*/
-		/*ElementResult virtual functions definitions: {{{1*/
-		ElementResult* SpawnTriaElementResult(int* indices);
-		double  GetTime(void){return time;};
-		int     GetStep(void){return step;};
-		void    ProcessUnits(Parameters* parameters);
-		int     NumberOfNodalValues(void);
-		void    PatchFill(int row, Patch* patch);
-		/*}}}*/
-		/*PentaVertexElementResult management: {{{1*/
-		int   InstanceEnum();
-		void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
-		void GetElementVectorFromResults(Vec vector,int dof);
-		/*}}}*/
-
-};
-#endif  /* _PENTAVERTEXELEMENTRESULT_H */

Copied: issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp (from rev 11526, issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.cpp)
===================================================================
--- issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp	                        (rev 0)
+++ issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,199 @@
+/*!\file TriaP1ElementResult.c
+ * \brief: implementation of the TriaP1ElementResult 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 "./ElementResultLocal.h"
+#include "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../Container/Container.h"
+#include "../../include/include.h"
+
+/*TriaP1ElementResult constructors and destructor*/
+/*FUNCTION TriaP1ElementResult::TriaP1ElementResult(){{{1*/
+TriaP1ElementResult::TriaP1ElementResult(){
+	return;
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::TriaP1ElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
+TriaP1ElementResult::TriaP1ElementResult(int in_enum_type,double* in_values,int in_step, double in_time){
+
+	enum_type=in_enum_type;
+	values[0]=in_values[0];
+	values[1]=in_values[1];
+	values[2]=in_values[2];
+	step=in_step;
+	time=in_time;
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::~TriaP1ElementResult(){{{1*/
+TriaP1ElementResult::~TriaP1ElementResult(){
+	return;
+}
+/*}}}*/
+
+/*Object virtual functions definitions:*/
+/*FUNCTION TriaP1ElementResult::Echo {{{1*/
+void TriaP1ElementResult::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::DeepEcho{{{1*/
+void TriaP1ElementResult::DeepEcho(void){
+		
+	printf("TriaP1ElementResult:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
+	printf("   values: [%g %g %g]\n",this->values[0],this->values[1],this->values[2]);
+	printf("   step: %i\n",this->step);
+	printf("   time: %g\n",this->time);
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::Id{{{1*/
+int    TriaP1ElementResult::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::MyRank{{{1*/
+int    TriaP1ElementResult::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+#ifdef _SERIAL_
+/*FUNCTION TriaP1ElementResult::Marshall{{{1*/
+void  TriaP1ElementResult::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of TriaP1ElementResult: */
+	enum_value=TriaP1ElementResultEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall TriaP1ElementResult data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::MarshallSize{{{1*/
+int   TriaP1ElementResult::MarshallSize(){
+	
+	return sizeof(values)
+		+sizeof(enum_type)
+		+sizeof(time)
+		+sizeof(step)
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::Demarshall{{{1*/
+void  TriaP1ElementResult::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
+	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
+	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+#endif
+/*FUNCTION TriaP1ElementResult::ObjectEnum{{{1*/
+int TriaP1ElementResult::ObjectEnum(void){
+
+	return TriaP1ElementResultEnum;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::copy{{{1*/
+Object* TriaP1ElementResult::copy() {
+	
+	return new TriaP1ElementResult(this->enum_type,this->values,this->step,this->time);
+
+}
+/*}}}*/
+
+/*ElementResult management*/
+/*FUNCTION TriaP1ElementResult::InstanceEnum{{{1*/
+int TriaP1ElementResult::InstanceEnum(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::SpawnTriaElementResult{{{1*/
+ElementResult* TriaP1ElementResult::SpawnTriaElementResult(int* indices){
+
+	/*output*/
+	TriaP1ElementResult* outresult=NULL;
+
+	/*Create new Tria result (copy of current result)*/
+	outresult=new TriaP1ElementResult(this->enum_type,&this->values[0],this->step,this->time);
+
+	/*Assign output*/
+	return outresult;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::ProcessUnits{{{1*/
+void TriaP1ElementResult::ProcessUnits(Parameters* parameters){
+	
+	UnitConversion(this->values,3,IuToExtEnum,this->enum_type);
+
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::NumberOfNodalValues{{{1*/
+int TriaP1ElementResult::NumberOfNodalValues(void){
+	return 3;
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::PatchFill{{{1*/
+void TriaP1ElementResult::PatchFill(int row, Patch* patch){
+	
+	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
+	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
+	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
+	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,3);
+
+}
+/*}}}*/
+/*FUNCTION TriaP1ElementResult::GetVectorFromResults{{{1*/
+void TriaP1ElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
+
+	double data[3];
+
+	if(numdofs!=3)_error_("Result %s is a TriaP1ElementResult and cannot write vector of %i dofs",numdofs);
+	for(int i=0;i<3;i++) data[i]=this->values[i]/(double)connectivitylist[i];
+	VecSetValues(vector,numdofs,doflist,(const double*)&data,ADD_VALUES);
+
+} /*}}}*/
+/*FUNCTION TriaP1ElementResult::GetElementVectorFromResults{{{1*/
+void TriaP1ElementResult::GetElementVectorFromResults(Vec vector,int dof){
+
+	_error_("Result %s is a TriaP1ElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
+} /*}}}*/

Copied: issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h (from rev 11526, issm/trunk-jpl/src/c/objects/ElementResults/TriaP1ElementResult.h)
===================================================================
--- issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h	                        (rev 0)
+++ issm/trunk/src/c/objects/ElementResults/TriaP1ElementResult.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,58 @@
+/*! \file TriaP1ElementResult.h 
+ *  \brief: header file for TriaP1ElementResult object
+ */
+
+
+#ifndef _TRIAP1ELEMENTRESULT_H_
+#define _TRIAP1ELEMENTRESULT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../Inputs/Input.h"
+#include "../../include/include.h"
+/*}}}*/
+
+class TriaP1ElementResult: public ElementResult{
+
+	private: 
+		int    enum_type;
+		double values[3];
+		int    step;
+		double time;
+
+	public:
+
+		/*TriaP1ElementResult constructors, destructors: {{{1*/
+		TriaP1ElementResult();
+		TriaP1ElementResult(int enum_type,double* values,int step,double time);
+		~TriaP1ElementResult();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		#ifdef _SERIAL_
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		#endif
+		int   ObjectEnum();
+		Object* copy();
+		/*}}}*/
+		/*ElementResult virtual functions definitions: {{{1*/
+		ElementResult* SpawnTriaElementResult(int* indices);
+		double  GetTime(void){return time;};
+		int     GetStep(void){return step;};
+		void    ProcessUnits(Parameters* parameters);
+		int     NumberOfNodalValues(void);
+		void    PatchFill(int row, Patch* patch);
+		/*}}}*/
+		/*TriaP1ElementResult management: {{{1*/
+		int   InstanceEnum();
+		void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
+		void GetElementVectorFromResults(Vec vector,int dof);
+		/*}}}*/
+
+};
+#endif  /* _TRIAP1ELEMENTRESULT_H */

Deleted: issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp
===================================================================
--- issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,199 +0,0 @@
-/*!\file TriaVertexElementResult.c
- * \brief: implementation of the TriaVertexElementResult 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 "./ElementResultLocal.h"
-#include "../objects.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-#include "../../shared/shared.h"
-#include "../../Container/Container.h"
-#include "../../include/include.h"
-
-/*TriaVertexElementResult constructors and destructor*/
-/*FUNCTION TriaVertexElementResult::TriaVertexElementResult(){{{1*/
-TriaVertexElementResult::TriaVertexElementResult(){
-	return;
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::TriaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){{{1*/
-TriaVertexElementResult::TriaVertexElementResult(int in_enum_type,double* in_values,int in_step, double in_time){
-
-	enum_type=in_enum_type;
-	values[0]=in_values[0];
-	values[1]=in_values[1];
-	values[2]=in_values[2];
-	step=in_step;
-	time=in_time;
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::~TriaVertexElementResult(){{{1*/
-TriaVertexElementResult::~TriaVertexElementResult(){
-	return;
-}
-/*}}}*/
-
-/*Object virtual functions definitions:*/
-/*FUNCTION TriaVertexElementResult::Echo {{{1*/
-void TriaVertexElementResult::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::DeepEcho{{{1*/
-void TriaVertexElementResult::DeepEcho(void){
-		
-	printf("TriaVertexElementResult:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
-	printf("   values: [%g %g %g]\n",this->values[0],this->values[1],this->values[2]);
-	printf("   step: %i\n",this->step);
-	printf("   time: %g\n",this->time);
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::Id{{{1*/
-int    TriaVertexElementResult::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::MyRank{{{1*/
-int    TriaVertexElementResult::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION TriaVertexElementResult::Marshall{{{1*/
-void  TriaVertexElementResult::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of TriaVertexElementResult: */
-	enum_value=TriaVertexElementResultEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall TriaVertexElementResult data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(marshalled_dataset,&time,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(marshalled_dataset,&step,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::MarshallSize{{{1*/
-int   TriaVertexElementResult::MarshallSize(){
-	
-	return sizeof(values)
-		+sizeof(enum_type)
-		+sizeof(time)
-		+sizeof(step)
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::Demarshall{{{1*/
-void  TriaVertexElementResult::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-	memcpy(&time,marshalled_dataset,sizeof(time));marshalled_dataset+=sizeof(time);
-	memcpy(&step,marshalled_dataset,sizeof(step));marshalled_dataset+=sizeof(step);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-#endif
-/*FUNCTION TriaVertexElementResult::ObjectEnum{{{1*/
-int TriaVertexElementResult::ObjectEnum(void){
-
-	return TriaVertexElementResultEnum;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::copy{{{1*/
-Object* TriaVertexElementResult::copy() {
-	
-	return new TriaVertexElementResult(this->enum_type,this->values,this->step,this->time);
-
-}
-/*}}}*/
-
-/*ElementResult management*/
-/*FUNCTION TriaVertexElementResult::InstanceEnum{{{1*/
-int TriaVertexElementResult::InstanceEnum(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::SpawnTriaElementResult{{{1*/
-ElementResult* TriaVertexElementResult::SpawnTriaElementResult(int* indices){
-
-	/*output*/
-	TriaVertexElementResult* outresult=NULL;
-
-	/*Create new Tria result (copy of current result)*/
-	outresult=new TriaVertexElementResult(this->enum_type,&this->values[0],this->step,this->time);
-
-	/*Assign output*/
-	return outresult;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::ProcessUnits{{{1*/
-void TriaVertexElementResult::ProcessUnits(Parameters* parameters){
-	
-	UnitConversion(this->values,3,IuToExtEnum,this->enum_type);
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::NumberOfNodalValues{{{1*/
-int TriaVertexElementResult::NumberOfNodalValues(void){
-	return 3;
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::PatchFill{{{1*/
-void TriaVertexElementResult::PatchFill(int row, Patch* patch){
-	
-	 /*Here, we fill the result information into the patch object. First, let's remember what is in a row 
-	  * of the patch object: enum_type step time element_id interpolation vertices_ids nodal_values
-	  * Here, we will supply the enum_type, step, time, interpolation and nodal_values: */
-	patch->fillresultinfo(row,this->enum_type,this->step,this->time,P1Enum,this->values,3);
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexElementResult::GetVectorFromResults{{{1*/
-void TriaVertexElementResult::GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs){
-
-	double data[3];
-
-	if(numdofs!=3)_error_("Result %s is a TriaVertexElementResult and cannot write vector of %i dofs",numdofs);
-	for(int i=0;i<3;i++) data[i]=this->values[i]/(double)connectivitylist[i];
-	VecSetValues(vector,numdofs,doflist,(const double*)&data,ADD_VALUES);
-
-} /*}}}*/
-/*FUNCTION TriaVertexElementResult::GetElementVectorFromResults{{{1*/
-void TriaVertexElementResult::GetElementVectorFromResults(Vec vector,int dof){
-
-	_error_("Result %s is a TriaVertexElementResult and should not write vector of size numberofelemenrs",EnumToStringx(enum_type));
-} /*}}}*/

Deleted: issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h
===================================================================
--- issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,58 +0,0 @@
-/*! \file TriaVertexElementResult.h 
- *  \brief: header file for triavertexresult object
- */
-
-
-#ifndef _TRIAVERTEXELEMENTRESULT_H_
-#define _TRIAVERTEXELEMENTRESULT_H_
-
-/*Headers:*/
-/*{{{1*/
-#include "../Inputs/Input.h"
-#include "../../include/include.h"
-/*}}}*/
-
-class TriaVertexElementResult: public ElementResult{
-
-	private: 
-		int    enum_type;
-		double values[3];
-		int    step;
-		double time;
-
-	public:
-
-		/*TriaVertexElementResult constructors, destructors: {{{1*/
-		TriaVertexElementResult();
-		TriaVertexElementResult(int enum_type,double* values,int step,double time);
-		~TriaVertexElementResult();
-		/*}}}*/
-		/*Object virtual functions definitions:{{{1 */
-		void  Echo();
-		void  DeepEcho();
-		int   Id(); 
-		int   MyRank();
-		#ifdef _SERIAL_
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		void  Demarshall(char** pmarshalled_dataset);
-		#endif
-		int   ObjectEnum();
-		Object* copy();
-		/*}}}*/
-		/*ElementResult virtual functions definitions: {{{1*/
-		ElementResult* SpawnTriaElementResult(int* indices);
-		double  GetTime(void){return time;};
-		int     GetStep(void){return step;};
-		void    ProcessUnits(Parameters* parameters);
-		int     NumberOfNodalValues(void);
-		void    PatchFill(int row, Patch* patch);
-		/*}}}*/
-		/*TriaVertexElementResult management: {{{1*/
-		int   InstanceEnum();
-		void GetVectorFromResults(Vec vector,int* doflist,int* connectivitylist,int numdofs);
-		void GetElementVectorFromResults(Vec vector,int dof);
-		/*}}}*/
-
-};
-#endif  /* _TRIAVERTEXELEMENTRESULT_H */

Modified: issm/trunk/src/c/objects/Elements/Element.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Element.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Elements/Element.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -29,6 +29,7 @@
 		virtual void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters)=0;
 		virtual void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df)=0;
 		virtual void   CreatePVector(Vec pf)=0;
+		virtual void   CreateJacobianMatrix(Mat Jff)=0;
 		virtual void   GetSolutionFromInputs(Vec solution)=0;
 		virtual int    GetNodeIndex(Node* node)=0;
 		virtual int    Sid()=0;
@@ -66,8 +67,10 @@
 		virtual double TimeAdapt()=0;
 		virtual void   MigrateGroundingLine(double* old_floating_ice,double* sheet_ungrounding)=0;
 		virtual void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding)=0;
+		virtual void   PositiveDegreeDay(void)=0;
 		virtual int    UpdatePotentialSheetUngrounding(double* potential_sheet_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf)=0;
 		virtual void   ResetCoordinateSystem()=0;
+		virtual void   SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius)=0;
 
 		#ifdef _HAVE_RESPONSES_
 		virtual void   MinVel(double* pminvel, bool process_units)=0;
@@ -88,7 +91,7 @@
 		#endif
 
 		#ifdef _HAVE_CONTROL_
-		virtual void   Gradj(Vec gradient,int control_type)=0;
+		virtual void   Gradj(Vec gradient,int control_type,int control_index)=0;
 		virtual double ThicknessAbsMisfit(bool process_units  ,int weight_index)=0;
 		virtual double SurfaceAbsVelMisfit(bool process_units ,int weight_index)=0;
 		virtual double SurfaceRelVelMisfit(bool process_units ,int weight_index)=0;
@@ -98,9 +101,11 @@
 		virtual double ThicknessAbsGradient(bool process_units,int weight_index)=0;
 		virtual double RheologyBbarAbsGradient(bool process_units,int weight_index)=0;
 		virtual double DragCoefficientAbsGradient(bool process_units,int weight_index)=0;
-		virtual void   ControlInputGetGradient(Vec gradient,int enum_type)=0;
-		virtual void   ControlInputSetGradient(double* gradient,int enum_type)=0;
+		virtual void   ControlInputGetGradient(Vec gradient,int enum_type,int control_index)=0;
+		virtual void   ControlInputSetGradient(double* gradient,int enum_type,int control_index)=0;
 		virtual void   ControlInputScaleGradient(int enum_type, double scale)=0;
+		virtual void   GetVectorFromControlInputs(Vec gradient,int control_enum,int control_index,const char* data)=0;
+		virtual void   SetControlInputsFromVector(double* vector,int control_enum,int control_index)=0;
 		virtual void   InputControlUpdate(double scalar,bool save_parameter)=0;
 		#endif
 };

Modified: issm/trunk/src/c/objects/Elements/Penta.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Elements/Penta.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -346,7 +346,7 @@
 	/* Basal friction can only be found at the base of an ice sheet: */
 	if (!IsOnBed() || IsFloating()){
 		//empty friction: 
-		this->inputs->AddInput(new PentaVertexInput(BasalFrictionEnum,&basalfriction[0]));
+		this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
 		return;
 	}
 
@@ -374,7 +374,7 @@
 	}
 	
 	/*Create PentaVertex input, which will hold the basal friction:*/
-	this->inputs->AddInput(new PentaVertexInput(BasalFrictionEnum,&basalfriction[0]));
+	this->inputs->AddInput(new PentaP1Input(BasalFrictionEnum,&basalfriction[0]));
 
 	/*Clean up and return*/
 	delete gauss;
@@ -522,12 +522,12 @@
 	}
 	
 	/*Add Stress tensor components into inputs*/
-	this->inputs->AddInput(new PentaVertexInput(StressTensorxxEnum,&sigma_xx[0]));
-	this->inputs->AddInput(new PentaVertexInput(StressTensorxyEnum,&sigma_xy[0]));
-	this->inputs->AddInput(new PentaVertexInput(StressTensorxzEnum,&sigma_xz[0]));
-	this->inputs->AddInput(new PentaVertexInput(StressTensoryyEnum,&sigma_yy[0]));
-	this->inputs->AddInput(new PentaVertexInput(StressTensoryzEnum,&sigma_yz[0]));
-	this->inputs->AddInput(new PentaVertexInput(StressTensorzzEnum,&sigma_zz[0]));
+	this->inputs->AddInput(new PentaP1Input(StressTensorxxEnum,&sigma_xx[0]));
+	this->inputs->AddInput(new PentaP1Input(StressTensorxyEnum,&sigma_xy[0]));
+	this->inputs->AddInput(new PentaP1Input(StressTensorxzEnum,&sigma_xz[0]));
+	this->inputs->AddInput(new PentaP1Input(StressTensoryyEnum,&sigma_yy[0]));
+	this->inputs->AddInput(new PentaP1Input(StressTensoryzEnum,&sigma_yz[0]));
+	this->inputs->AddInput(new PentaP1Input(StressTensorzzEnum,&sigma_zz[0]));
 
 	/*Clean up and return*/
 	delete gauss;
@@ -584,9 +584,12 @@
 	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
 	switch(analysis_type){
 		#ifdef _HAVE_DIAGNOSTIC_
-		case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
+		case DiagnosticHorizAnalysisEnum:
 			Ke=CreateKMatrixDiagnosticHoriz(); De=CreateDVectorDiagnosticHoriz();
 			break;
+		case AdjointHorizAnalysisEnum:
+			Ke=CreateKMatrixAdjointHoriz();
+			break;
 		case DiagnosticHutterAnalysisEnum:
 			Ke=CreateKMatrixDiagnosticHutter();
 			break;
@@ -768,6 +771,39 @@
 	return pe;
 }
 /*}}}*/
+/*FUNCTION Penta::CreateJacobianMatrix{{{1*/
+void  Penta::CreateJacobianMatrix(Mat Jff){
+
+	/*retrieve parameters: */
+	ElementMatrix* Ke=NULL;
+	int analysis_type;
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	/*Checks in debugging {{{2*/
+	_assert_(this->nodes && this->matice && this->matpar && this->verticalneighbors && this->parameters && this->inputs);
+	/*}}}*/
+
+	/*Skip if water element*/
+	if(IsOnWater()) return;
+
+	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+	switch(analysis_type){
+#ifdef _HAVE_DIAGNOSTIC_
+		case DiagnosticHorizAnalysisEnum:
+			Ke=CreateJacobianDiagnosticHoriz();
+			break;
+#endif
+		default:
+			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+	}
+
+	/*Add to global matrix*/
+	if(Ke){
+		Ke->AddToGlobal(Jff);
+		delete Ke;
+	}
+}
+/*}}}*/
 /*FUNCTION Penta::DeepEcho{{{1*/
 void Penta::DeepEcho(void){
 
@@ -1098,15 +1134,17 @@
 }
 /*}}}*/
 /*FUNCTION Penta::GetStabilizationParameter {{{1*/
-double Penta::GetStabilizationParameter(double u, double v, double w, double diameter, double rho_ice, double heatcapacity, double thermalconductivity){
+double Penta::GetStabilizationParameter(double u, double v, double w, double diameter, double kappa){
 	/*Compute stabilization parameter*/
+	/*kappa=thermalconductivity/(rho_ice*hearcapacity) for thermal model*/
+	/*kappa=enthalpydiffusionparameter for enthalpy model*/
 
 	double normu;
 	double tau_parameter;
 
 	normu=pow(pow(u,2)+pow(v,2)+pow(w,2),0.5);
-	if(normu*diameter/(3*2*thermalconductivity/(rho_ice*heatcapacity))<1){
-		tau_parameter=pow(diameter,2)/(3*2*2*thermalconductivity/(rho_ice*heatcapacity));
+	if(normu*diameter/(3*2*kappa)<1){ 
+		tau_parameter=pow(diameter,2)/(3*2*2*kappa);
 	}
 	else tau_parameter=diameter/(2*normu);
 
@@ -1346,7 +1384,7 @@
 			UnitConversion(&nodeinputs[0], 6 ,ExtToIuEnum, vector_enum);
 
 			/*create static input: */
-			this->inputs->AddInput(new PentaVertexInput(vector_enum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(vector_enum,nodeinputs));
 		}
 		else if(M==numberofvertices+1){
 			/*create transient input: */
@@ -1365,7 +1403,7 @@
 				time=(double)vector[(M-1)*N+t]*yts;
 
 				if(t==0)transientinput=new TransientInput(vector_enum);
-				transientinput->AddTimeInput(new PentaVertexInput(vector_enum,nodeinputs),time);
+				transientinput->AddTimeInput(new PentaP1Input(vector_enum,nodeinputs),time);
 			}
 			this->inputs->AddInput(transientinput);
 		}
@@ -1419,7 +1457,7 @@
 	if(!IsOnBed()) return;
 
 	/*OK, we are on bed. Initialize global inputs as 0*/
-	total_thickness_input =new PentaVertexInput(ThicknessEnum,zeros_list);
+	total_thickness_input =new PentaP1Input(ThicknessEnum,zeros_list);
 
 	/*Now follow all the upper element from the base to the surface to integrate the input*/
 	penta=this;
@@ -1437,10 +1475,10 @@
 
 		/*If first time, initialize total_integrated_input*/
 		if (step==0){
-			if (original_input->ObjectEnum()==PentaVertexInputEnum)
-			 total_integrated_input=new PentaVertexInput(average_enum_type,zeros_list);
+			if (original_input->ObjectEnum()==PentaP1InputEnum)
+			 total_integrated_input=new PentaP1Input(average_enum_type,zeros_list);
 			else if (original_input->ObjectEnum()==ControlInputEnum)
-			 total_integrated_input=new PentaVertexInput(average_enum_type,zeros_list);
+			 total_integrated_input=new PentaP1Input(average_enum_type,zeros_list);
 			else if (original_input->ObjectEnum()==DoubleInputEnum)
 			 total_integrated_input=new DoubleInput(average_enum_type,0.0);
 			else
@@ -1453,7 +1491,7 @@
 			Helem_list[i]=xyz_list[i+3][2]-xyz_list[i][2];
 			Helem_list[i+3]=Helem_list[i];
 		}
-		element_thickness_input=new PentaVertexInput(ThicknessEnum,Helem_list);
+		element_thickness_input=new PentaP1Input(ThicknessEnum,Helem_list);
 
 		/*Step3: Vertically integrate A COPY of the original*/
 		element_integrated_input=(Input*)original_input->copy();
@@ -1606,7 +1644,9 @@
 	 * object out of the input, with the additional step and time information: */
 	this->results->AddObject((Object*)input->SpawnResult(step,time));
 	#ifdef _HAVE_CONTROL_
-	if(input->ObjectEnum()==ControlInputEnum) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+	if(input->ObjectEnum()==ControlInputEnum){
+		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+	}
 	#endif
 
 }
@@ -1680,7 +1720,7 @@
 						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[penta_vertex_ids[j]-1]/yts;
 						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
-						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VxEnum:
@@ -1688,7 +1728,7 @@
 						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(VxEnum)[penta_vertex_ids[j]-1]/yts;
 						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
-						this->inputs->AddInput(new ControlInput(VxEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(VxEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VyEnum:
@@ -1696,7 +1736,7 @@
 						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(VyEnum)[penta_vertex_ids[j]-1]/yts;
 						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
 						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts;
-						this->inputs->AddInput(new ControlInput(VyEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(VyEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case FrictionCoefficientEnum:
@@ -1704,7 +1744,7 @@
 						for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(FrictionCoefficientEnum)[penta_vertex_ids[j]-1];
 						for(j=0;j<6;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
 						for(j=0;j<6;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];
-						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case MaterialsRheologyBbarEnum:
@@ -1754,7 +1794,7 @@
 		DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum);
 		for(i=0;i<num_cm_responses;i++){
 			for(j=0;j<6;j++)nodeinputs[j]=iomodel->Data(InversionCostFunctionsCoefficientsEnum)[(penta_vertex_ids[j]-1)*num_cm_responses+i];
-			datasetinput->inputs->AddObject(new PentaVertexInput(InversionCostFunctionsCoefficientsEnum,nodeinputs));
+			datasetinput->inputs->AddObject(new PentaP1Input(InversionCostFunctionsCoefficientsEnum,nodeinputs));
 		}
 
 		/*Add datasetinput to element inputs*/
@@ -1899,9 +1939,9 @@
 	penta=this;
 	for(;;){
 		/*Add input to the element: */
-		penta->inputs->AddInput(new PentaVertexInput(ThicknessEnum,newthickness));
-		penta->inputs->AddInput(new PentaVertexInput(SurfaceEnum,newsurface));
-		penta->inputs->AddInput(new PentaVertexInput(BedEnum,newbed));
+		penta->inputs->AddInput(new PentaP1Input(ThicknessEnum,newthickness));
+		penta->inputs->AddInput(new PentaP1Input(SurfaceEnum,newsurface));
+		penta->inputs->AddInput(new PentaP1Input(BedEnum,newbed));
 
 		/*Stop if we have reached the surface*/
 		if (penta->IsOnSurface()) break;
@@ -1932,7 +1972,7 @@
 	}
 
 	/*Add input to the element: */
-	this->inputs->AddInput(new PentaVertexInput(enum_type,values));
+	this->inputs->AddInput(new PentaP1Input(enum_type,values));
 	
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -1965,7 +2005,7 @@
 	penta=this;
 	for(;;){
 		/*Add input to the element: */
-		penta->inputs->AddInput(new PentaVertexInput(enum_type,values));
+		penta->inputs->AddInput(new PentaP1Input(enum_type,values));
 
 		/*Stop if we have reached the surface*/
 		if (penta->IsOnSurface()) break;
@@ -1999,7 +2039,7 @@
 			}
 
 			/*update input*/
-			this->inputs->AddInput(new PentaVertexInput(name,values));
+			this->inputs->AddInput(new PentaP1Input(name,values));
 			return;
 
 		default:
@@ -2042,10 +2082,16 @@
 				name==VxEnum ||
 				name==VyEnum ||
 				name==VzEnum ||
+				name==VxMeshEnum ||
+				name==VyMeshEnum ||
+				name==VzMeshEnum ||
 				name==InversionVxObsEnum ||
 				name==InversionVyObsEnum ||
 				name==InversionVzObsEnum ||
 				name==TemperatureEnum ||
+				name==EnthalpyEnum ||
+				name==EnthalpyPicardEnum ||
+				name==WaterfractionEnum||
 				name==FrictionCoefficientEnum ||
 				name==GradientEnum ||
 				name==OldGradientEnum  ||
@@ -2152,7 +2198,7 @@
 			resultsenums[i]=elementresult->InstanceEnum();
 			resultstimes[i]=elementresult->GetTime();
 			resultssteps[i]=elementresult->GetStep();
-			if(elementresult->ObjectEnum()==PentaVertexElementResultEnum){
+			if(elementresult->ObjectEnum()==PentaP1ElementResultEnum){
 				resultssizes[i]=P1Enum;
 			}
 			else{
@@ -2236,12 +2282,12 @@
    /*Add basal melting rate if element just ungrounded*/
 	if(!this->IsFloating() && elementonshelf==true){
 		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
-		this->inputs->AddInput(new PentaVertexInput(BasalforcingsMeltingRateEnum,&melting[0]));
+		this->inputs->AddInput(new PentaP1Input(BasalforcingsMeltingRateEnum,&melting[0]));
 	} 
 
 	/*Update inputs*/
-	this->inputs->AddInput(new PentaVertexInput(SurfaceEnum,&s[0]));
-	this->inputs->AddInput(new PentaVertexInput(BedEnum,&b[0]));
+	this->inputs->AddInput(new PentaP1Input(SurfaceEnum,&s[0]));
+	this->inputs->AddInput(new PentaP1Input(BedEnum,&b[0]));
    this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
 
 	/*Extrude inputs*/
@@ -2331,6 +2377,12 @@
 	*pnumnodes=numnodes;
 }
 /*}}}*/
+/*FUNCTION Penta::PositiveDegreeDay{{{1*/
+void  Penta::PositiveDegreeDay(){
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
 /*FUNCTION Penta::PotentialSheetUngrounding{{{1*/
 void  Penta::PotentialSheetUngrounding(Vec potential_sheet_ungrounding){
 
@@ -2763,56 +2815,56 @@
 			/*default vx,vy and vz: either observation or 0 */
 			if(!iomodel->Data(VxEnum)){
 				for(i=0;i<6;i++)nodeinputs[i]=0;
-				this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs));
-				if(dakota_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVxEnum,nodeinputs));
+				this->inputs->AddInput(new PentaP1Input(VxEnum,nodeinputs));
+				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVxEnum,nodeinputs));
 			}
 			if(!iomodel->Data(VyEnum)){
 				for(i=0;i<6;i++)nodeinputs[i]=0;
-				this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs));
-				if(dakota_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVyEnum,nodeinputs));
+				this->inputs->AddInput(new PentaP1Input(VyEnum,nodeinputs));
+				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVyEnum,nodeinputs));
 			}
 			if(!iomodel->Data(VzEnum)){
 				for(i=0;i<6;i++)nodeinputs[i]=0;
-				this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs));
-				if(dakota_analysis) this->inputs->AddInput(new PentaVertexInput(QmuVzEnum,nodeinputs));
+				this->inputs->AddInput(new PentaP1Input(VzEnum,nodeinputs));
+				if(dakota_analysis) this->inputs->AddInput(new PentaP1Input(QmuVzEnum,nodeinputs));
 			}
 			if(!iomodel->Data(PressureEnum)){
 				for(i=0;i<6;i++)nodeinputs[i]=0;
 				if(dakota_analysis){
-					this->inputs->AddInput(new PentaVertexInput(PressureEnum,nodeinputs));
-					this->inputs->AddInput(new PentaVertexInput(QmuPressureEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(PressureEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(QmuPressureEnum,nodeinputs));
 				}
 				if(isstokes){
-					this->inputs->AddInput(new PentaVertexInput(PressureEnum,nodeinputs));
-					this->inputs->AddInput(new PentaVertexInput(PressurePicardEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(PressureEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(PressurePicardEnum,nodeinputs));
 				}
 			}
 			if(*(iomodel->Data(FlowequationElementEquationEnum)+index)==PattynStokesApproximationEnum){
 				/*Create VzPattyn and VzStokes Enums*/
 				if(iomodel->Data(VzEnum) && iomodel->Data(FlowequationBorderstokesEnum)){
 					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1];
-					this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
 					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1]);
-					this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzPattynEnum,nodeinputs));
 				}
 				else{
 					for(i=0;i<6;i++)nodeinputs[i]=0;
-					this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
-					this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzPattynEnum,nodeinputs));
 				}
 			}
 			if(*(iomodel->Data(FlowequationElementEquationEnum)+index)==MacAyealStokesApproximationEnum){
 				/*Create VzMacAyeal and VzStokes Enums*/
 				if(iomodel->Data(VzEnum) && iomodel->Data(FlowequationBorderstokesEnum)){
 					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1];
-					this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
 					for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data(VzEnum)[penta_vertex_ids[i]-1]/yts*(1-iomodel->Data(FlowequationBorderstokesEnum)[penta_vertex_ids[i]-1]);
-					this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,nodeinputs));
 				}
 				else{
 					for(i=0;i<6;i++)nodeinputs[i]=0;
-					this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,nodeinputs));
-					this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzStokesEnum,nodeinputs));
+					this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,nodeinputs));
 				}
 			}
 			break;
@@ -2820,18 +2872,18 @@
 		case ThermalAnalysisEnum:
 			/*Initialize mesh velocity*/
 			for(i=0;i<6;i++)nodeinputs[i]=0;
-			this->inputs->AddInput(new PentaVertexInput(VxMeshEnum,nodeinputs));
-			this->inputs->AddInput(new PentaVertexInput(VyMeshEnum,nodeinputs));
-			this->inputs->AddInput(new PentaVertexInput(VzMeshEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(VxMeshEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(VyMeshEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(VzMeshEnum,nodeinputs));
 			break;
 
 		case EnthalpyAnalysisEnum:
 			/*Initialize mesh velocity*/
 			for(i=0;i<6;i++)nodeinputs[i]=0;
-			this->inputs->AddInput(new PentaVertexInput(VxMeshEnum,nodeinputs));
-			this->inputs->AddInput(new PentaVertexInput(VyMeshEnum,nodeinputs));
-			this->inputs->AddInput(new PentaVertexInput(VzMeshEnum,nodeinputs));
-			if (iomodel->Data(TemperatureEnum) && iomodel->Data(WaterfractionEnum)) {
+			this->inputs->AddInput(new PentaP1Input(VxMeshEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(VyMeshEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(VzMeshEnum,nodeinputs));
+			if (iomodel->Data(TemperatureEnum) && iomodel->Data(WaterfractionEnum) && iomodel->Data(PressureEnum)) {
 				for(i=0;i<6;i++){
 					if(iomodel->Data(TemperatureEnum)[penta_vertex_ids[i]-1] < meltingpoint-beta*iomodel->Data(PressureEnum)[penta_vertex_ids[i]-1]){
 						nodeinputs[i]=heatcapacity*(iomodel->Data(TemperatureEnum)[penta_vertex_ids[i]-1]-referencetemperature);
@@ -2840,7 +2892,7 @@
 					 (meltingpoint-beta*iomodel->Data(PressureEnum)[penta_vertex_ids[i]-1]-referencetemperature)
 						+latentheat*iomodel->Data(WaterfractionEnum)[penta_vertex_ids[i]-1];
 				}
-				this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,nodeinputs));
+				this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,nodeinputs));
 			}
 			else _error_("temperature and waterfraction required for the enthalpy solution");
 			break;
@@ -2913,12 +2965,17 @@
 	}
 
 	/*Create PentaVertex input, which will hold the basal friction:*/
-	this->inputs->AddInput(new PentaVertexInput(ViscousHeatingEnum,&viscousheating[0]));
+	this->inputs->AddInput(new PentaP1Input(ViscousHeatingEnum,&viscousheating[0]));
 
 	/*Clean up and return*/
 	delete gauss;
 }
 /*}}}*/
+/*FUNCTION Penta::SmearFunction {{{1*/
+void  Penta::SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius){
+	_error_("not implemented yet");
+}
+/*}}}1*/
 
 #ifdef _HAVE_RESPONSES_
 /*FUNCTION Penta::IceVolume {{{1*/
@@ -3197,6 +3254,7 @@
 	int        stabilization;
 	int        i,j,ig,found=0;
 	double     Jdet,u,v,w,um,vm,wm;
+	double     h,hx,hy,hz,vx,vy,vz,vel;
 	double     gravity,rho_ice,rho_water;
 	double     epsvel=2.220446049250313e-16;
 	double     heatcapacity,thermalconductivity,dt;
@@ -3204,18 +3262,15 @@
 	double     latentheat,kappa;
 	double     tau_parameter,diameter;
 	double     xyz_list[NUMVERTICES][3];
-	double     B[3][numdof];
-	double     Bprime[3][numdof];
 	double     B_conduct[3][numdof];
 	double     B_advec[3][numdof];
-	double     B_stab[2][numdof];
 	double     Bprime_advec[3][numdof];
 	double     L[numdof];
 	double     dbasis[3][6];
 	double     D_scalar_conduct,D_scalar_advec;
 	double     D_scalar_trans,D_scalar_stab;
 	double     D[3][3];
-	double     K[2][2]={0.0};
+	double     K[3][3]={0.0};
 	Tria*      tria=NULL;
 	GaussPenta *gauss=NULL;
 
@@ -3233,7 +3288,7 @@
 	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
 	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
 	Input* pressure_input=inputs->GetInput(PressureEnum);      _assert_(pressure_input);
-	Input* enthalpy_input=inputs->GetInput(EnthalpyEnum);      _assert_(enthalpy_input);
+	Input* enthalpy_input=inputs->GetInput(EnthalpyPicardEnum);_assert_(enthalpy_input); //for this iteration of the step
 	Input* vx_input=inputs->GetInput(VxEnum);                  _assert_(vx_input);
 	Input* vy_input=inputs->GetInput(VyEnum);                  _assert_(vy_input);
 	Input* vz_input=inputs->GetInput(VzEnum);                  _assert_(vz_input);
@@ -3252,7 +3307,6 @@
 
 		/*Conduction: */  
 		/*Need to change that depending on enthalpy value -> cold or temperate ice: */  
-
 		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
 
 		enthalpy_input->GetInputValue(&enthalpy, gauss);
@@ -3271,23 +3325,19 @@
 					&Ke->values[0],1);
 
 		/*Advection: */
-
 		GetBAdvec(&B_advec[0][0],&xyz_list[0][0],gauss); 
 		GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
 
-		vx_input->GetInputValue(&u, gauss);
-		vy_input->GetInputValue(&v, gauss);
-		vz_input->GetInputValue(&w, gauss);
-		vxm_input->GetInputValue(&um,gauss);
-		vym_input->GetInputValue(&vm,gauss);
-		vzm_input->GetInputValue(&wm,gauss);
+		vx_input->GetInputValue(&u, gauss); vxm_input->GetInputValue(&um,gauss); vx=u-um; 
+		vy_input->GetInputValue(&v, gauss); vym_input->GetInputValue(&vm,gauss); vy=v-vm; 
+		vz_input->GetInputValue(&w, gauss); vzm_input->GetInputValue(&wm,gauss); vz=w-wm;
 
 		D_scalar_advec=gauss->weight*Jdet;
 		if(dt) D_scalar_advec=D_scalar_advec*dt;
 
-		D[0][0]=D_scalar_advec*(u-um);D[0][1]=0;                    D[0][2]=0;
-		D[1][0]=0;                    D[1][1]=D_scalar_advec*(v-vm);D[1][2]=0;
-		D[2][0]=0;                    D[2][1]=0;                    D[2][2]=D_scalar_advec*(w-wm);
+		D[0][0]=D_scalar_advec*vx;D[0][1]=0;                D[0][2]=0;
+		D[1][0]=0;                D[1][1]=D_scalar_advec*vy;D[1][2]=0;
+		D[2][0]=0;                D[2][1]=0;                D[2][2]=D_scalar_advec*vz;
 
 		TripleMultiply(&B_advec[0][0],3,numdof,1,
 					&D[0][0],3,3,0,
@@ -3295,7 +3345,6 @@
 					&Ke->values[0],1);
 
 		/*Transient: */
-
 		if(dt){
 			GetNodalFunctionsP1(&L[0], gauss);
 			D_scalar_trans=gauss->weight*Jdet;
@@ -3308,28 +3357,29 @@
 		}
 
 		/*Artifficial diffusivity*/
-
 		if(stabilization==1){
 			/*Build K: */
-			D_scalar_stab=gauss->weight*Jdet/(pow(u-um,2)+pow(v-vm,2)+epsvel);
+			GetElementSizes(&hx,&hy,&hz);
+			vel=sqrt(pow(vx,2.)+pow(vy,2.)+pow(vz,2.))+1.e-14;
+			h=sqrt( pow(hx*vx/vel,2.) + pow(hy*vy/vel,2.) + pow(hz*vz/vel,2.));
+			K[0][0]=h/(2*vel)*vx*vx;  K[0][1]=h/(2*vel)*vx*vy; K[0][2]=h/(2*vel)*vx*vz;
+			K[1][0]=h/(2*vel)*vy*vx;  K[1][1]=h/(2*vel)*vy*vy; K[1][2]=h/(2*vel)*vy*vz;
+			K[2][0]=h/(2*vel)*vz*vx;  K[2][1]=h/(2*vel)*vz*vy; K[2][2]=h/(2*vel)*vz*vz;
+			D_scalar_stab=gauss->weight*Jdet;
 			if(dt) D_scalar_stab=D_scalar_stab*dt;
-			K[0][0]=D_scalar_stab*pow(u,2);       K[0][1]=D_scalar_stab*fabs(u)*fabs(v);
-			K[1][0]=D_scalar_stab*fabs(u)*fabs(v);K[1][1]=D_scalar_stab*pow(v,2);
-			_error_("TO BE RECODED");
+			for(i=0;i<3;i++) for(j=0;j<3;j++) K[i][j] = D_scalar_stab*K[i][j];
 
-			//GetBArtdiff(&B_stab[0][0],&xyz_list[0][0],gauss); 
+			GetBprimeAdvec(&Bprime_advec[0][0],&xyz_list[0][0],gauss); 
 
-			TripleMultiply(&B_stab[0][0],2,numdof,1,
-						&K[0][0],2,2,0,
-						&B_stab[0][0],2,numdof,0,
+			TripleMultiply(&Bprime_advec[0][0],3,numdof,1,
+						&K[0][0],3,3,0,
+						&Bprime_advec[0][0],3,numdof,0,
 						&Ke->values[0],1);
 		}
 		else if(stabilization==2){
-
 			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
+			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
 
-			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,rho_ice,heatcapacity,thermalconductivity);
-
 			for(i=0;i<numdof;i++){
 				for(j=0;j<numdof;j++){
 					Ke->values[i*numdof+j]+=tau_parameter*D_scalar_advec*
@@ -3442,15 +3492,12 @@
 	int        i,j,ig,found=0;
 	double     Jdet,u,v,w,um,vm,wm,vel;
 	double     h,hx,hy,hz,vx,vy,vz;
-	double     gravity,rho_ice,rho_water;
+	double     gravity,rho_ice,rho_water,kappa;
 	double     heatcapacity,thermalconductivity,dt;
 	double     tau_parameter,diameter;
 	double     xyz_list[NUMVERTICES][3];
-	double     B[3][numdof];
-	double     Bprime[3][numdof];
 	double     B_conduct[3][numdof];
 	double     B_advec[3][numdof];
-	double     B_stab[2][numdof];
 	double     Bprime_advec[3][numdof];
 	double     L[numdof];
 	double     dbasis[3][6];
@@ -3471,6 +3518,7 @@
 	gravity=matpar->GetG();
 	heatcapacity=matpar->GetHeatCapacity();
 	thermalconductivity=matpar->GetThermalConductivity();
+	kappa=thermalconductivity/(rho_ice*heatcapacity);
 	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
 	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
 	Input* vx_input=inputs->GetInput(VxEnum);      _assert_(vx_input);
@@ -3493,7 +3541,7 @@
 
 		GetBConduct(&B_conduct[0][0],&xyz_list[0][0],gauss); 
 
-		D_scalar_conduct=gauss->weight*Jdet*(thermalconductivity/(rho_ice*heatcapacity));
+		D_scalar_conduct=gauss->weight*Jdet*kappa;
 		if(dt) D_scalar_conduct=D_scalar_conduct*dt;
 
 		D[0][0]=D_scalar_conduct; D[0][1]=0; D[0][2]=0;
@@ -3527,7 +3575,6 @@
 					&Ke->values[0],1);
 
 		/*Transient: */
-
 		if(dt){
 			GetNodalFunctionsP1(&L[0], gauss);
 			D_scalar_trans=gauss->weight*Jdet;
@@ -3540,7 +3587,6 @@
 		}
 
 		/*Artifficial diffusivity*/
-
 		if(stabilization==1){
 			/*Build K: */
 			GetElementSizes(&hx,&hy,&hz);
@@ -3564,7 +3610,7 @@
 		}
 		else if(stabilization==2){
 			GetNodalFunctionsP1Derivatives(&dbasis[0][0],&xyz_list[0][0], gauss);
-			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,rho_ice,heatcapacity,thermalconductivity);
+			tau_parameter=GetStabilizationParameter(u-um,v-vm,w-wm,diameter,kappa);
 
 			for(i=0;i<numdof;i++){
 				for(j=0;j<numdof;j++){
@@ -3669,8 +3715,9 @@
 	int    friction_type,stabilization;
 	double Jdet,phi,dt;
 	double rho_ice,heatcapacity;
-	double thermalconductivity;
-	double viscosity,temperature;
+	double thermalconductivity,kappa;
+	double viscosity,pressure;
+	double enthalpy,enthalpypicard;
 	double tau_parameter,diameter;
 	double u,v,w;
 	double scalar_def,scalar_transient;
@@ -3691,12 +3738,19 @@
 	thermalconductivity=matpar->GetThermalConductivity();
 	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
 	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
-	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
-	Input* vy_input=inputs->GetInput(VyEnum); _assert_(vy_input);
-	Input* vz_input=inputs->GetInput(VzEnum); _assert_(vz_input);
-	Input* temperature_input=NULL;
-	if (dt) temperature_input=inputs->GetInput(TemperatureEnum); _assert_(inputs);
-	if (stabilization==2) diameter=MinEdgeLength(xyz_list);
+	Input* vx_input=inputs->GetInput(VxEnum);                                  _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);                                  _assert_(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);                                  _assert_(vz_input);
+	Input* pressure_input=inputs->GetInput(PressureEnum);                      _assert_(pressure_input);
+	Input* enthalpy_input=NULL; 
+	Input* enthalpypicard_input=NULL; 
+	if(dt){
+		enthalpy_input=inputs->GetInput(EnthalpyEnum); _assert_(enthalpy_input);
+	}
+	if (stabilization==2){
+		diameter=MinEdgeLength(xyz_list);
+		enthalpypicard_input=inputs->GetInput(EnthalpyPicardEnum); _assert_(enthalpypicard_input);
+	}
 
 	/* Start  looping on the number of gaussian points: */
 	gauss=new GaussPenta(2,3);
@@ -3711,15 +3765,15 @@
 		matice->GetViscosity3dStokes(&viscosity,&epsilon[0]);
 		GetPhi(&phi, &epsilon[0], viscosity);
 
-		scalar_def=phi/(rho_ice)*Jdet*gauss->weight;
+		scalar_def=phi/rho_ice*Jdet*gauss->weight;
 		if(dt) scalar_def=scalar_def*dt;
 
 		for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_def*L[i];
 
 		/* Build transient now */
 		if(dt){
-			temperature_input->GetInputValue(&temperature, gauss);
-			scalar_transient=temperature*Jdet*gauss->weight;
+			enthalpy_input->GetInputValue(&enthalpy, gauss);
+			scalar_transient=enthalpy*Jdet*gauss->weight;
 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=scalar_transient*L[i];
 		}
 
@@ -3729,9 +3783,11 @@
 			vx_input->GetInputValue(&u, gauss);
 			vy_input->GetInputValue(&v, gauss);
 			vz_input->GetInputValue(&w, gauss);
+			pressure_input->GetInputValue(&pressure, gauss);
+			enthalpypicard_input->GetInputValue(&enthalpypicard, gauss);
+			kappa=matpar->GetEnthalpyDiffusionParameter(enthalpy,pressure);
+			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
 
-			tau_parameter=GetStabilizationParameter(u,v,w,diameter,rho_ice,heatcapacity,thermalconductivity);
-
 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
 			if(dt){
 				for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_transient*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
@@ -3761,12 +3817,12 @@
 	double     basis[NUMVERTICES];
 	GaussPenta* gauss=NULL;
 
+	/* Ice/ocean heat exchange flux on ice shelf base */
+	if (!IsOnBed() || !IsFloating()) return NULL;
+
 	/*Initialize Element vector*/
 	ElementVector* pe=new ElementVector(nodes,NUMVERTICES,this->parameters);
 
-	/* Ice/ocean heat exchange flux on ice shelf base */
-	if (!IsOnBed() || !IsFloating()) return NULL;
-
 	/*Retrieve all inputs and parameters*/
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
 	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<3;j++) xyz_list_tria[i][j]=xyz_list[i][j];
@@ -3815,10 +3871,12 @@
 	double     Jdet2d,dt;
 	double     rho_ice,heatcapacity,geothermalflux_value;
 	double     basalfriction,alpha2,vx,vy;
-	double     scalar;
+	double     scalar,enthalpy,enthalpyup;
+	double     pressure,pressureup;
 	double     basis[NUMVERTICES];
 	Friction*  friction=NULL;
 	GaussPenta* gauss=NULL;
+	GaussPenta* gaussup=NULL;
 
 	/* Geothermal flux on ice sheet base and basal friction */
 	if (!IsOnBed() || IsFloating()) return NULL;
@@ -3836,6 +3894,8 @@
 	Input* vx_input=inputs->GetInput(VxEnum);                         _assert_(vx_input);
 	Input* vy_input=inputs->GetInput(VyEnum);                         _assert_(vy_input);
 	Input* vz_input=inputs->GetInput(VzEnum);                         _assert_(vz_input);
+	Input* enthalpy_input=inputs->GetInput(EnthalpyEnum);             _assert_(enthalpy_input);
+	Input* pressure_input=inputs->GetInput(PressureEnum);             _assert_(pressure_input);
 	Input* geothermalflux_input=inputs->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
 
 	/*Build frictoin element, needed later: */
@@ -3843,27 +3903,45 @@
 
 	/* Start looping on the number of gauss 2d (nodes on the bedrock) */
 	gauss=new GaussPenta(0,1,2,2);
+	gaussup=new GaussPenta(3,4,5,2);
 	for(ig=gauss->begin();ig<gauss->end();ig++){
 
 		gauss->GaussPoint(ig);
+		gaussup->GaussPoint(ig);
 
 		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
 		GetNodalFunctionsP1(&basis[0], gauss);
 
-		geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
-		friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-		basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
-		
-		scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
-		if(dt) scalar=dt*scalar;
+		enthalpy_input->GetInputValue(&enthalpy,gauss);
+		pressure_input->GetInputValue(&pressure,gauss);
+//		if(enthalpy>matpar->PureIceEnthalpy(pressure)){
+//			enthalpy_input->GetInputValue(&enthalpyup,gaussup);
+//			pressure_input->GetInputValue(&pressureup,gaussup);
+//			if(enthalpyup>matpar->PureIceEnthalpy(pressureup)){
+//				//do nothing, don't add heatflux
+//			}
+//			else{
+//				//need to change spcenthalpy according to Aschwanden 
+//				//NEED TO UPDATE
+//			}
+//		}
+//		else{
+			geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
+			friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
+			vx_input->GetInputValue(&vx,gauss);
+			vy_input->GetInputValue(&vy,gauss);
+			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
 
-		for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(rho_ice);
+			if(dt) scalar=dt*scalar;
+
+			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+//		}
 	}
 
 	/*Clean up and return*/
 	delete gauss;
+	delete gaussup;
 	delete friction;
 	return pe;
 }
@@ -3900,7 +3978,7 @@
 	int    friction_type,stabilization;
 	double Jdet,phi,dt;
 	double rho_ice,heatcapacity;
-	double thermalconductivity;
+	double thermalconductivity,kappa;
 	double viscosity,temperature;
 	double tau_parameter,diameter;
 	double u,v,w;
@@ -3920,6 +3998,7 @@
 	rho_ice=matpar->GetRhoIce();
 	heatcapacity=matpar->GetHeatCapacity();
 	thermalconductivity=matpar->GetThermalConductivity();
+	kappa=thermalconductivity/(rho_ice*heatcapacity);
 	this->parameters->FindParam(&dt,TimesteppingTimeStepEnum);
 	this->parameters->FindParam(&stabilization,ThermalStabilizationEnum);
 	Input* vx_input=inputs->GetInput(VxEnum); _assert_(vx_input);
@@ -3961,7 +4040,7 @@
 			vy_input->GetInputValue(&v, gauss);
 			vz_input->GetInputValue(&w, gauss);
 
-			tau_parameter=GetStabilizationParameter(u,v,w,diameter,rho_ice,heatcapacity,thermalconductivity);
+			tau_parameter=GetStabilizationParameter(u,v,w,diameter,kappa);
 
 			for(i=0;i<NUMVERTICES;i++)  pe->values[i]+=tau_parameter*scalar_def*(u*dbasis[0][i]+v*dbasis[1][i]+w*dbasis[2][i]);
 			if(dt){
@@ -4046,8 +4125,8 @@
 	double     Jdet2d,dt;
 	double     rho_ice,heatcapacity,geothermalflux_value;
 	double     basalfriction,alpha2,vx,vy;
+	double     basis[NUMVERTICES];
 	double     scalar;
-	double     basis[NUMVERTICES];
 	Friction*  friction=NULL;
 	GaussPenta* gauss=NULL;
 
@@ -4081,16 +4160,16 @@
 		GetTriaJacobianDeterminant(&Jdet2d, &xyz_list_tria[0][0], gauss);
 		GetNodalFunctionsP1(&basis[0], gauss);
 
-		geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
-		friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
-		vx_input->GetInputValue(&vx,gauss);
-		vy_input->GetInputValue(&vy,gauss);
-		basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
-		
-		scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice);
-		if(dt) scalar=dt*scalar;
+			geothermalflux_input->GetInputValue(&geothermalflux_value,gauss);
+			friction->GetAlpha2(&alpha2,gauss,VxEnum,VyEnum,VzEnum);
+			vx_input->GetInputValue(&vx,gauss);
+			vy_input->GetInputValue(&vy,gauss);
+			basalfriction=alpha2*(pow(vx,2.0)+pow(vy,2.0));
 
-		for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
+			scalar=gauss->weight*Jdet2d*(basalfriction+geothermalflux_value)/(heatcapacity*rho_ice);
+			if(dt) scalar=dt*scalar;
+
+			for(i=0;i<numdof;i++) pe->values[i]+=scalar*basis[i];
 	}
 
 	/*Clean up and return*/
@@ -4197,7 +4276,7 @@
 
 	this->inputs->GetInputValue(&converged,ConvergedEnum);
 	if(converged){
-		this->inputs->AddInput(new PentaVertexInput(TemperatureEnum,values));
+		this->inputs->AddInput(new PentaP1Input(TemperatureEnum,values));
 
 		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
 		 * otherwise the rheology could be negative*/
@@ -4209,7 +4288,7 @@
 			case PatersonEnum:
 				B_average=Paterson((values[0]+values[1]+values[2]+values[3]+values[4]+values[5])/6.0);
 				for(i=0;i<numdof;i++) B[i]=B_average;
-				this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
+				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
 				break;
 			case ArrheniusEnum:
 				surface_input->GetInputAverage(&s_average);
@@ -4217,7 +4296,7 @@
 							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
 							matice->GetN());
 				for(i=0;i<numdof;i++) B[i]=B_average;
-				this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
+				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
 				break;
 			default:
 				_error_("Rheology law %s not supported yet",EnumToStringx(rheology_law));
@@ -4225,7 +4304,7 @@
 		}
 	}
 	else{
-		this->inputs->AddInput(new PentaVertexInput(TemperaturePicardEnum,values));
+		this->inputs->AddInput(new PentaP1Input(TemperaturePicardEnum,values));
 	}
 
 	/*Free ressources:*/
@@ -4237,7 +4316,7 @@
 
 	const int    numdof=NDOF1*NUMVERTICES;
 
-	bool   converged;
+	bool   converged=false;
 	int    i,rheology_law;
 	double xyz_list[NUMVERTICES][3];
 	double values[numdof];
@@ -4264,15 +4343,18 @@
 	GetInputListOnVertices(&pressure[0],PressureEnum);
 	Input* surface_input=inputs->GetInput(SurfaceEnum); _assert_(surface_input);
 	
-
-//	this->inputs->GetInputValue(&converged,ConvergedEnum);
-//	if(converged){
+	this->inputs->GetInputValue(&converged,ConvergedEnum);
+	if(converged){
 		/*Convert enthalpy into temperature and water fraction*/
-		for(i=0;i<numdof;i++) matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]);
+		for(i=0;i<numdof;i++){
+			matpar->EnthalpyToThermal(&temperatures[i],&waterfraction[i],values[i],pressure[i]);
+			if(waterfraction[i]<0) _error_("Negative water fraction found in solution vector");
+			//if(waterfraction[i]>1) _error_("Water fraction >1 found in solution vector");
+		}
 			
-		this->inputs->AddInput(new PentaVertexInput(EnthalpyEnum,values));
-		this->inputs->AddInput(new PentaVertexInput(WaterfractionEnum,waterfraction));
-		this->inputs->AddInput(new PentaVertexInput(TemperatureEnum,temperatures));
+		this->inputs->AddInput(new PentaP1Input(EnthalpyEnum,values));
+		this->inputs->AddInput(new PentaP1Input(WaterfractionEnum,waterfraction));
+		this->inputs->AddInput(new PentaP1Input(TemperatureEnum,temperatures));
 
 		/*Update Rheology only if converged (we must make sure that the temperature is below melting point
 		 * otherwise the rheology could be negative*/
@@ -4284,7 +4366,7 @@
 			case PatersonEnum:
 				B_average=Paterson((temperatures[0]+temperatures[1]+temperatures[2]+temperatures[3]+temperatures[4]+temperatures[5])/6.0);
 				for(i=0;i<numdof;i++) B[i]=B_average;
-				this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
+				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
 				break;
 			case ArrheniusEnum:
 				surface_input->GetInputAverage(&s_average);
@@ -4292,16 +4374,16 @@
 							s_average-((xyz_list[0][2]+xyz_list[1][2]+xyz_list[2][2]+xyz_list[3][2]+xyz_list[4][2]+xyz_list[5][2])/6.0),
 							matice->GetN());
 				for(i=0;i<numdof;i++) B[i]=B_average;
-				this->matice->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,B));
+				this->matice->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,B));
 				break;
 			default:
 				_error_("Rheology law %s not supported yet",EnumToStringx(rheology_law));
 
 		}
-//	}
-//	else{
-//		this->inputs->AddInput(new PentaVertexInput(EnthalpyPicardEnum,values));
-//	}
+	}
+	else{
+		this->inputs->AddInput(new PentaP1Input(EnthalpyPicardEnum,values));
+	}
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -4311,7 +4393,7 @@
 
 #ifdef _HAVE_CONTROL_
 /*FUNCTION Penta::ControlInputGetGradient{{{1*/
-void Penta::ControlInputGetGradient(Vec gradient,int enum_type){
+void Penta::ControlInputGetGradient(Vec gradient,int enum_type,int control_index){
 
 	int doflist1[NUMVERTICES];
 	Input* input=NULL;
@@ -4326,7 +4408,7 @@
 	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
 	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
 
-	this->GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
 
 }/*}}}*/
@@ -4347,7 +4429,7 @@
 	((ControlInput*)input)->ScaleGradient(scale);
 }/*}}}*/
 /*FUNCTION Penta::ControlInputSetGradient{{{1*/
-void Penta::ControlInputSetGradient(double* gradient,int enum_type){
+void Penta::ControlInputSetGradient(double* gradient,int enum_type,int control_index){
 
 	int    doflist1[NUMVERTICES];
 	double grad_list[NUMVERTICES];
@@ -4363,12 +4445,202 @@
 	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
 	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
 
-	this->GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
-	grad_input=new PentaVertexInput(GradientEnum,grad_list);
+	grad_input=new PentaP1Input(GradientEnum,grad_list);
 	((ControlInput*)input)->SetGradient(grad_input);
 
 }/*}}}*/
+/*FUNCTION Penta::CreateKMatrixAdjointHoriz{{{1*/
+ElementMatrix* Penta::CreateKMatrixAdjointHoriz(void){
+
+	int approximation;
+	inputs->GetInputValue(&approximation,ApproximationEnum);
+
+	switch(approximation){
+		case MacAyealApproximationEnum:
+			return CreateKMatrixAdjointMacAyeal2d();
+		case PattynApproximationEnum:
+			return CreateKMatrixAdjointPattyn();
+		case StokesApproximationEnum:
+			return CreateKMatrixAdjointStokes();
+		case NoneApproximationEnum:
+			return NULL;
+		default:
+			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+	}
+}
+/*}}}*/
+/*FUNCTION Penta::CreateKMatrixAdjointMacAyeal2d{{{1*/
+ElementMatrix* Penta::CreateKMatrixAdjointMacAyeal2d(void){
+
+	/*Figure out if this penta 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 nodes, and use it to build 
+	  the stiffness matrix. */
+	if (!IsOnBed()) return NULL;
+
+	/*Depth Averaging B*/
+	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+
+	/*Call Tria function*/
+	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+	ElementMatrix* Ke=tria->CreateKMatrixAdjointMacAyeal();
+	delete tria->matice; delete tria;
+
+	/*Delete B averaged*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*clean up and return*/
+	return Ke;
+}
+/*}}}*/
+/*FUNCTION Penta::CreateKMatrixAdjointPattyn{{{1*/
+ElementMatrix* Penta::CreateKMatrixAdjointPattyn(void){
+
+	/*Constants*/
+	const int    numdof=NDOF2*NUMVERTICES;
+
+	/*Intermediaries */
+	int        i,j,ig;
+	bool       incomplete_adjoint;
+	double     xyz_list[NUMVERTICES][3];
+	double     Jdet;
+	double     eps1dotdphii,eps1dotdphij;
+	double     eps2dotdphii,eps2dotdphij;
+	double     mu_prime;
+	double     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+	double     eps1[3],eps2[3];
+	double     phi[NUMVERTICES];
+	double     dphi[3][NUMVERTICES];
+	GaussPenta *gauss=NULL;
+
+	/*Initialize Jacobian with regular Pattyn (first part of the Gateau derivative)*/
+	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+	ElementMatrix* Ke=CreateKMatrixDiagnosticPattyn();
+	if(incomplete_adjoint) return Ke;
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussPenta(5,5);
+	for (ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+
+		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
+
+		for(i=0;i<6;i++){
+			for(j=0;j<6;j++){
+				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+
+				Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+				Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+				Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+				Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+
+	/*Clean up and return*/
+	delete gauss;
+	return Ke;
+}
+/*}}}*/
+/*FUNCTION Penta::CreateKMatrixAdjointStokes{{{1*/
+ElementMatrix* Penta::CreateKMatrixAdjointStokes(void){
+
+	/*Constants*/
+	const int    numdof=NDOF4*NUMVERTICES;
+
+	/*Intermediaries */
+	int        i,j,ig;
+	bool       incomplete_adjoint;
+	double     xyz_list[NUMVERTICES][3];
+	double     Jdet;
+	double     eps1dotdphii,eps1dotdphij;
+	double     eps2dotdphii,eps2dotdphij;
+	double     eps3dotdphii,eps3dotdphij;
+	double     mu_prime;
+	double     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+	double     eps1[3],eps2[3],eps3[3];
+	double     phi[NUMVERTICES];
+	double     dphi[3][NUMVERTICES];
+	GaussPenta *gauss=NULL;
+
+	/*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/
+	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+	ElementMatrix* Ke=CreateKMatrixDiagnosticStokes();
+	if(incomplete_adjoint) return Ke;
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);       _assert_(vz_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussPenta(5,5);
+	for (ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+
+		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
+		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
+		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
+
+		for(i=0;i<6;i++){
+			for(j=0;j<6;j++){
+				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+				eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i];
+				eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j];
+
+				Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+				Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+				Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii;
+
+				Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+				Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+				Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii;
+
+				Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii;
+				Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii;
+				Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii;
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
+
+	/*Clean up and return*/
+	delete gauss;
+	return Ke;
+}
+/*}}}*/
 /*FUNCTION Penta::CreatePVectorAdjointHoriz{{{1*/
 ElementVector* Penta::CreatePVectorAdjointHoriz(void){
 
@@ -4431,8 +4703,22 @@
 	return pe;
 }
 /*}}}*/
+/*FUNCTION Penta::GradientIndexing{{{1*/
+void Penta::GradientIndexing(int* indexing,int control_index){
+
+	/*Get some parameters*/
+	int num_controls;
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+
+	/*get gradient indices*/
+	for(int i=0;i<NUMVERTICES;i++){
+		indexing[i]=num_controls*this->nodes[i]->GetVertexDof() + control_index;
+	}
+
+}
+/*}}}*/
 /*FUNCTION Penta::Gradj {{{1*/
-void  Penta::Gradj(Vec gradient,int control_type){
+void  Penta::Gradj(Vec gradient,int control_type,int control_index){
 	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
 
 	int              i,approximation;
@@ -4448,13 +4734,13 @@
 			inputs->GetInputValue(&approximation,ApproximationEnum);
 			switch(approximation){
 				case MacAyealApproximationEnum:
-					GradjDragMacAyeal(gradient);
+					GradjDragMacAyeal(gradient,control_index);
 					break;
 				case PattynApproximationEnum:
-					GradjDragPattyn(gradient);
+					GradjDragPattyn(gradient,control_index);
 					break;
 				case StokesApproximationEnum:
-					GradjDragStokes(gradient);
+					GradjDragStokes(gradient,control_index);
 					break;
 				case NoneApproximationEnum:
 					/*Gradient is 0*/
@@ -4468,13 +4754,13 @@
 			inputs->GetInputValue(&approximation,ApproximationEnum);
 			switch(approximation){
 				case MacAyealApproximationEnum:
-					GradjBbarMacAyeal(gradient);
+					GradjBbarMacAyeal(gradient,control_index);
 					break;
 				case PattynApproximationEnum:
-					GradjBbarPattyn(gradient);
+					GradjBbarPattyn(gradient,control_index);
 					break;
 				case StokesApproximationEnum:
-					GradjBbarStokes(gradient);
+					GradjBbarStokes(gradient,control_index);
 					break;
 				case NoneApproximationEnum:
 					/*Gradient is 0*/
@@ -4507,13 +4793,13 @@
 		case DragCoefficientAbsGradientEnum:
 			if (!IsOnBed()) return;
 			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
-			tria->GradjDragGradient(gradient,resp);
+			tria->GradjDragGradient(gradient,resp,control_index);
 			delete tria->matice; delete tria;
 			break;
 		case RheologyBbarAbsGradientEnum:
 			if (!IsOnBed()) return;
 			tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
-			tria->GradjBGradient(gradient,resp);
+			tria->GradjBGradient(gradient,resp,control_index);
 			delete tria->matice; delete tria;
 			break;
 		default:
@@ -4523,19 +4809,19 @@
 }
 /*}}}*/
 /*FUNCTION Penta::GradjDragMacAyeal {{{1*/
-void  Penta::GradjDragMacAyeal(Vec gradient){
+void  Penta::GradjDragMacAyeal(Vec gradient,int control_index){
 
 	/*Gradient is 0 if on shelf or not on bed*/
 	if(IsFloating() || !IsOnBed()) return;
 
 	/*Spawn tria*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
-	tria->GradjDragMacAyeal(gradient);
+	tria->GradjDragMacAyeal(gradient,control_index);
 	delete tria->matice; delete tria;
 
 } /*}}}*/
 /*FUNCTION Penta::GradjDragPattyn {{{1*/
-void  Penta::GradjDragPattyn(Vec gradient){
+void  Penta::GradjDragPattyn(Vec gradient,int control_index){
 
 	int        i,j,ig;
 	int        analysis_type;
@@ -4556,9 +4842,9 @@
 
 	/*Retrieve all inputs and parameters*/
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+	GradientIndexing(&doflist1[0],control_index);
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
 	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
-	GetDofList1(&doflist1[0]);
 	Input* adjointx_input=inputs->GetInput(AdjointxEnum);               _assert_(adjointx_input);
 	Input* adjointy_input=inputs->GetInput(AdjointyEnum);               _assert_(adjointy_input);
 	Input* vx_input=inputs->GetInput(VxEnum);                           _assert_(vx_input);
@@ -4606,7 +4892,7 @@
 }
 /*}}}*/
 /*FUNCTION Penta::GradjDragStokes {{{1*/
-void  Penta::GradjDragStokes(Vec gradient){
+void  Penta::GradjDragStokes(Vec gradient,int control_index){
 
 	int        i,j,ig;
 	int        analysis_type;
@@ -4631,14 +4917,14 @@
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
 	for(i=0;i<NUMVERTICES2D;i++) for(j=0;j<2;j++) xyz_list_tria[i][j]=xyz_list[i][j];
-	GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	Input* drag_input    =inputs->GetInput(FrictionCoefficientEnum); _assert_(drag_input);
-	Input* vx_input      =inputs->GetInput(VxEnum);              _assert_(vx_input);
-	Input* vy_input      =inputs->GetInput(VyEnum);              _assert_(vy_input);
-	Input* vz_input      =inputs->GetInput(VzEnum);              _assert_(vz_input);
-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);        _assert_(adjointx_input);
-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);        _assert_(adjointy_input);
-	Input* adjointz_input=inputs->GetInput(AdjointzEnum);        _assert_(adjointz_input);
+	Input* vx_input      =inputs->GetInput(VxEnum);                  _assert_(vx_input);
+	Input* vy_input      =inputs->GetInput(VyEnum);                  _assert_(vy_input);
+	Input* vz_input      =inputs->GetInput(VzEnum);                  _assert_(vz_input);
+	Input* adjointx_input=inputs->GetInput(AdjointxEnum);            _assert_(adjointx_input);
+	Input* adjointy_input=inputs->GetInput(AdjointyEnum);            _assert_(adjointy_input);
+	Input* adjointz_input=inputs->GetInput(AdjointzEnum);            _assert_(adjointz_input);
 
 	/*Build frictoin element, needed later: */
 	friction=new Friction("3d",inputs,matpar,analysis_type);
@@ -4698,7 +4984,7 @@
 }
 /*}}}*/
 /*FUNCTION Penta::GradjBbarMacAyeal {{{1*/
-void  Penta::GradjBbarMacAyeal(Vec gradient){
+void  Penta::GradjBbarMacAyeal(Vec gradient,int control_index){
 
 	/*This element should be collapsed into a tria element at its base*/
 	if (!IsOnBed()) return; 
@@ -4708,7 +4994,7 @@
 
 	/*Collapse element to the base*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria (lower face).
-	tria->GradjBMacAyeal(gradient);
+	tria->GradjBMacAyeal(gradient,control_index);
 	delete tria->matice; delete tria;
 
 	/*delete Average B*/
@@ -4716,7 +5002,7 @@
 
 } /*}}}*/
 /*FUNCTION Penta::GradjBbarPattyn {{{1*/
-void  Penta::GradjBbarPattyn(Vec gradient){
+void  Penta::GradjBbarPattyn(Vec gradient,int control_index){
 
 	/*Gradient is computed on bed only (Bbar)*/
 	if (!IsOnBed()) return;
@@ -4726,14 +5012,14 @@
 
 	/*Collapse element to the base*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2);
-	tria->GradjBMacAyeal(gradient);    //We use MacAyeal as an estimate for now
+	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
 	delete tria->matice; delete tria;
 
 	/*delete Average B*/
 	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
 } /*}}}*/
 /*FUNCTION Penta::GradjBbarStokes {{{1*/
-void  Penta::GradjBbarStokes(Vec gradient){
+void  Penta::GradjBbarStokes(Vec gradient,int control_index){
 
 	/*Gradient is computed on bed only (Bbar)*/
 	if (!IsOnBed()) return;
@@ -4743,7 +5029,7 @@
 
 	/*Collapse element to the base*/
 	Tria* tria=(Tria*)SpawnTria(0,1,2);
-	tria->GradjBMacAyeal(gradient);    //We use MacAyeal as an estimate for now
+	tria->GradjBMacAyeal(gradient,control_index);    //We use MacAyeal as an estimate for now
 	delete tria->matice; delete tria;
 
 	/*delete Average B*/
@@ -4821,10 +5107,10 @@
 	}
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(AdjointxEnum,lambdax));
-	this->inputs->AddInput(new PentaVertexInput(AdjointyEnum,lambday));
-	this->inputs->AddInput(new PentaVertexInput(AdjointzEnum,lambdaz));
-	this->inputs->AddInput(new PentaVertexInput(AdjointpEnum,lambdap));
+	this->inputs->AddInput(new PentaP1Input(AdjointxEnum,lambdax));
+	this->inputs->AddInput(new PentaP1Input(AdjointyEnum,lambday));
+	this->inputs->AddInput(new PentaP1Input(AdjointzEnum,lambdaz));
+	this->inputs->AddInput(new PentaP1Input(AdjointpEnum,lambdap));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -4858,8 +5144,8 @@
 	}
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(AdjointxEnum,lambdax));
-	this->inputs->AddInput(new PentaVertexInput(AdjointyEnum,lambday));
+	this->inputs->AddInput(new PentaP1Input(AdjointxEnum,lambdax));
+	this->inputs->AddInput(new PentaP1Input(AdjointyEnum,lambday));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -5108,6 +5394,64 @@
 	return J;
 }
 /*}}}*/
+/*FUNCTION Penta::GetVectorFromControlInputs{{{1*/
+void  Penta::GetVectorFromControlInputs(Vec vector,int control_enum,int control_index,const char* data){
+
+	int doflist1[NUMVERTICES];
+
+	/*Get out if this is not an element input*/
+	if(!IsInput(control_enum)) return;
+
+	/*Prepare index list*/
+	GradientIndexing(&doflist1[0],control_index);
+
+	/*Get input (either in element or material)*/
+	Input* input=inputs->GetInput(control_enum);
+	if(!input) _error_("Input %s not found in element",EnumToStringx(control_enum));
+
+	/*Check that it is a ControlInput*/
+	if (input->ObjectEnum()!=ControlInputEnum){
+		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+	}
+
+	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
+}
+/*}}}*/
+/*FUNCTION Penta::SetControlInputsFromVector{{{1*/
+void  Penta::SetControlInputsFromVector(double* vector,int control_enum,int control_index){
+
+	double  values[NUMVERTICES];
+	int     doflist1[NUMVERTICES];
+	Input  *input     = NULL;
+	Input  *new_input = NULL;
+
+	/*Get out if this is not an element input*/
+	if(!IsInput(control_enum)) return;
+
+	/*Prepare index list*/
+	GradientIndexing(&doflist1[0],control_index);
+
+	/*Get values on vertices*/
+	for (int i=0;i<NUMVERTICES;i++){
+		values[i]=vector[doflist1[i]];
+	}
+	new_input = new PentaP1Input(control_enum,values);
+
+
+	if(control_enum==MaterialsRheologyBbarEnum){
+		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
+	}
+	else{
+		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+	}
+
+	if (input->ObjectEnum()!=ControlInputEnum){
+		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+	}
+
+	((ControlInput*)input)->SetInput(new_input);
+}
+/*}}}*/
 #endif
 
 #ifdef _HAVE_DAKOTA_
@@ -5123,7 +5467,7 @@
 
 		case VertexEnum:
 
-			/*New PentaVertexInput*/
+			/*New PentaP1Input*/
 			double values[6];
 
 			/*Get values on the 6 vertices*/
@@ -5196,14 +5540,14 @@
 					}
 
 					/*Add new inputs: */
-					this->inputs->AddInput(new PentaVertexInput(ThicknessEnum,thickness));
-					this->inputs->AddInput(new PentaVertexInput(BedEnum,bed));
-					this->inputs->AddInput(new PentaVertexInput(SurfaceEnum,surface));
+					this->inputs->AddInput(new PentaP1Input(ThicknessEnum,thickness));
+					this->inputs->AddInput(new PentaP1Input(BedEnum,bed));
+					this->inputs->AddInput(new PentaP1Input(SurfaceEnum,surface));
 
 					/*}}}*/
 					break;
 				default:
-					this->inputs->AddInput(new PentaVertexInput(name,values));
+					this->inputs->AddInput(new PentaP1Input(name,values));
 			}
 			break;
 
@@ -5256,7 +5600,7 @@
 				time=(double)matrix[(nrows-1)*ncols+t]*yts;
 
 				if(t==0) transientinput=new TransientInput(name);
-				transientinput->AddTimeInput(new PentaVertexInput(name,values),time);
+				transientinput->AddTimeInput(new PentaP1Input(name,values),time);
 				transientinput->Configure(parameters);
 			}
 			this->inputs->AddInput(transientinput);
@@ -7310,6 +7654,190 @@
 	return pe;
 }
 /*}}}*/
+/*FUNCTION Penta::CreateJacobianDiagnosticHoriz{{{1*/
+ElementMatrix* Penta::CreateJacobianDiagnosticHoriz(void){
+
+	int approximation;
+	inputs->GetInputValue(&approximation,ApproximationEnum);
+
+	switch(approximation){
+		case MacAyealApproximationEnum:
+			return CreateJacobianDiagnosticMacayeal2d();
+		case PattynApproximationEnum:
+			return CreateJacobianDiagnosticPattyn();
+		case StokesApproximationEnum:
+			return CreateJacobianDiagnosticStokes();
+		case NoneApproximationEnum:
+			return NULL;
+		default:
+			_error_("Approximation %s not supported yet",EnumToStringx(approximation));
+	}
+}
+/*}}}*/
+/*FUNCTION Penta::CreateJacobianDiagnosticMacayeal2d{{{1*/
+ElementMatrix* Penta::CreateJacobianDiagnosticMacayeal2d(void){
+
+	/*Figure out if this penta 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 nodes, and use it to build 
+	  the stiffness matrix. */
+	if (!IsOnBed()) return NULL;
+
+	/*Depth Averaging B*/
+	this->InputDepthAverageAtBase(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum,MaterialsEnum);
+
+	/*Call Tria function*/
+	Tria* tria=(Tria*)SpawnTria(0,1,2); //nodes 0, 1 and 2 make the new tria.
+	ElementMatrix* Ke=tria->CreateJacobianDiagnosticMacayeal();
+	delete tria->matice; delete tria;
+
+	/*Delete B averaged*/
+	this->matice->inputs->DeleteInput(MaterialsRheologyBbarEnum);
+
+	/*clean up and return*/
+	return Ke;
+}
+/*}}}*/
+/*FUNCTION Penta::CreateJacobianDiagnosticPattyn{{{1*/
+ElementMatrix* Penta::CreateJacobianDiagnosticPattyn(void){
+
+	/*Constants*/
+	const int    numdof=NDOF2*NUMVERTICES;
+
+	/*Intermediaries */
+	int        i,j,ig;
+	double     xyz_list[NUMVERTICES][3];
+	double     Jdet;
+	double     eps1dotdphii,eps1dotdphij;
+	double     eps2dotdphii,eps2dotdphij;
+	double     mu_prime;
+	double     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+	double     eps1[3],eps2[3];
+	double     phi[NUMVERTICES];
+	double     dphi[3][NUMVERTICES];
+	GaussPenta *gauss=NULL;
+
+	/*Initialize Jacobian with regular Pattyn (first part of the Gateau derivative)*/
+	ElementMatrix* Ke=CreateKMatrixDiagnosticPattyn();
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussPenta(5,5);
+	for (ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+
+		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+		eps1[2]=epsilon[3];                eps2[2]=epsilon[4];
+
+		for(i=0;i<6;i++){
+			for(j=0;j<6;j++){
+				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+
+				Ke->values[12*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+				Ke->values[12*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+				Ke->values[12*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+				Ke->values[12*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+
+	/*Clean up and return*/
+	delete gauss;
+	return Ke;
+}
+/*}}}*/
+/*FUNCTION Penta::CreateJacobianDiagnosticStokes{{{1*/
+ElementMatrix* Penta::CreateJacobianDiagnosticStokes(void){
+
+	/*Constants*/
+	const int    numdof=NDOF4*NUMVERTICES;
+
+	/*Intermediaries */
+	int        i,j,ig;
+	double     xyz_list[NUMVERTICES][3];
+	double     Jdet;
+	double     eps1dotdphii,eps1dotdphij;
+	double     eps2dotdphii,eps2dotdphij;
+	double     eps3dotdphii,eps3dotdphij;
+	double     mu_prime;
+	double     epsilon[5]; /* epsilon=[exx,eyy,exy,exz,eyz];*/
+	double     eps1[3],eps2[3],eps3[3];
+	double     phi[NUMVERTICES];
+	double     dphi[3][NUMVERTICES];
+	GaussPenta *gauss=NULL;
+
+	/*Initialize Jacobian with regular Stokes (first part of the Gateau derivative)*/
+	ElementMatrix* Ke=CreateKMatrixDiagnosticStokes();
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+	Input* vz_input=inputs->GetInput(VzEnum);       _assert_(vz_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussPenta(5,5);
+	for (ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctionsP1Derivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+
+		this->GetStrainRate3dPattyn(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		matice->GetViscosityDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+		eps1[0]=epsilon[0];   eps2[0]=epsilon[2];   eps3[0]=epsilon[3];
+		eps1[1]=epsilon[2];   eps2[1]=epsilon[1];   eps3[1]=epsilon[4];
+		eps1[2]=epsilon[3];   eps2[2]=epsilon[4];   eps3[2]= -epsilon[0] -epsilon[1];
+
+		for(i=0;i<6;i++){
+			for(j=0;j<6;j++){
+				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i]+eps1[2]*dphi[2][i];
+				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j]+eps1[2]*dphi[2][j];
+				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i]+eps2[2]*dphi[2][i];
+				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j]+eps2[2]*dphi[2][j];
+				eps3dotdphii=eps3[0]*dphi[0][i]+eps3[1]*dphi[1][i]+eps3[2]*dphi[2][i];
+				eps3dotdphij=eps3[0]*dphi[0][j]+eps3[1]*dphi[1][j]+eps3[2]*dphi[2][j];
+
+				Ke->values[numdof*(4*i+0)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps1dotdphii;
+				Ke->values[numdof*(4*i+0)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps1dotdphii;
+				Ke->values[numdof*(4*i+0)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps1dotdphii;
+
+				Ke->values[numdof*(4*i+1)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps2dotdphii;
+				Ke->values[numdof*(4*i+1)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps2dotdphii;
+				Ke->values[numdof*(4*i+1)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps2dotdphii;
+
+				Ke->values[numdof*(4*i+2)+4*j+0]+=gauss->weight*Jdet*2*mu_prime*eps1dotdphij*eps3dotdphii;
+				Ke->values[numdof*(4*i+2)+4*j+1]+=gauss->weight*Jdet*2*mu_prime*eps2dotdphij*eps3dotdphii;
+				Ke->values[numdof*(4*i+2)+4*j+2]+=gauss->weight*Jdet*2*mu_prime*eps3dotdphij*eps3dotdphii;
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYZPEnum);
+
+	/*Clean up and return*/
+	delete gauss;
+	return Ke;
+}
+/*}}}*/
 /*FUNCTION Penta::GetSolutionFromInputsDiagnosticHoriz{{{1*/
 void  Penta::GetSolutionFromInputsDiagnosticHoriz(Vec solution){
 
@@ -7567,10 +8095,10 @@
 		penta->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 		/*Add vx and vy as inputs to the tria element: */
-		penta->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-		penta->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-		penta->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-		penta->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+		penta->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+		penta->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+		penta->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+		penta->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 		/*Stop if we have reached the surface*/
 		if (penta->IsOnSurface()) break;
@@ -7657,10 +8185,10 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflistp);
@@ -7732,7 +8260,7 @@
 	/*Get Vz*/
 	Input* vzmacayeal_input=inputs->GetInput(VzMacAyealEnum);
 	if (vzmacayeal_input){
-		if (vzmacayeal_input->ObjectEnum()!=PentaVertexInputEnum){
+		if (vzmacayeal_input->ObjectEnum()!=PentaP1InputEnum){
 			_error_("Cannot compute Vel as VzMacAyeal is of type %s",EnumToStringx(vzmacayeal_input->ObjectEnum()));
 		}
 		GetInputListOnVertices(&vzmacayeal[0],VzMacAyealEnum);
@@ -7755,12 +8283,12 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new PentaVertexInput(VzEnum,vz));
-	this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,vzstokes));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+	this->inputs->AddInput(new PentaP1Input(VzStokesEnum,vzstokes));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflistm);
@@ -7832,10 +8360,10 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -7900,7 +8428,7 @@
 	/*Get Vz*/
 	Input* vzpattyn_input=inputs->GetInput(VzPattynEnum);
 	if (vzpattyn_input){
-		if (vzpattyn_input->ObjectEnum()!=PentaVertexInputEnum){
+		if (vzpattyn_input->ObjectEnum()!=PentaP1InputEnum){
 			_error_("Cannot compute Vel as VzPattyn is of type %s",EnumToStringx(vzpattyn_input->ObjectEnum()));
 		}
 		GetInputListOnVertices(&vzpattyn[0],VzPattynEnum);
@@ -7923,12 +8451,12 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new PentaVertexInput(VzEnum,vz));
-	this->inputs->AddInput(new PentaVertexInput(VzStokesEnum,vzstokes));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+	this->inputs->AddInput(new PentaP1Input(VzStokesEnum,vzstokes));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflistp);
@@ -7989,10 +8517,10 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -8047,7 +8575,7 @@
 	if(approximation==PattynStokesApproximationEnum){
 		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
 		if (vzstokes_input){
-			if (vzstokes_input->ObjectEnum()!=PentaVertexInputEnum) _error_("Cannot compute Vel as VzStokes is of type %s",EnumToStringx(vzstokes_input->ObjectEnum()));
+			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type %s",EnumToStringx(vzstokes_input->ObjectEnum()));
 			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
 		}
 		else _error_("Cannot compute Vz as VzStokes in not present in PattynStokes element");
@@ -8059,7 +8587,7 @@
 	else if(approximation==MacAyealStokesApproximationEnum){
 		Input* vzstokes_input=inputs->GetInput(VzStokesEnum);
 		if (vzstokes_input){
-			if (vzstokes_input->ObjectEnum()!=PentaVertexInputEnum) _error_("Cannot compute Vel as VzStokes is of type %s",EnumToStringx(vzstokes_input->ObjectEnum()));
+			if (vzstokes_input->ObjectEnum()!=PentaP1InputEnum) _error_("Cannot compute Vel as VzStokes is of type %s",EnumToStringx(vzstokes_input->ObjectEnum()));
 			GetInputListOnVertices(&vzstokes[0],VzStokesEnum);
 		}
 		else _error_("Cannot compute Vz as VzStokes in not present in MacAyealStokes element");
@@ -8087,16 +8615,16 @@
 
 	if(approximation!=PattynStokesApproximationEnum && approximation!=MacAyealStokesApproximationEnum){
 		this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
-		this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+		this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 	}
 	else if(approximation==PattynStokesApproximationEnum){
-		this->inputs->AddInput(new PentaVertexInput(VzPattynEnum,vzpattyn));
+		this->inputs->AddInput(new PentaP1Input(VzPattynEnum,vzpattyn));
 	}
 	else if(approximation==MacAyealStokesApproximationEnum){
-		this->inputs->AddInput(new PentaVertexInput(VzMacAyealEnum,vzmacayeal));
+		this->inputs->AddInput(new PentaP1Input(VzMacAyealEnum,vzmacayeal));
 	}
-	this->inputs->AddInput(new PentaVertexInput(VzEnum,vz));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -8153,11 +8681,11 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new PentaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new PentaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new PentaVertexInput(VzEnum,vz));
-	this->inputs->AddInput(new PentaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new PentaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new PentaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new PentaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new PentaP1Input(VzEnum,vz));
+	this->inputs->AddInput(new PentaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new PentaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);

Modified: issm/trunk/src/c/objects/Elements/Penta.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Penta.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Elements/Penta.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -87,6 +87,7 @@
 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
 		void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df);
 		void   CreatePVector(Vec pf);
+		void   CreateJacobianMatrix(Mat Jff);
 		void   DeleteResults(void);
 		int    GetNodeIndex(Node* node);
 		void   GetSolutionFromInputs(Vec solution);
@@ -110,6 +111,7 @@
 		void   ListResultsInfo(int** results_enums,int** results_size,double** results_times,int** results_steps,int* num_results);
 		void   PatchFill(int* pcount, Patch* patch);
 		void   PatchSize(int* pnumrows, int* pnumvertices,int* pnumnodes);
+		void   PositiveDegreeDay(void);
 		void   ProcessResultsUnits(void);
 		void   ResetCoordinateSystem(void);
 		double SurfaceArea(void);
@@ -118,6 +120,7 @@
 		double TimeAdapt();
 		int*   GetHorizontalNeighboorSids(void);
 		void   ViscousHeatingCreateInput(void);
+		void   SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius);
 
 		 #ifdef _HAVE_RESPONSES_
 		double IceVolume(void);
@@ -139,16 +142,19 @@
 
 		#ifdef _HAVE_CONTROL_
 		double DragCoefficientAbsGradient(bool process_units,int weight_index);
-		void   Gradj(Vec gradient,int control_type);
-		void   GradjDragMacAyeal(Vec gradient);
-		void   GradjDragPattyn(Vec gradient);
-		void   GradjDragStokes(Vec gradient);
-		void   GradjBbarMacAyeal(Vec gradient);
-		void   GradjBbarPattyn(Vec gradient);
-		void   GradjBbarStokes(Vec gradient);
-		void   ControlInputGetGradient(Vec gradient,int enum_type);
+		void   GradientIndexing(int* indexing,int control_index);
+		void   Gradj(Vec gradient,int control_type,int control_index);
+		void   GradjDragMacAyeal(Vec gradient,int control_index);
+		void   GradjDragPattyn(Vec gradient,int control_index);
+		void   GradjDragStokes(Vec gradient,int control_index);
+		void   GradjBbarMacAyeal(Vec gradient,int control_index);
+		void   GradjBbarPattyn(Vec gradient,int control_index);
+		void   GradjBbarStokes(Vec gradient,int control_index);
+		void   GetVectorFromControlInputs(Vec gradient,int control_enum,int control_index,const char* data);
+		void   SetControlInputsFromVector(double* vector,int control_enum,int control_index);
+		void   ControlInputGetGradient(Vec gradient,int enum_type,int control_index);
 		void   ControlInputScaleGradient(int enum_type,double scale);
-		void   ControlInputSetGradient(double* gradient,int enum_type);
+		void   ControlInputSetGradient(double* gradient,int enum_type,int control_index);
 		double RheologyBbarAbsGradient(bool process_units,int weight_index);
 		double ThicknessAbsMisfit(     bool process_units,int weight_index);
 		double SurfaceAbsVelMisfit(    bool process_units,int weight_index);
@@ -177,7 +183,7 @@
 		void    GetInputValue(double* pvalue,Node* node,int enumtype);
 		void	  GetPhi(double* phi, double*  epsilon, double viscosity);
 		void	  GetSolutionFromInputsEnthalpy(Vec solutiong);
-		double  GetStabilizationParameter(double u, double v, double w, double diameter, double rho_ice, double heatcapacity, double thermalconductivity);
+		double  GetStabilizationParameter(double u, double v, double w, double diameter, double kappa);
 		void    GetStrainRate3dPattyn(double* epsilon,double* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
 		void    GetStrainRate3d(double* epsilon,double* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input, Input* vz_input);
 		Penta*  GetUpperElement(void);
@@ -210,6 +216,7 @@
 		ElementMatrix* CreateKMatrixCouplingMacAyealStokesFriction(void);
 		ElementMatrix* CreateKMatrixCouplingPattynStokes(void);
 		ElementMatrix* CreateKMatrixDiagnosticHoriz(void);
+		ElementMatrix* CreateKMatrixAdjointHoriz(void);
 		ElementVector* CreateDVectorDiagnosticHoriz(void);
 		ElementVector* CreateDVectorDiagnosticStokes(void);
 		ElementMatrix* CreateKMatrixDiagnosticHutter(void);
@@ -229,6 +236,10 @@
 		ElementMatrix* CreateKMatrixDiagnosticVert(void);
 		ElementMatrix* CreateKMatrixDiagnosticVertVolume(void);
 		ElementMatrix* CreateKMatrixDiagnosticVertSurface(void);
+		ElementMatrix* CreateJacobianDiagnosticHoriz(void);
+		ElementMatrix* CreateJacobianDiagnosticMacayeal2d(void);
+		ElementMatrix* CreateJacobianDiagnosticPattyn(void);
+		ElementMatrix* CreateJacobianDiagnosticStokes(void);
 		void           InputUpdateFromSolutionDiagnosticHoriz( double* solutiong);
 		void           InputUpdateFromSolutionDiagnosticMacAyeal( double* solutiong);
 		void           InputUpdateFromSolutionDiagnosticMacAyealPattyn( double* solutiong);
@@ -265,6 +276,9 @@
 
 		#ifdef _HAVE_CONTROL_
 		ElementVector* CreatePVectorAdjointHoriz(void);
+		ElementMatrix* CreateKMatrixAdjointMacAyeal2d(void);
+		ElementMatrix* CreateKMatrixAdjointPattyn(void);
+		ElementMatrix* CreateKMatrixAdjointStokes(void);
 		ElementVector* CreatePVectorAdjointMacAyeal(void);
 		ElementVector* CreatePVectorAdjointPattyn(void);
 		ElementVector* CreatePVectorAdjointStokes(void);

Modified: issm/trunk/src/c/objects/Elements/Tria.cpp
===================================================================
--- issm/trunk/src/c/objects/Elements/Tria.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Elements/Tria.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -335,9 +335,12 @@
 	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
 	switch(analysis_type){
 		#ifdef _HAVE_DIAGNOSTIC_
-		case DiagnosticHorizAnalysisEnum: case AdjointHorizAnalysisEnum:
+		case DiagnosticHorizAnalysisEnum:
 			Ke=CreateKMatrixDiagnosticMacAyeal();
 			break;
+		case AdjointHorizAnalysisEnum:
+			Ke=CreateKMatrixAdjointMacAyeal();
+			break;
 		case DiagnosticHutterAnalysisEnum:
 			Ke=CreateKMatrixDiagnosticHutter();
 			break;
@@ -887,6 +890,39 @@
 	return pe;
 }
 /*}}}*/
+/*FUNCTION Tria::CreateJacobianMatrix{{{1*/
+void  Tria::CreateJacobianMatrix(Mat Jff){
+
+	/*retrieve parameters: */
+	ElementMatrix* Ke=NULL;
+	int analysis_type;
+	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
+
+	/*Checks in debugging {{{2*/
+	_assert_(this->nodes && this->matice && this->matpar && this->parameters && this->inputs);
+	/*}}}*/
+
+	/*Skip if water element*/
+	if(IsOnWater()) return;
+
+	/*Just branch to the correct element stiffness matrix generator, according to the type of analysis we are carrying out: */
+	switch(analysis_type){
+#ifdef _HAVE_DIAGNOSTIC_
+		case DiagnosticHorizAnalysisEnum:
+			Ke=CreateJacobianDiagnosticMacayeal();
+			break;
+#endif
+		default:
+			_error_("analysis %i (%s) not supported yet",analysis_type,EnumToStringx(analysis_type));
+	}
+
+	/*Add to global matrix*/
+	if(Ke){
+		Ke->AddToGlobal(Jff);
+		delete Ke;
+	}
+}
+/*}}}*/
 /*FUNCTION Tria::ComputeBasalStress {{{1*/
 void  Tria::ComputeBasalStress(Vec eps){
 	_error_("Not Implemented yet");
@@ -937,12 +973,12 @@
 	}
 	
 	/*Add Stress tensor components into inputs*/
-	this->inputs->AddInput(new TriaVertexInput(StressTensorxxEnum,&sigma_xx[0]));
-	this->inputs->AddInput(new TriaVertexInput(StressTensorxyEnum,&sigma_xy[0]));
-	this->inputs->AddInput(new TriaVertexInput(StressTensorxzEnum,&sigma_xz[0]));
-	this->inputs->AddInput(new TriaVertexInput(StressTensoryyEnum,&sigma_yy[0]));
-	this->inputs->AddInput(new TriaVertexInput(StressTensoryzEnum,&sigma_yz[0]));
-	this->inputs->AddInput(new TriaVertexInput(StressTensorzzEnum,&sigma_zz[0]));
+	this->inputs->AddInput(new TriaP1Input(StressTensorxxEnum,&sigma_xx[0]));
+	this->inputs->AddInput(new TriaP1Input(StressTensorxyEnum,&sigma_xy[0]));
+	this->inputs->AddInput(new TriaP1Input(StressTensorxzEnum,&sigma_xz[0]));
+	this->inputs->AddInput(new TriaP1Input(StressTensoryyEnum,&sigma_yy[0]));
+	this->inputs->AddInput(new TriaP1Input(StressTensoryzEnum,&sigma_yz[0]));
+	this->inputs->AddInput(new TriaP1Input(StressTensorzzEnum,&sigma_zz[0]));
 
 	/*Clean up and return*/
 	delete gauss;
@@ -1449,7 +1485,9 @@
 	this->results->AddObject((Object*)input->SpawnResult(step,time));
 	
 	#ifdef _HAVE_CONTROL_
-	if(input->ObjectEnum()==ControlInputEnum) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+	if(input->ObjectEnum()==ControlInputEnum){
+		if(((ControlInput*)input)->gradient!=NULL) this->results->AddObject((Object*)((ControlInput*)input)->SpawnGradient(step,time));
+	}
 	#endif
 }
 /*}}}*/
@@ -1515,7 +1553,7 @@
 						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(BalancethicknessThickeningRateEnum)[tria_vertex_ids[j]-1]/yts;
 						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
-						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VxEnum:
@@ -1523,7 +1561,7 @@
 						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(VxEnum)[tria_vertex_ids[j]-1]/yts;
 						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
-						this->inputs->AddInput(new ControlInput(VxEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(VxEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case VyEnum:
@@ -1531,7 +1569,7 @@
 						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(VyEnum)[tria_vertex_ids[j]-1]/yts;
 						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
 						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts;
-						this->inputs->AddInput(new ControlInput(VyEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(VyEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case FrictionCoefficientEnum:
@@ -1539,7 +1577,7 @@
 						for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(FrictionCoefficientEnum)[tria_vertex_ids[j]-1];
 						for(j=0;j<3;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
 						for(j=0;j<3;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];
-						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+						this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 					}
 					break;
 				case MaterialsRheologyBbarEnum:
@@ -1558,7 +1596,7 @@
 		DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum);
 		for(i=0;i<num_cm_responses;i++){
 			for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data(InversionCostFunctionsCoefficientsEnum)[(tria_vertex_ids[j]-1)*num_cm_responses+i];
-			datasetinput->inputs->AddObject(new TriaVertexInput(InversionCostFunctionsCoefficientsEnum,nodeinputs));
+			datasetinput->inputs->AddObject(new TriaP1Input(InversionCostFunctionsCoefficientsEnum,nodeinputs));
 		}
 
 		/*Add datasetinput to element inputs*/
@@ -1639,7 +1677,7 @@
 	}
 
 	/*Add input to the element: */
-	this->inputs->AddInput(new TriaVertexInput(enum_type,values));
+	this->inputs->AddInput(new TriaP1Input(enum_type,values));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -1704,9 +1742,9 @@
 	}
 
 	/*Add input to the element: */
-	this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,newthickness));
-	this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,newsurface));
-	this->inputs->AddInput(new TriaVertexInput(BedEnum,newbed));
+	this->inputs->AddInput(new TriaP1Input(ThicknessEnum,newthickness));
+	this->inputs->AddInput(new TriaP1Input(SurfaceEnum,newsurface));
+	this->inputs->AddInput(new TriaP1Input(BedEnum,newbed));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -1722,7 +1760,7 @@
 
 		case VertexEnum:
 
-			/*New TriaVertexInput*/
+			/*New TriaP1Input*/
 			double values[3];
 
 			/*Get values on the 3 vertices*/
@@ -1732,10 +1770,10 @@
 
 			/*update input*/
 			if (name==MaterialsRheologyBbarEnum || name==MaterialsRheologyBEnum){
-				matice->inputs->AddInput(new TriaVertexInput(name,values));
+				matice->inputs->AddInput(new TriaP1Input(name,values));
 			}
 			else{
-				this->inputs->AddInput(new TriaVertexInput(name,values));
+				this->inputs->AddInput(new TriaP1Input(name,values));
 			}
 			return;
 
@@ -1811,7 +1849,7 @@
 			UnitConversion(&nodeinputs[0], 3 ,ExtToIuEnum, vector_enum);
 
 			/*create static input: */
-			this->inputs->AddInput(new TriaVertexInput(vector_enum,nodeinputs));
+			this->inputs->AddInput(new TriaP1Input(vector_enum,nodeinputs));
 		}
 		else if(M==numberofvertices+1){
 			/*create transient input: */
@@ -1830,7 +1868,7 @@
 				time=(double)vector[(M-1)*N+t]*yts;
 
 				if(t==0) transientinput=new TransientInput(vector_enum);
-				transientinput->AddTimeInput(new TriaVertexInput(vector_enum,nodeinputs),time);
+				transientinput->AddTimeInput(new TriaP1Input(vector_enum,nodeinputs),time);
 			}
 			this->inputs->AddInput(transientinput);
 		}
@@ -1880,6 +1918,7 @@
 				name==InversionVxObsEnum ||
 				name==InversionVyObsEnum ||
 				name==FrictionCoefficientEnum ||
+				name==MaterialsRheologyBbarEnum ||
 				name==GradientEnum ||
 				name==OldGradientEnum ||
 				name==QmuVxEnum ||
@@ -1984,7 +2023,7 @@
 			resultsenums[i]=elementresult->InstanceEnum();
 			resultstimes[i]=elementresult->GetTime();
 			resultssteps[i]=elementresult->GetStep();
-			if(elementresult->ObjectEnum()==TriaVertexElementResultEnum){
+			if(elementresult->ObjectEnum()==TriaP1ElementResultEnum){
 				resultssizes[i]=P1Enum;
 			}
 			else{
@@ -2066,15 +2105,15 @@
    /*Add basal melting rate if element just ungrounded*/
 	if(!this->IsFloating() && elementonshelf==true){
 		for(i=0;i<NUMVERTICES;i++)melting[i]=gl_melting_rate/yts;
-		this->inputs->AddInput(new TriaVertexInput(BasalforcingsMeltingRateEnum,&melting[0]));
+		this->inputs->AddInput(new TriaP1Input(BasalforcingsMeltingRateEnum,&melting[0]));
 	} 
 
 	/*Update inputs*/
    this->inputs->AddInput(new BoolInput(MaskElementonfloatingiceEnum,elementonshelf));
 
 	/*Update inputs*/    
-	this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,&s[0]));
-	this->inputs->AddInput(new TriaVertexInput(BedEnum,&b[0]));
+	this->inputs->AddInput(new TriaP1Input(SurfaceEnum,&s[0]));
+	this->inputs->AddInput(new TriaP1Input(BedEnum,&b[0]));
 }
 /*}}}*/
 /*FUNCTION Tria::MyRank {{{1*/
@@ -2163,6 +2202,12 @@
 	}
 }
 /*}}}*/
+/*FUNCTION Tria::PositiveDegreeDay{{{1*/
+void  Tria::PositiveDegreeDay(){
+
+	_error_("Not implemented yet");
+}
+/*}}}*/
 /*FUNCTION Tria::ProcessResultsUnits{{{1*/
 void  Tria::ProcessResultsUnits(void){
 
@@ -2208,6 +2253,12 @@
 	_error_("not implemented yet");
 }
 /*}}}1*/
+/*FUNCTION Tria::SmearFunction {{{1*/
+void  Tria::SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius){
+	_error_("not implemented yet");
+
+}
+/*}}}1*/
 /*FUNCTION Tria::SetCurrentConfiguration {{{1*/
 void  Tria::SetCurrentConfiguration(Elements* elementsin, Loads* loadsin, DataSet* nodesin, Materials* materialsin, Parameters* parametersin){
 	
@@ -2391,24 +2442,24 @@
 			/*default vx,vy and vz: either observation or 0 */
 			if(!iomodel->Data(VxEnum)){
 				for(i=0;i<3;i++)nodeinputs[i]=0;
-				this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs));
-				if(dakota_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVxEnum,nodeinputs));
+				this->inputs->AddInput(new TriaP1Input(VxEnum,nodeinputs));
+				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVxEnum,nodeinputs));
 			}
 			if(!iomodel->Data(VyEnum)){
 				for(i=0;i<3;i++)nodeinputs[i]=0;
-				this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs));
-				if(dakota_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVyEnum,nodeinputs));
+				this->inputs->AddInput(new TriaP1Input(VyEnum,nodeinputs));
+				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVyEnum,nodeinputs));
 			}
 			if(!iomodel->Data(VzEnum)){
 				for(i=0;i<3;i++)nodeinputs[i]=0;
-				this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs));
-				if(dakota_analysis) this->inputs->AddInput(new TriaVertexInput(QmuVzEnum,nodeinputs));
+				this->inputs->AddInput(new TriaP1Input(VzEnum,nodeinputs));
+				if(dakota_analysis) this->inputs->AddInput(new TriaP1Input(QmuVzEnum,nodeinputs));
 			}
 			if(!iomodel->Data(PressureEnum)){
 				for(i=0;i<3;i++)nodeinputs[i]=0;
 				if(dakota_analysis){
-					this->inputs->AddInput(new TriaVertexInput(PressureEnum,nodeinputs));
-					this->inputs->AddInput(new TriaVertexInput(QmuPressureEnum,nodeinputs));
+					this->inputs->AddInput(new TriaP1Input(PressureEnum,nodeinputs));
+					this->inputs->AddInput(new TriaP1Input(QmuPressureEnum,nodeinputs));
 				}
 			}
 			break;
@@ -3020,6 +3071,72 @@
 	return pe;
 }
 /*}}}*/
+/*FUNCTION Tria::CreateJacobianDiagnosticMacayeal{{{1*/
+ElementMatrix* Tria::CreateJacobianDiagnosticMacayeal(void){
+
+	/*Constants*/
+	const int    numdof=NDOF2*NUMVERTICES;
+
+	/*Intermediaries */
+	int        i,j,ig;
+	double     xyz_list[NUMVERTICES][3];
+	double     Jdet,thickness;
+	double     eps1dotdphii,eps1dotdphij;
+	double     eps2dotdphii,eps2dotdphij;
+	double     mu_prime;
+	double     epsilon[3];/* epsilon=[exx,eyy,exy];*/
+	double     eps1[2],eps2[2];
+	double     phi[NUMVERTICES];
+	double     dphi[2][NUMVERTICES];
+	GaussTria *gauss=NULL;
+
+	/*Initialize Jacobian with regular MacAyeal (first part of the Gateau derivative)*/
+	ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussTria(2);
+	for (ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctionsDerivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+
+		thickness_input->GetInputValue(&thickness, gauss);
+		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+
+		for(i=0;i<3;i++){
+			for(j=0;j<3;j++){
+				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i];
+				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j];
+				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i];
+				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j];
+
+				Ke->values[6*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps1dotdphii;
+				Ke->values[6*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps1dotdphii;
+				Ke->values[6*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps2dotdphii;
+				Ke->values[6*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps2dotdphii;
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+
+	/*Clean up and return*/
+	delete gauss;
+	return Ke;
+}
+/*}}}*/
 /*FUNCTION Tria::GetSolutionFromInputsDiagnosticHoriz{{{1*/
 void  Tria::GetSolutionFromInputsDiagnosticHoriz(Vec solution){
 
@@ -3151,10 +3268,10 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new TriaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new TriaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new TriaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new TriaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new TriaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new TriaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new TriaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new TriaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -3211,10 +3328,10 @@
 	this->inputs->ChangeEnum(PressureEnum,PressurePicardEnum);
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new TriaVertexInput(VxEnum,vx));
-	this->inputs->AddInput(new TriaVertexInput(VyEnum,vy));
-	this->inputs->AddInput(new TriaVertexInput(VelEnum,vel));
-	this->inputs->AddInput(new TriaVertexInput(PressureEnum,pressure));
+	this->inputs->AddInput(new TriaP1Input(VxEnum,vx));
+	this->inputs->AddInput(new TriaP1Input(VyEnum,vy));
+	this->inputs->AddInput(new TriaP1Input(VelEnum,vel));
+	this->inputs->AddInput(new TriaP1Input(PressureEnum,pressure));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -3259,7 +3376,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::ControlInputGetGradient{{{1*/
-void Tria::ControlInputGetGradient(Vec gradient,int enum_type){
+void Tria::ControlInputGetGradient(Vec gradient,int enum_type,int control_index){
 
 	int doflist1[NUMVERTICES];
 	Input* input=NULL;
@@ -3273,7 +3390,7 @@
 	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
 	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
 
-	this->GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	((ControlInput*)input)->GetGradient(gradient,&doflist1[0]);
 
 }/*}}}*/
@@ -3294,7 +3411,7 @@
 	((ControlInput*)input)->ScaleGradient(scale);
 }/*}}}*/
 /*FUNCTION Tria::ControlInputSetGradient{{{1*/
-void Tria::ControlInputSetGradient(double* gradient,int enum_type){
+void Tria::ControlInputSetGradient(double* gradient,int enum_type,int control_index){
 
 	int    doflist1[NUMVERTICES];
 	double grad_list[NUMVERTICES];
@@ -3310,15 +3427,15 @@
 	if (!input) _error_("Input %s not found",EnumToStringx(enum_type));
 	if (input->ObjectEnum()!=ControlInputEnum) _error_("Input %s is not a ControlInput",EnumToStringx(enum_type));
 
-	this->GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	for(int i=0;i<NUMVERTICES;i++) grad_list[i]=gradient[doflist1[i]];
-	grad_input=new TriaVertexInput(GradientEnum,grad_list);
+	grad_input=new TriaP1Input(GradientEnum,grad_list);
 
 	((ControlInput*)input)->SetGradient(grad_input);
 
 }/*}}}*/
 /*FUNCTION Tria::Gradj {{{1*/
-void  Tria::Gradj(Vec gradient,int control_type){
+void  Tria::Gradj(Vec gradient,int control_type,int control_index){
 	/*dJ/dalpha = ∂L/∂alpha = ∂J/∂alpha + ∂/∂alpha(KU-F)*/
 
 	/*If on water, grad = 0: */
@@ -3327,19 +3444,19 @@
 	/*First deal with ∂/∂alpha(KU-F)*/
 	switch(control_type){
 		case FrictionCoefficientEnum:
-			GradjDragMacAyeal(gradient);
+			GradjDragMacAyeal(gradient,control_index);
 			break;
 		case MaterialsRheologyBbarEnum:
-			GradjBMacAyeal(gradient);
+			GradjBMacAyeal(gradient,control_index);
 			break;
 		case BalancethicknessThickeningRateEnum:
-			GradjDhDtBalancedthickness(gradient);
+			GradjDhDtBalancedthickness(gradient,control_index);
 			break;
 		case VxEnum:
-			GradjVxBalancedthickness(gradient);
+			GradjVxBalancedthickness(gradient,control_index);
 			break;
 		case VyEnum:
-			GradjVyBalancedthickness(gradient);
+			GradjVyBalancedthickness(gradient,control_index);
 			break;
 		default:
 			_error_("%s%i","control type not supported yet: ",control_type);
@@ -3364,10 +3481,10 @@
 			/*Nothing, J does not depends on the parameter being inverted for*/
 			break;
 		case DragCoefficientAbsGradientEnum:
-			GradjDragGradient(gradient,resp);
+			GradjDragGradient(gradient,resp,control_index);
 			break;
 		case RheologyBbarAbsGradientEnum:
-			GradjBGradient(gradient,resp);
+			GradjBGradient(gradient,resp,control_index);
 			break;
 		default:
 			_error_("response %s not supported yet",EnumToStringx(responses[resp]));
@@ -3377,7 +3494,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjBGradient{{{1*/
-void  Tria::GradjBGradient(Vec gradient, int weight_index){
+void  Tria::GradjBGradient(Vec gradient,int weight_index,int control_index){
 
 	int        i,ig;
 	int        doflist1[NUMVERTICES];
@@ -3390,7 +3507,7 @@
 
 	/*Retrieve all inputs we will be needing: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	Input* rheologyb_input=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
 	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                _assert_(weights_input);
 
@@ -3417,7 +3534,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjBMacAyeal{{{1*/
-void  Tria::GradjBMacAyeal(Vec gradient){
+void  Tria::GradjBMacAyeal(Vec gradient,int control_index){
 
 	/*Intermediaries*/
 	int        i,ig;
@@ -3432,14 +3549,14 @@
 
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	GetDofList1(&doflist[0]);
+	GradientIndexing(&doflist[0],control_index);
 
 	/*Retrieve all inputs*/
-	Input* thickness_input=inputs->GetInput(ThicknessEnum);            _assert_(thickness_input);
-	Input* vx_input=inputs->GetInput(VxEnum);                          _assert_(vx_input);
-	Input* vy_input=inputs->GetInput(VyEnum);                          _assert_(vy_input);
-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);              _assert_(adjointx_input);
-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);              _assert_(adjointy_input);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum);                     _assert_(thickness_input);
+	Input* vx_input=inputs->GetInput(VxEnum);                                   _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);                                   _assert_(vy_input);
+	Input* adjointx_input=inputs->GetInput(AdjointxEnum);                       _assert_(adjointx_input);
+	Input* adjointy_input=inputs->GetInput(AdjointyEnum);                       _assert_(adjointy_input);
 	Input* rheologyb_input=matice->inputs->GetInput(MaterialsRheologyBbarEnum); _assert_(rheologyb_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -3474,7 +3591,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjDragMacAyeal {{{1*/
-void  Tria::GradjDragMacAyeal(Vec gradient){
+void  Tria::GradjDragMacAyeal(Vec gradient,int control_index){
 
 	int        i,ig;
 	int        analysis_type;
@@ -3495,16 +3612,16 @@
 	/*retrive parameters: */
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 
 	/*Build frictoin element, needed later: */
 	friction=new Friction("2d",inputs,matpar,analysis_type);
 
 	/*Retrieve all inputs we will be needing: */
-	Input* adjointx_input=inputs->GetInput(AdjointxEnum);               _assert_(adjointx_input);
-	Input* adjointy_input=inputs->GetInput(AdjointyEnum);               _assert_(adjointy_input);
-	Input* vx_input=inputs->GetInput(VxEnum);                           _assert_(vx_input);
-	Input* vy_input=inputs->GetInput(VyEnum);                           _assert_(vy_input);
+	Input* adjointx_input=inputs->GetInput(AdjointxEnum);                   _assert_(adjointx_input);
+	Input* adjointy_input=inputs->GetInput(AdjointyEnum);                   _assert_(adjointy_input);
+	Input* vx_input=inputs->GetInput(VxEnum);                               _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);                               _assert_(vy_input);
 	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
 
 	/* Start  looping on the number of gaussian points: */
@@ -3561,7 +3678,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjDragGradient{{{1*/
-void  Tria::GradjDragGradient(Vec gradient, int weight_index){
+void  Tria::GradjDragGradient(Vec gradient, int weight_index,int control_index){
 
 	int        i,ig;
 	int        doflist1[NUMVERTICES];
@@ -3575,7 +3692,7 @@
 	/*Retrieve all inputs we will be needing: */
 	if(IsFloating())return;
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 	Input* dragcoefficient_input=inputs->GetInput(FrictionCoefficientEnum); _assert_(dragcoefficient_input);
 	Input* weights_input=inputs->GetInput(InversionCostFunctionsCoefficientsEnum);                 _assert_(weights_input);
 
@@ -3605,16 +3722,15 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjDhDtBalancedthickness{{{1*/
-void  Tria::GradjDhDtBalancedthickness(Vec gradient){
+void  Tria::GradjDhDtBalancedthickness(Vec gradient,int control_index){
 
 	/*Intermediaries*/
 	int    doflist1[NUMVERTICES];
 	double lambda[NUMVERTICES];
 	double gradient_g[NUMVERTICES];
 
-	GetDofList1(&doflist1[0]);
-
 	/*Compute Gradient*/
+	GradientIndexing(&doflist1[0],control_index);
 	GetInputListOnVertices(&lambda[0],AdjointEnum);
 	for(int i=0;i<NUMVERTICES;i++) gradient_g[i]=-lambda[i];
 
@@ -3622,7 +3738,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjVxBalancedthickness{{{1*/
-void  Tria::GradjVxBalancedthickness(Vec gradient){
+void  Tria::GradjVxBalancedthickness(Vec gradient,int control_index){
 
 	/*Intermediaries*/
 	int        i,ig;
@@ -3636,7 +3752,7 @@
 
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 
 	/*Retrieve all inputs we will be needing: */
 	Input* adjoint_input=inputs->GetInput(AdjointEnum);     _assert_(adjoint_input);
@@ -3665,7 +3781,7 @@
 }
 /*}}}*/
 /*FUNCTION Tria::GradjVyBalancedthickness{{{1*/
-void  Tria::GradjVyBalancedthickness(Vec gradient){
+void  Tria::GradjVyBalancedthickness(Vec gradient,int control_index){
 
 	/*Intermediaries*/
 	int        i,ig;
@@ -3679,7 +3795,7 @@
 
 	/* Get node coordinates and dof list: */
 	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
-	GetDofList1(&doflist1[0]);
+	GradientIndexing(&doflist1[0],control_index);
 
 	/*Retrieve all inputs we will be needing: */
 	Input* adjoint_input=inputs->GetInput(AdjointEnum);     _assert_(adjoint_input);
@@ -3706,6 +3822,20 @@
 	delete gauss;
 }
 /*}}}*/
+/*FUNCTION Tria::GradientIndexing{{{1*/
+void  Tria::GradientIndexing(int* indexing,int control_index){
+
+	/*Get some parameters*/
+	int num_controls;
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+
+	/*get gradient indices*/
+	for(int i=0;i<NUMVERTICES;i++){
+		indexing[i]=num_controls*this->nodes[i]->GetVertexDof() + control_index;
+	}
+
+}
+/*}}}*/
 /*FUNCTION Tria::RheologyBbarAbsGradient{{{1*/
 double Tria::RheologyBbarAbsGradient(bool process_units,int weight_index){
 
@@ -3742,7 +3872,7 @@
 		rheologyb_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
 
 		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
-		//Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
+		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
 	}
 
 	/*Clean up and return*/
@@ -4218,6 +4348,7 @@
 
 	/*Clean up and return*/
 	delete gauss;
+	xfree((void**)&responses);
 	return pe;
 }
 /*}}}*/
@@ -4613,7 +4744,7 @@
 		drag_input->GetInputDerivativeValue(&dp[0],&xyz_list[0][0],gauss);
 
 		/*Tikhonov regularization: J = 1/2 ((dp/dx)^2 + (dp/dy)^2) */ 
-		//Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
+		Jelem+=weight*1/2*(pow(dp[0],2.)+pow(dp[1],2.))*Jdet*gauss->weight;
 	}
 
 	/*Clean up and return*/
@@ -4643,6 +4774,76 @@
 	return Ke;
 }
 /*}}}*/
+/*FUNCTION Tria::CreateKMatrixAdjointMacAyeal{{{1*/
+ElementMatrix* Tria::CreateKMatrixAdjointMacAyeal(void){
+
+	/*Constants*/
+	const int    numdof=NDOF2*NUMVERTICES;
+
+	/*Intermediaries */
+	int        i,j,ig;
+	bool       incomplete_adjoint;
+	double     xyz_list[NUMVERTICES][3];
+	double     Jdet,thickness;
+	double     eps1dotdphii,eps1dotdphij;
+	double     eps2dotdphii,eps2dotdphij;
+	double     mu_prime;
+	double     epsilon[3];/* epsilon=[exx,eyy,exy];*/
+	double     eps1[2],eps2[2];
+	double     phi[NUMVERTICES];
+	double     dphi[2][NUMVERTICES];
+	GaussTria *gauss=NULL;
+
+	/*Initialize Jacobian with regular MacAyeal (first part of the Gateau derivative)*/
+	parameters->FindParam(&incomplete_adjoint,InversionIncompleteAdjointEnum);
+	ElementMatrix* Ke=CreateKMatrixDiagnosticMacAyeal();
+	if(incomplete_adjoint) return Ke;
+
+	/*Retrieve all inputs and parameters*/
+	GetVerticesCoordinates(&xyz_list[0][0], nodes, NUMVERTICES);
+	Input* vx_input=inputs->GetInput(VxEnum);       _assert_(vx_input);
+	Input* vy_input=inputs->GetInput(VyEnum);       _assert_(vy_input);
+	Input* thickness_input=inputs->GetInput(ThicknessEnum); _assert_(thickness_input);
+
+	/* Start  looping on the number of gaussian points: */
+	gauss=new GaussTria(2);
+	for (ig=gauss->begin();ig<gauss->end();ig++){
+
+		gauss->GaussPoint(ig);
+
+		GetJacobianDeterminant2d(&Jdet, &xyz_list[0][0],gauss);
+		GetNodalFunctionsDerivatives(&dphi[0][0],&xyz_list[0][0],gauss);
+
+		thickness_input->GetInputValue(&thickness, gauss);
+		this->GetStrainRate2d(&epsilon[0],&xyz_list[0][0],gauss,vx_input,vy_input);
+		matice->GetViscosity2dDerivativeEpsSquare(&mu_prime,&epsilon[0]);
+		eps1[0]=2*epsilon[0]+epsilon[1];   eps2[0]=epsilon[2];
+		eps1[1]=epsilon[2];                eps2[1]=epsilon[0]+2*epsilon[1];
+
+		for(i=0;i<3;i++){
+			for(j=0;j<3;j++){
+				eps1dotdphii=eps1[0]*dphi[0][i]+eps1[1]*dphi[1][i];
+				eps1dotdphij=eps1[0]*dphi[0][j]+eps1[1]*dphi[1][j];
+				eps2dotdphii=eps2[0]*dphi[0][i]+eps2[1]*dphi[1][i];
+				eps2dotdphij=eps2[0]*dphi[0][j]+eps2[1]*dphi[1][j];
+
+				Ke->values[6*(2*i+0)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps1dotdphii;
+				Ke->values[6*(2*i+0)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps1dotdphii;
+				Ke->values[6*(2*i+1)+2*j+0]+=gauss->weight*Jdet*2*mu_prime*thickness*eps1dotdphij*eps2dotdphii;
+				Ke->values[6*(2*i+1)+2*j+1]+=gauss->weight*Jdet*2*mu_prime*thickness*eps2dotdphij*eps2dotdphii;
+			}
+		}
+	}
+
+	/*Transform Coordinate System*/
+	TransformStiffnessMatrixCoord(Ke,nodes,NUMVERTICES,XYEnum);
+
+	/*Clean up and return*/
+	delete gauss;
+	//Ke->Transpose();
+	return Ke;
+}
+/*}}}*/
 /*FUNCTION Tria::InputUpdateFromSolutionAdjointHoriz {{{1*/
 void  Tria::InputUpdateFromSolutionAdjointHoriz(double* solution){
 
@@ -4671,8 +4872,8 @@
 	}
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new TriaVertexInput(AdjointxEnum,lambdax));
-	this->inputs->AddInput(new TriaVertexInput(AdjointyEnum,lambday));
+	this->inputs->AddInput(new TriaP1Input(AdjointxEnum,lambdax));
+	this->inputs->AddInput(new TriaP1Input(AdjointyEnum,lambday));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -4701,12 +4902,74 @@
 	}
 
 	/*Add vx and vy as inputs to the tria element: */
-	this->inputs->AddInput(new TriaVertexInput(AdjointEnum,lambda));
+	this->inputs->AddInput(new TriaP1Input(AdjointEnum,lambda));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
 }
 /*}}}*/
+/*FUNCTION Tria::GetVectorFromControlInputs{{{1*/
+void  Tria::GetVectorFromControlInputs(Vec vector,int control_enum,int control_index,const char* data){
+
+	int doflist1[NUMVERTICES];
+	Input *input=NULL;
+
+	/*Get out if this is not an element input*/
+	if(!IsInput(control_enum)) return;
+
+	/*Prepare index list*/
+	GradientIndexing(&doflist1[0],control_index);
+
+	/*Get input (either in element or material)*/
+	if(control_enum==MaterialsRheologyBbarEnum){
+		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
+	}
+	else{
+		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+	}
+
+	/*Check that it is a ControlInput*/
+	if (input->ObjectEnum()!=ControlInputEnum){
+		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+	}
+
+	((ControlInput*)input)->GetVectorFromInputs(vector,&doflist1[0],data);
+}
+/*}}}*/
+/*FUNCTION Tria::SetControlInputsFromVector{{{1*/
+void  Tria::SetControlInputsFromVector(double* vector,int control_enum,int control_index){
+
+	double  values[NUMVERTICES];
+	int     doflist1[NUMVERTICES];
+	Input  *input     = NULL;
+	Input  *new_input = NULL;
+
+	/*Get out if this is not an element input*/
+	if(!IsInput(control_enum)) return;
+
+	/*Prepare index list*/
+	GradientIndexing(&doflist1[0],control_index);
+
+	/*Get values on vertices*/
+	for (int i=0;i<NUMVERTICES;i++){
+		values[i]=vector[doflist1[i]];
+	}
+	new_input = new TriaP1Input(control_enum,values);
+
+	if(control_enum==MaterialsRheologyBbarEnum){
+		input=(Input*)matice->inputs->GetInput(control_enum); _assert_(input);
+	}
+	else{
+		input=(Input*)this->inputs->GetInput(control_enum);   _assert_(input);
+	}
+
+	if (input->ObjectEnum()!=ControlInputEnum){
+		_error_("input %s is not a ControlInput",EnumToStringx(control_enum));
+	}
+
+	((ControlInput*)input)->SetInput(new_input);
+}
+/*}}}*/
 #endif
 
 #ifdef _HAVE_HYDROLOGY_
@@ -4761,8 +5024,8 @@
 	delete gauss;
 
 	/*Add to inputs*/
-	this->inputs->AddInput(new TriaVertexInput(HydrologyWaterVxEnum,vx));
-	this->inputs->AddInput(new TriaVertexInput(HydrologyWaterVyEnum,vy));
+	this->inputs->AddInput(new TriaP1Input(HydrologyWaterVxEnum,vx));
+	this->inputs->AddInput(new TriaP1Input(HydrologyWaterVyEnum,vy));
 }
 /*}}}*/
 /*FUNCTION Tria::CreateKMatrixHydrology{{{1*/
@@ -4977,7 +5240,7 @@
 	}
 
 	/*Add input to the element: */
-	this->inputs->AddInput(new TriaVertexInput(WatercolumnEnum,values));
+	this->inputs->AddInput(new TriaP1Input(WatercolumnEnum,values));
 
 	/*Free ressources:*/
 	xfree((void**)&doflist);
@@ -4998,7 +5261,7 @@
 
 		case VertexEnum:
 
-			/*New TriaVertexInput*/
+			/*New TriaP1Input*/
 			double values[3];
 
 			/*Get values on the 3 vertices*/
@@ -5071,14 +5334,14 @@
 					}
 
 					/*Add new inputs: */
-					this->inputs->AddInput(new TriaVertexInput(ThicknessEnum,thickness));
-					this->inputs->AddInput(new TriaVertexInput(BedEnum,bed));
-					this->inputs->AddInput(new TriaVertexInput(SurfaceEnum,surface));
+					this->inputs->AddInput(new TriaP1Input(ThicknessEnum,thickness));
+					this->inputs->AddInput(new TriaP1Input(BedEnum,bed));
+					this->inputs->AddInput(new TriaP1Input(SurfaceEnum,surface));
 
 					/*}}}*/
 					break;
 				default:
-					this->inputs->AddInput(new TriaVertexInput(name,values));
+					this->inputs->AddInput(new TriaP1Input(name,values));
 			}
 			break;
 
@@ -5130,7 +5393,7 @@
 				time=(double)matrix[(nrows-1)*ncols+t]*yts;
 
 				if(t==0) transientinput=new TransientInput(name);
-				transientinput->AddTimeInput(new TriaVertexInput(name,values),time);
+				transientinput->AddTimeInput(new TriaP1Input(name,values),time);
 				transientinput->Configure(parameters);
 			}
 			this->inputs->AddInput(transientinput);

Modified: issm/trunk/src/c/objects/Elements/Tria.h
===================================================================
--- issm/trunk/src/c/objects/Elements/Tria.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Elements/Tria.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -83,6 +83,7 @@
 		void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
 		void   CreateKMatrix(Mat Kff, Mat Kfs,Vec df);
 		void   CreatePVector(Vec pf);
+		void   CreateJacobianMatrix(Mat Jff);
 		int    GetNodeIndex(Node* node);
 		int    Sid();
 		bool   IsOnBed();
@@ -105,6 +106,7 @@
 		void   MaterialUpdateFromTemperature(void){_error_("not implemented yet");};
 		void   MigrateGroundingLine(double* oldfloating,double* sheet_ungrounding);
 		void   PotentialSheetUngrounding(Vec potential_sheet_ungrounding);
+		void   PositiveDegreeDay(void);
 		void   RequestedOutput(int output_enum,int step,double time);
 		void   ListResultsInfo(int** results_enums,int** results_size,double** results_times,int** results_steps,int* num_results);
 		void   PatchFill(int* pcount, Patch* patch);
@@ -116,6 +118,7 @@
 		int    UpdatePotentialSheetUngrounding(double* vertices_potentially_ungrounding,Vec vec_nodes_on_iceshelf,double* nodes_on_iceshelf);
 		double TimeAdapt();
 		int*   GetHorizontalNeighboorSids(void);
+		void   SmearFunction(Vec smearedvector,double (*WeightFunction)(double distance,double radius),double radius);
 
 		#ifdef _HAVE_RESPONSES_
 		double IceVolume(void);
@@ -138,18 +141,21 @@
 
 		#ifdef _HAVE_CONTROL_
 		double DragCoefficientAbsGradient(bool process_units,int weight_index);
-		void   Gradj(Vec gradient,int control_type);
-		void   GradjBGradient(Vec gradient,int weight_index);
-		void   GradjBMacAyeal(Vec gradient);
-		void   GradjDragMacAyeal(Vec gradient);
-		void   GradjDragStokes(Vec gradient);
-		void   GradjDragGradient(Vec gradient,int weight_index);
-		void   GradjDhDtBalancedthickness(Vec gradient);
-		void   GradjVxBalancedthickness(Vec gradient);
-		void   GradjVyBalancedthickness(Vec gradient);
-		void   ControlInputGetGradient(Vec gradient,int enum_type);
+		void   GradientIndexing(int* indexing,int control_index);
+		void   Gradj(Vec gradient,int control_type,int control_index);
+		void   GradjBGradient(Vec gradient,int weight_index,int control_index);
+		void   GradjBMacAyeal(Vec gradient,int control_index);
+		void   GradjDragMacAyeal(Vec gradient,int control_index);
+		void   GradjDragStokes(Vec gradient,int control_index);
+		void   GradjDragGradient(Vec gradient,int weight_index,int control_index);
+		void   GradjDhDtBalancedthickness(Vec gradient,int control_index);
+		void   GradjVxBalancedthickness(Vec gradient,int control_index);
+		void   GradjVyBalancedthickness(Vec gradient,int control_index);
+		void   GetVectorFromControlInputs(Vec gradient,int control_enum,int control_index,const char* data);
+		void   SetControlInputsFromVector(double* vector,int control_enum,int control_index);
+		void   ControlInputGetGradient(Vec gradient,int enum_type,int control_index);
 		void   ControlInputScaleGradient(int enum_type,double scale);
-		void   ControlInputSetGradient(double* gradient,int enum_type);
+		void   ControlInputSetGradient(double* gradient,int enum_type,int control_index);
 		double RheologyBbarAbsGradient(bool process_units,int weight_index);
 		double ThicknessAbsMisfit(     bool process_units,int weight_index);
 		double SurfaceAbsVelMisfit(    bool process_units,int weight_index);
@@ -202,6 +208,7 @@
 		ElementMatrix* CreateKMatrixDiagnosticHutter(void);
 		ElementVector* CreatePVectorDiagnosticMacAyeal(void);
 		ElementVector* CreatePVectorDiagnosticHutter(void);
+		ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
 		void	  GetSolutionFromInputsDiagnosticHoriz(Vec solution);
 		void	  GetSolutionFromInputsDiagnosticHutter(Vec solution);
 		void	  InputUpdateFromSolutionDiagnosticHoriz( double* solution);
@@ -210,6 +217,7 @@
 
 		#ifdef _HAVE_CONTROL_
 		ElementMatrix* CreateKMatrixAdjointBalancethickness(void);
+		ElementMatrix* CreateKMatrixAdjointMacAyeal(void);
 		ElementVector* CreatePVectorAdjointHoriz(void);
 		ElementVector* CreatePVectorAdjointStokes(void);
 		ElementVector* CreatePVectorAdjointBalancethickness(void);

Modified: issm/trunk/src/c/objects/Inputs/ControlInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/ControlInput.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/ControlInput.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -34,17 +34,17 @@
 	enum_type=in_enum_type;
 
 	switch(enum_input){
-		case TriaVertexInputEnum:
-			values     =new TriaVertexInput(enum_type,pvalues);
-			savedvalues=new TriaVertexInput(enum_type,pvalues);
-			minvalues  =new TriaVertexInput(enum_type,pmin);
-			maxvalues  =new TriaVertexInput(enum_type,pmax);
+		case TriaP1InputEnum:
+			values     =new TriaP1Input(enum_type,pvalues);
+			savedvalues=new TriaP1Input(enum_type,pvalues);
+			minvalues  =new TriaP1Input(enum_type,pmin);
+			maxvalues  =new TriaP1Input(enum_type,pmax);
 			break;
-		case PentaVertexInputEnum:
-			values     =new PentaVertexInput(enum_type,pvalues);
-			savedvalues=new PentaVertexInput(enum_type,pvalues);
-			minvalues  =new PentaVertexInput(enum_type,pmin);
-			maxvalues  =new PentaVertexInput(enum_type,pmax);
+		case PentaP1InputEnum:
+			values     =new PentaP1Input(enum_type,pvalues);
+			savedvalues=new PentaP1Input(enum_type,pvalues);
+			minvalues  =new PentaP1Input(enum_type,pmin);
+			maxvalues  =new PentaP1Input(enum_type,pmax);
 			break;
 		default:
 			_error_("Input of Enum %s not supported yet by ControlInput",EnumToStringx(enum_input));
@@ -205,12 +205,12 @@
 	memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
 	if(flag){
 		memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-		if(input_enum_type==PentaVertexInputEnum){
-			values=new PentaVertexInput();
+		if(input_enum_type==PentaP1InputEnum){
+			values=new PentaP1Input();
 			values->Demarshall(&marshalled_dataset);
 		}
-		else if(input_enum_type==TriaVertexInputEnum){
-			values=new TriaVertexInput();
+		else if(input_enum_type==TriaP1InputEnum){
+			values=new TriaP1Input();
 			values->Demarshall(&marshalled_dataset);
 		}
 		else _error_("Not supported yet");
@@ -223,12 +223,12 @@
 	memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
 	if(flag){
 		memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-		if(input_enum_type==PentaVertexInputEnum){
-			savedvalues=new PentaVertexInput();
+		if(input_enum_type==PentaP1InputEnum){
+			savedvalues=new PentaP1Input();
 			savedvalues->Demarshall(&marshalled_dataset);
 		}
-		else if(input_enum_type==TriaVertexInputEnum){
-			savedvalues=new TriaVertexInput();
+		else if(input_enum_type==TriaP1InputEnum){
+			savedvalues=new TriaP1Input();
 			savedvalues->Demarshall(&marshalled_dataset);
 		}
 		else _error_("Not supported yet");
@@ -241,12 +241,12 @@
 	memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
 	if(flag){
 		memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-		if(input_enum_type==PentaVertexInputEnum){
-			minvalues=new PentaVertexInput();
+		if(input_enum_type==PentaP1InputEnum){
+			minvalues=new PentaP1Input();
 			minvalues->Demarshall(&marshalled_dataset);
 		}
-		else if(input_enum_type==TriaVertexInputEnum){
-			minvalues=new TriaVertexInput();
+		else if(input_enum_type==TriaP1InputEnum){
+			minvalues=new TriaP1Input();
 			minvalues->Demarshall(&marshalled_dataset);
 		}
 		else _error_("Not supported yet");
@@ -259,12 +259,12 @@
 	memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
 	if(flag){
 		memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-		if(input_enum_type==PentaVertexInputEnum){
-			maxvalues=new PentaVertexInput();
+		if(input_enum_type==PentaP1InputEnum){
+			maxvalues=new PentaP1Input();
 			maxvalues->Demarshall(&marshalled_dataset);
 		}
-		else if(input_enum_type==TriaVertexInputEnum){
-			maxvalues=new TriaVertexInput();
+		else if(input_enum_type==TriaP1InputEnum){
+			maxvalues=new TriaP1Input();
 			maxvalues->Demarshall(&marshalled_dataset);
 		}
 		else _error_("Not supported yet");
@@ -277,12 +277,12 @@
 	memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
 	if(flag){
 		memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
-		if(input_enum_type==PentaVertexInputEnum){
-			gradient=new PentaVertexInput();
+		if(input_enum_type==PentaP1InputEnum){
+			gradient=new PentaP1Input();
 			gradient->Demarshall(&marshalled_dataset);
 		}
-		else if(input_enum_type==TriaVertexInputEnum){
-			gradient=new TriaVertexInput();
+		else if(input_enum_type==TriaP1InputEnum){
+			gradient=new TriaP1Input();
 			gradient->Demarshall(&marshalled_dataset);
 		}
 		else _error_("Not supported yet");
@@ -385,6 +385,13 @@
 	gradient=gradient_in;
 
 }/*}}}*/
+/*FUNCTION ControlInput::SetInput{{{1*/
+void ControlInput::SetInput(Input* in_input){
+
+	delete values; this->values=in_input;
+	this->SaveValue(); //because this is what SpawnResult saves FIXME
+
+}/*}}}*/
 /*FUNCTION ControlInput::SpawnResult{{{1*/
 ElementResult* ControlInput::SpawnResult(int step, double time){
 	return savedvalues->SpawnResult(step,time);
@@ -395,12 +402,35 @@
 }/*}}}*/
 /*FUNCTION ControlInput::SpawnGradient{{{1*/
 ElementResult* ControlInput::SpawnGradient(int step, double time){
+	_assert_(gradient);
 	return gradient->SpawnResult(step,time);
 }/*}}}*/
-/*FUNCTION ControlInput::GetInputValue(bool* pvalue){{{1*/
+/*FUNCTION ControlInput::GetVectorFromInputs(Vec vector,int* doflist){{{1*/
 void ControlInput::GetVectorFromInputs(Vec vector,int* doflist){
 	values->GetVectorFromInputs(vector,doflist);
 }/*}}}*/
+/*FUNCTION ControlInput::GetVectorFromInputs(Vec vector,int* doflist,const char* data){{{1*/
+void ControlInput::GetVectorFromInputs(Vec vector,int* doflist,const char* data){
+	 if(strcmp(data,"value")==0){
+		 _assert_(values);
+		 values->GetVectorFromInputs(vector,doflist);
+	 }
+	 else if (strcmp(data,"lowerbound")==0){
+		 _assert_(minvalues);
+		 minvalues->GetVectorFromInputs(vector,doflist);
+	 }
+	 else if (strcmp(data,"upperbound")==0){
+		 _assert_(maxvalues);
+		 maxvalues->GetVectorFromInputs(vector,doflist);
+	 }
+	 else if (strcmp(data,"gradient")==0){
+		 _assert_(gradient);
+		 gradient->GetVectorFromInputs(vector,doflist);
+	 }
+	 else{
+		 _error_("Data %s not supported yet",data);
+	 }
+}/*}}}*/
 /*FUNCTION ControlInput::GetInputAverage(double* pvalue){{{1*/
 void ControlInput::GetInputAverage(double* pvalue){
 	values->GetInputAverage(pvalue);

Modified: issm/trunk/src/c/objects/Inputs/ControlInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/ControlInput.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/ControlInput.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -53,6 +53,7 @@
 		void Configure(Parameters* parameters);
 		/*}}}*/
 		/*numerics: {{{1*/
+		void SetInput(Input* in_input);
 		void GetInputValue(bool* pvalue);
 		void GetInputValue(int* pvalue);
 		void GetInputValue(double* pvalue);
@@ -85,6 +86,7 @@
 		double MinAbs(void){_error_("not implemented yet");};
 		void Extrude(void);
 		void VerticallyIntegrate(Input* thickness_input);
+		void GetVectorFromInputs(Vec vector,int* doflist,const char* data);
 		void GetVectorFromInputs(Vec vector,int* doflist);
 		void GetValuesPtr(double** pvalues,int* pnum_values){_error_("not implemented yet");};
 		ElementResult* SpawnGradient(int step, double time);

Modified: issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/DoubleInput.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -339,7 +339,7 @@
 	/*vertically integrate depending on type:*/
 	switch(thickness_input->ObjectEnum()){
 
-		case PentaVertexInputEnum:
+		case PentaP1InputEnum:
 			thickness_input->GetInputAverage(&thickness_value);
 			this->value=this->value*thickness_value;
 			return;

Copied: issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp (from rev 11526, issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.cpp)
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp	                        (rev 0)
+++ issm/trunk/src/c/objects/Inputs/PentaP1Input.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,680 @@
+/*!\file PentaP1Input.c
+ * \brief: implementation of the PentaP1Input 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 "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../Container/Container.h"
+#include "../../include/include.h"
+
+/*PentaP1Input constructors and destructor*/
+/*FUNCTION PentaP1Input::PentaP1Input(){{{1*/
+PentaP1Input::PentaP1Input(){
+	return;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::PentaP1Input(int in_enum_type,double* values){{{1*/
+PentaP1Input::PentaP1Input(int in_enum_type,double* in_values)
+		:PentaRef(1)
+{
+
+	/*Set PentaRef*/
+	this->SetElementType(P1Enum,0);
+	this->element_type=P1Enum;
+
+	enum_type=in_enum_type;
+	values[0]=in_values[0];
+	values[1]=in_values[1];
+	values[2]=in_values[2];
+	values[3]=in_values[3];
+	values[4]=in_values[4];
+	values[5]=in_values[5];
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::~PentaP1Input(){{{1*/
+PentaP1Input::~PentaP1Input(){
+	return;
+}
+/*}}}*/
+
+/*Object virtual functions definitions:*/
+/*FUNCTION PentaP1Input::Echo {{{1*/
+void PentaP1Input::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::DeepEcho{{{1*/
+void PentaP1Input::DeepEcho(void){
+
+	printf("PentaP1Input:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
+	printf("   values: [%g %g %g %g %g %g]\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]);
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Id{{{1*/
+int    PentaP1Input::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION PentaP1Input::MyRank{{{1*/
+int    PentaP1Input::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+#ifdef _SERIAL_
+/*FUNCTION PentaP1Input::Marshall{{{1*/
+void  PentaP1Input::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of PentaP1Input: */
+	enum_value=PentaP1InputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall PentaP1Input data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::MarshallSize{{{1*/
+int   PentaP1Input::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Demarshall{{{1*/
+void  PentaP1Input::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+#endif
+/*FUNCTION PentaP1Input::ObjectEnum{{{1*/
+int PentaP1Input::ObjectEnum(void){
+
+	return PentaP1InputEnum;
+
+}
+/*}}}*/
+	
+/*PentaP1Input management*/
+/*FUNCTION PentaP1Input::copy{{{1*/
+Object* PentaP1Input::copy() {
+	
+	return new PentaP1Input(this->enum_type,this->values);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::InstanceEnum{{{1*/
+int PentaP1Input::InstanceEnum(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::SpawnTriaInput{{{1*/
+Input* PentaP1Input::SpawnTriaInput(int* indices){
+
+	/*output*/
+	TriaP1Input* outinput=NULL;
+	double newvalues[3];
+
+	/*Loop over the new indices*/
+	for(int i=0;i<3;i++){
+
+		/*Check index value*/
+		_assert_(indices[i]>=0 && indices[i]<6);
+
+		/*Assign value to new input*/
+		newvalues[i]=this->values[indices[i]];
+	}
+
+	/*Create new Tria input*/
+	outinput=new TriaP1Input(this->enum_type,&newvalues[0]);
+
+	/*Assign output*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::SpawnResult{{{1*/
+ElementResult* PentaP1Input::SpawnResult(int step, double time){
+
+	return new PentaP1ElementResult(this->enum_type,this->values,step,time);
+
+}
+/*}}}*/
+
+/*Object functions*/
+/*FUNCTION PentaP1Input::GetInputValue(double* pvalue,GaussPenta* gauss){{{1*/
+void PentaP1Input::GetInputValue(double* pvalue,GaussPenta* gauss){
+
+	/*Call PentaRef function*/
+	PentaRef::GetInputValue(pvalue,&values[0],gauss);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetInputDerivativeValue(double* p, double* xyz_list, GaussPenta* gauss){{{1*/
+void PentaP1Input::GetInputDerivativeValue(double* p, double* xyz_list, GaussPenta* gauss){
+
+	/*Call PentaRef function*/
+	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetVxStrainRate3d{{{1*/
+void PentaP1Input::GetVxStrainRate3d(double* epsilonvx,double* xyz_list, GaussPenta* gauss){
+	int i,j;
+
+	const int numnodes=6;
+	const int DOFVELOCITY=3;
+	double B[8][27];
+	double B_reduced[6][DOFVELOCITY*numnodes];
+	double velocity[numnodes][DOFVELOCITY];
+
+	/*Get B matrix: */
+	GetBStokes(&B[0][0], xyz_list, gauss);
+	/*Create a reduced matrix of B to get rid of pressure */
+	for (i=0;i<6;i++){
+		for (j=0;j<3;j++){
+			B_reduced[i][j]=B[i][j];
+		}
+		for (j=4;j<7;j++){
+			B_reduced[i][j-1]=B[i][j];
+		}
+		for (j=8;j<11;j++){
+			B_reduced[i][j-2]=B[i][j];
+		}
+		for (j=12;j<15;j++){
+			B_reduced[i][j-3]=B[i][j];
+		}
+		for (j=16;j<19;j++){
+			B_reduced[i][j-4]=B[i][j];
+		}
+		for (j=20;j<23;j++){
+			B_reduced[i][j-5]=B[i][j];
+		}
+	}
+
+	/*Here, we are computing the strain rate of (vx,0,0)*/
+	for(i=0;i<numnodes;i++){
+		velocity[i][0]=this->values[i];
+		velocity[i][1]=0.0;
+		velocity[i][2]=0.0;
+	}
+	/*Multiply B by velocity, to get strain rate: */
+	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvx,0);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetVyStrainRate3d{{{1*/
+void PentaP1Input::GetVyStrainRate3d(double* epsilonvy,double* xyz_list, GaussPenta* gauss){
+	int i,j;
+
+	const int numnodes=6;
+	const int DOFVELOCITY=3;
+	double B[8][27];
+	double B_reduced[6][DOFVELOCITY*numnodes];
+	double velocity[numnodes][DOFVELOCITY];
+
+	/*Get B matrix: */
+	GetBStokes(&B[0][0], xyz_list, gauss);
+	/*Create a reduced matrix of B to get rid of pressure */
+	for (i=0;i<6;i++){
+		for (j=0;j<3;j++){
+			B_reduced[i][j]=B[i][j];
+		}
+		for (j=4;j<7;j++){
+			B_reduced[i][j-1]=B[i][j];
+		}
+		for (j=8;j<11;j++){
+			B_reduced[i][j-2]=B[i][j];
+		}
+		for (j=12;j<15;j++){
+			B_reduced[i][j-3]=B[i][j];
+		}
+		for (j=16;j<19;j++){
+			B_reduced[i][j-4]=B[i][j];
+		}
+		for (j=20;j<23;j++){
+			B_reduced[i][j-5]=B[i][j];
+		}
+	}
+
+	/*Here, we are computing the strain rate of (0,vy,0)*/
+	for(i=0;i<numnodes;i++){
+		velocity[i][0]=0.0;
+		velocity[i][1]=this->values[i];
+		velocity[i][2]=0.0;
+	}
+	/*Multiply B by velocity, to get strain rate: */
+	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvy,0);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetVzStrainRate3d{{{1*/
+void PentaP1Input::GetVzStrainRate3d(double* epsilonvz,double* xyz_list, GaussPenta* gauss){
+	int i,j;
+
+	const int numnodes=6;
+	const int DOFVELOCITY=3;
+	double B[8][27];
+	double B_reduced[6][DOFVELOCITY*numnodes];
+	double velocity[numnodes][DOFVELOCITY];
+
+	/*Get B matrix: */
+	GetBStokes(&B[0][0], xyz_list, gauss);
+	/*Create a reduced matrix of B to get rid of pressure */
+	for (i=0;i<6;i++){
+		for (j=0;j<3;j++){
+			B_reduced[i][j]=B[i][j];
+		}
+		for (j=4;j<7;j++){
+			B_reduced[i][j-1]=B[i][j];
+		}
+		for (j=8;j<11;j++){
+			B_reduced[i][j-2]=B[i][j];
+		}
+		for (j=12;j<15;j++){
+			B_reduced[i][j-3]=B[i][j];
+		}
+		for (j=16;j<19;j++){
+			B_reduced[i][j-4]=B[i][j];
+		}
+		for (j=20;j<23;j++){
+			B_reduced[i][j-5]=B[i][j];
+		}
+	}
+
+	/*Here, we are computing the strain rate of (0,0,vz)*/
+	for(i=0;i<numnodes;i++){
+		velocity[i][0]=0.0;
+		velocity[i][1]=0.0;
+		velocity[i][2]=this->values[i];
+	}
+
+	/*Multiply B by velocity, to get strain rate: */
+	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvz,0);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetVxStrainRate3dPattyn{{{1*/
+void PentaP1Input::GetVxStrainRate3dPattyn(double* epsilonvx,double* xyz_list, GaussPenta* gauss){
+
+	int i;
+	const int numnodes=6;
+	double B[5][NDOF2*numnodes];
+	double velocity[numnodes][NDOF2];
+
+	/*Get B matrix: */
+	GetBPattyn(&B[0][0], xyz_list, gauss);
+
+	/*Here, we are computing the strain rate of (vx,0)*/
+	for(i=0;i<numnodes;i++){
+		velocity[i][0]=this->values[i];
+		velocity[i][1]=0.0;
+	}
+
+	/*Multiply B by velocity, to get strain rate: */
+	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
+				&velocity[0][0],NDOF2*numnodes,1,0,
+				epsilonvx,0);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetVyStrainRate3dPattyn{{{1*/
+void PentaP1Input::GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, GaussPenta* gauss){
+
+	int i;
+	const int numnodes=6;
+	double B[5][NDOF2*numnodes];
+	double velocity[numnodes][NDOF2];
+
+	/*Get B matrix: */
+	GetBPattyn(&B[0][0], xyz_list, gauss);
+
+	/*Here, we are computing the strain rate of (0,vy)*/
+	for(i=0;i<numnodes;i++){
+		velocity[i][0]=0.0;
+		velocity[i][1]=this->values[i];
+	}
+
+	/*Multiply B by velocity, to get strain rate: */
+	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
+				&velocity[0][0],NDOF2*numnodes,1,0,
+				epsilonvy,0);
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::ChangeEnum{{{1*/
+void PentaP1Input::ChangeEnum(int newenumtype){
+	this->enum_type=newenumtype;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetInputAverage{{{1*/
+void PentaP1Input::GetInputAverage(double* pvalue){
+	*pvalue=1./6.*(values[0]+values[1]+values[2]+values[3]+values[4]+values[5]);
+}
+/*}}}*/
+
+/*Intermediary*/
+/*FUNCTION PentaP1Input::SquareMin{{{1*/
+void PentaP1Input::SquareMin(double* psquaremin, bool process_units,Parameters* parameters){
+
+	int i;
+	const int numnodes=6;
+	double valuescopy[numnodes];
+	double squaremin;
+
+	/*First,  copy values, to process units if requested: */
+	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
+
+	/*Process units if requested: */
+	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
+
+	/*Now, figure out minimum of valuescopy: */
+	squaremin=pow(valuescopy[0],2);
+	for(i=1;i<numnodes;i++){
+		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
+	}
+	/*Assign output pointers:*/
+	*psquaremin=squaremin;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::ConstrainMin{{{1*/
+void PentaP1Input::ConstrainMin(double minimum){
+	
+	int i;
+	const int numnodes=6;
+
+	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::InfinityNorm{{{1*/
+double PentaP1Input::InfinityNorm(void){
+
+	/*Output*/
+	const int numnodes=6;
+	double norm=0;
+
+	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+	return norm;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Max{{{1*/
+double PentaP1Input::Max(void){
+
+	const int numnodes=6;
+	double    max=values[0];
+
+	for(int i=1;i<numnodes;i++){
+		if(values[i]>max) max=values[i];
+	}
+	return max;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::MaxAbs{{{1*/
+double PentaP1Input::MaxAbs(void){
+
+	const int numnodes=6;
+	double    max=fabs(values[0]);
+
+	for(int i=1;i<numnodes;i++){
+		if(fabs(values[i])>max) max=fabs(values[i]);
+	}
+	return max;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Min{{{1*/
+double PentaP1Input::Min(void){
+
+	const int numnodes=6;
+	double    min=values[0];
+
+	for(int i=1;i<numnodes;i++){
+		if(values[i]<min) min=values[i];
+	}
+	return min;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::MinAbs{{{1*/
+double PentaP1Input::MinAbs(void){
+
+	const int numnodes=6;
+	double    min=fabs(values[0]);
+
+	for(int i=1;i<numnodes;i++){
+		if(fabs(values[i])<min) min=fabs(values[i]);
+	}
+	return min;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Scale{{{1*/
+void PentaP1Input::Scale(double scale_factor){
+	
+	int i;
+	const int numnodes=6;
+
+	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::AXPY{{{1*/
+void PentaP1Input::AXPY(Input* xinput,double scalar){
+
+	int i;
+	const int numnodes=6;
+
+	/*xinput is of the same type, so cast it: */
+
+	/*Carry out the AXPY operation depending on type:*/
+	switch(xinput->ObjectEnum()){
+
+		case PentaP1InputEnum:{
+			PentaP1Input* cast_input=(PentaP1Input*)xinput;
+			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+			return;
+		case ControlInputEnum:{
+			ControlInput* cont_input=(ControlInput*)xinput;
+			if(cont_input->values->ObjectEnum()!=PentaP1InputEnum) _error_("not supported yet");
+			PentaP1Input* cast_input=(PentaP1Input*)cont_input->values;
+			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
+			return;
+		default:
+			_error_("not implemented yet");
+	}
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Constrain{{{1*/
+void PentaP1Input::Constrain(double cm_min, double cm_max){
+
+	int i;
+	const int numnodes=6;
+		
+	if(!isnan(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
+	if(!isnan(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Extrude{{{1*/
+void PentaP1Input::Extrude(void){
+
+	int i;
+
+	/*First 3 values copied on 3 last values*/
+	for(i=0;i<3;i++) this->values[3+i]=this->values[i];
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::VerticallyIntegrate{{{1*/
+void PentaP1Input::VerticallyIntegrate(Input* thickness_input){
+
+	/*Intermediaries*/
+	int i;
+	const int  numnodes = 6;
+	int        num_thickness_values;
+	double    *thickness_values = NULL;
+
+	/*Check that input provided is a thickness*/
+	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is %s)",EnumToStringx(thickness_input->InstanceEnum()));
+
+	/*Get Thickness value pointer*/
+	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
+
+	/*vertically integrate depending on type:*/
+	switch(thickness_input->ObjectEnum()){
+
+		case PentaP1InputEnum:
+			for(i=0;i<3;i++){
+				this->values[i]=0.5*(this->values[i]+this->values[i+3]) * thickness_values[i];
+				this->values[i+3]=this->values[i];
+			}
+			return;
+
+		default:
+			_error_("not implemented yet");
+	}
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::PointwiseDivide{{{1*/
+Input* PentaP1Input::PointwiseDivide(Input* inputB){
+
+	/*Ouput*/
+	PentaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	PentaP1Input *xinputB     = NULL;
+	int               B_numvalues;
+	const int         numnodes    = 6;
+	double            AdotBvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(PentaP1Input*)inputB;
+
+	/*Create point wise sum*/
+	for(i=0;i<numnodes;i++){
+		_assert_(xinputB->values[i]!=0);
+		AdotBvalues[i]=this->values[i]/xinputB->values[i];
+	}
+
+	/*Create new Penta vertex input (copy of current input)*/
+	outinput=new PentaP1Input(this->enum_type,&AdotBvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::PointwiseMin{{{1*/
+Input* PentaP1Input::PointwiseMin(Input* inputB){
+
+	/*Ouput*/
+	PentaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	PentaP1Input *xinputB     = NULL;
+	int               B_numvalues;
+	const int         numnodes    = 6;
+	double            minvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(PentaP1Input*)inputB;
+
+	/*Create point wise min*/
+	for(i=0;i<numnodes;i++){
+		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
+		else minvalues[i]=this->values[i];
+	}
+
+	/*Create new Penta vertex input (copy of current input)*/
+	outinput=new PentaP1Input(this->enum_type,&minvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::PointwiseMax{{{1*/
+Input* PentaP1Input::PointwiseMax(Input* inputB){
+
+	/*Ouput*/
+	PentaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	PentaP1Input *xinputB     = NULL;
+	int               B_numvalues;
+	const int         numnodes    = 6;
+	double            maxvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=PentaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(PentaP1Input*)inputB;
+
+	/*Create point wise max*/
+	for(i=0;i<numnodes;i++){
+		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
+		else maxvalues[i]=this->values[i];
+	}
+
+	/*Create new Penta vertex input (copy of current input)*/
+	outinput=new PentaP1Input(this->enum_type,&maxvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::GetVectorFromInputs{{{1*/
+void PentaP1Input::GetVectorFromInputs(Vec vector,int* doflist){
+
+	const int numvertices=6;
+	VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);
+
+} /*}}}*/
+/*FUNCTION PentaP1Input::GetValuesPtr{{{1*/
+void PentaP1Input::GetValuesPtr(double** pvalues,int* pnum_values){
+
+	*pvalues=this->values;
+	*pnum_values=6;
+
+}
+/*}}}*/
+/*FUNCTION PentaP1Input::Configure{{{1*/
+void PentaP1Input::Configure(Parameters* parameters){
+	/*do nothing: */
+}
+/*}}}*/

Copied: issm/trunk/src/c/objects/Inputs/PentaP1Input.h (from rev 11526, issm/trunk-jpl/src/c/objects/Inputs/PentaP1Input.h)
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaP1Input.h	                        (rev 0)
+++ issm/trunk/src/c/objects/Inputs/PentaP1Input.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,89 @@
+/*! \file PentaP1Input.h 
+ *  \brief: header file for PentaP1Input object
+ */
+
+
+#ifndef _PENTAP1INPUT_H_
+#define _PENTAP1INPUT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "./Input.h"
+#include "../Elements/PentaRef.h"
+class GaussTria;
+/*}}}*/
+
+class PentaP1Input: public Input, public PentaRef{
+
+	public:
+		/*just hold 6 values for 6 vertices: */
+		int    enum_type;
+		double values[6];
+
+		/*PentaP1Input constructors, destructors: {{{1*/
+		PentaP1Input();
+		PentaP1Input(int enum_type,double* values);
+		~PentaP1Input();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		#ifdef _SERIAL_
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		#endif
+		int   ObjectEnum();
+		Object* copy();
+		/*}}}*/
+		/*PentaP1Input management: {{{1*/
+		int   InstanceEnum();
+		Input* SpawnTriaInput(int* indices);
+		Input* PointwiseDivide(Input* inputB);
+		Input* PointwiseMin(Input* inputB);
+		Input* PointwiseMax(Input* inputB);
+		ElementResult* SpawnResult(int step, double time);
+		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
+		void Configure(Parameters* parameters);
+		/*}}}*/
+		/*numerics: {{{1*/
+		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
+		void GetInputValue(int* pvalue){_error_("not implemented yet");};
+		void GetInputValue(double* pvalue){_error_("not implemented yet");};
+		void GetInputValue(double* pvalue,GaussTria* gauss){_error_("not implemented yet");};
+		void GetInputValue(double* pvalue,GaussPenta* gauss);
+		void GetInputValue(double* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+		void GetInputValue(double* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
+		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussPenta* gauss);
+		void GetInputAverage(double* pvalue);
+		void GetVxStrainRate2d(double* epsilonvx,double* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+		void GetVyStrainRate2d(double* epsilonvy,double* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
+		void GetVxStrainRate3d(double* epsilonvx,double* xyz_list, GaussPenta* gauss);
+		void GetVyStrainRate3d(double* epsilonvy,double* xyz_list, GaussPenta* gauss);
+		void GetVzStrainRate3d(double* epsilonvz,double* xyz_list, GaussPenta* gauss);
+		void GetVxStrainRate3dPattyn(double* epsilonvx,double* xyz_list, GaussPenta* gauss);
+		void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, GaussPenta* gauss);
+		void ChangeEnum(int newenumtype);
+
+		void SquareMin(double* psquaremin, bool process_units,Parameters* parameters);
+		void ConstrainMin(double minimum);
+		void Scale(double scale_factor);
+		void ArtificialNoise(double min,double max){_error_("not implemented yet");};
+		void AXPY(Input* xinput,double scalar);
+		void Constrain(double cm_min, double cm_max);
+		double InfinityNorm(void);
+		double Max(void);
+		double MaxAbs(void);
+		double Min(void);
+		double MinAbs(void);
+		void Extrude(void);
+		void VerticallyIntegrate(Input* thickness_input);
+		void GetVectorFromInputs(Vec vector,int* doflist);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
+		/*}}}*/
+
+};
+#endif  /* _PENTAP1INPUT_H */

Deleted: issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,680 +0,0 @@
-/*!\file PentaVertexInput.c
- * \brief: implementation of the PentaVertexInput 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 "../objects.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-#include "../../shared/shared.h"
-#include "../../Container/Container.h"
-#include "../../include/include.h"
-
-/*PentaVertexInput constructors and destructor*/
-/*FUNCTION PentaVertexInput::PentaVertexInput(){{{1*/
-PentaVertexInput::PentaVertexInput(){
-	return;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::PentaVertexInput(int in_enum_type,double* values){{{1*/
-PentaVertexInput::PentaVertexInput(int in_enum_type,double* in_values)
-		:PentaRef(1)
-{
-
-	/*Set PentaRef*/
-	this->SetElementType(P1Enum,0);
-	this->element_type=P1Enum;
-
-	enum_type=in_enum_type;
-	values[0]=in_values[0];
-	values[1]=in_values[1];
-	values[2]=in_values[2];
-	values[3]=in_values[3];
-	values[4]=in_values[4];
-	values[5]=in_values[5];
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::~PentaVertexInput(){{{1*/
-PentaVertexInput::~PentaVertexInput(){
-	return;
-}
-/*}}}*/
-
-/*Object virtual functions definitions:*/
-/*FUNCTION PentaVertexInput::Echo {{{1*/
-void PentaVertexInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::DeepEcho{{{1*/
-void PentaVertexInput::DeepEcho(void){
-
-	printf("PentaVertexInput:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
-	printf("   values: [%g %g %g %g %g %g]\n",this->values[0],this->values[1],this->values[2],this->values[3],this->values[4],this->values[5]);
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Id{{{1*/
-int    PentaVertexInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION PentaVertexInput::MyRank{{{1*/
-int    PentaVertexInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION PentaVertexInput::Marshall{{{1*/
-void  PentaVertexInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of PentaVertexInput: */
-	enum_value=PentaVertexInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall PentaVertexInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::MarshallSize{{{1*/
-int   PentaVertexInput::MarshallSize(){
-	
-	return sizeof(values)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Demarshall{{{1*/
-void  PentaVertexInput::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-#endif
-/*FUNCTION PentaVertexInput::ObjectEnum{{{1*/
-int PentaVertexInput::ObjectEnum(void){
-
-	return PentaVertexInputEnum;
-
-}
-/*}}}*/
-	
-/*PentaVertexInput management*/
-/*FUNCTION PentaVertexInput::copy{{{1*/
-Object* PentaVertexInput::copy() {
-	
-	return new PentaVertexInput(this->enum_type,this->values);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::InstanceEnum{{{1*/
-int PentaVertexInput::InstanceEnum(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::SpawnTriaInput{{{1*/
-Input* PentaVertexInput::SpawnTriaInput(int* indices){
-
-	/*output*/
-	TriaVertexInput* outinput=NULL;
-	double newvalues[3];
-
-	/*Loop over the new indices*/
-	for(int i=0;i<3;i++){
-
-		/*Check index value*/
-		_assert_(indices[i]>=0 && indices[i]<6);
-
-		/*Assign value to new input*/
-		newvalues[i]=this->values[indices[i]];
-	}
-
-	/*Create new Tria input*/
-	outinput=new TriaVertexInput(this->enum_type,&newvalues[0]);
-
-	/*Assign output*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::SpawnResult{{{1*/
-ElementResult* PentaVertexInput::SpawnResult(int step, double time){
-
-	return new PentaVertexElementResult(this->enum_type,this->values,step,time);
-
-}
-/*}}}*/
-
-/*Object functions*/
-/*FUNCTION PentaVertexInput::GetInputValue(double* pvalue,GaussPenta* gauss){{{1*/
-void PentaVertexInput::GetInputValue(double* pvalue,GaussPenta* gauss){
-
-	/*Call PentaRef function*/
-	PentaRef::GetInputValue(pvalue,&values[0],gauss);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetInputDerivativeValue(double* p, double* xyz_list, GaussPenta* gauss){{{1*/
-void PentaVertexInput::GetInputDerivativeValue(double* p, double* xyz_list, GaussPenta* gauss){
-
-	/*Call PentaRef function*/
-	PentaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetVxStrainRate3d{{{1*/
-void PentaVertexInput::GetVxStrainRate3d(double* epsilonvx,double* xyz_list, GaussPenta* gauss){
-	int i,j;
-
-	const int numnodes=6;
-	const int DOFVELOCITY=3;
-	double B[8][27];
-	double B_reduced[6][DOFVELOCITY*numnodes];
-	double velocity[numnodes][DOFVELOCITY];
-
-	/*Get B matrix: */
-	GetBStokes(&B[0][0], xyz_list, gauss);
-	/*Create a reduced matrix of B to get rid of pressure */
-	for (i=0;i<6;i++){
-		for (j=0;j<3;j++){
-			B_reduced[i][j]=B[i][j];
-		}
-		for (j=4;j<7;j++){
-			B_reduced[i][j-1]=B[i][j];
-		}
-		for (j=8;j<11;j++){
-			B_reduced[i][j-2]=B[i][j];
-		}
-		for (j=12;j<15;j++){
-			B_reduced[i][j-3]=B[i][j];
-		}
-		for (j=16;j<19;j++){
-			B_reduced[i][j-4]=B[i][j];
-		}
-		for (j=20;j<23;j++){
-			B_reduced[i][j-5]=B[i][j];
-		}
-	}
-
-	/*Here, we are computing the strain rate of (vx,0,0)*/
-	for(i=0;i<numnodes;i++){
-		velocity[i][0]=this->values[i];
-		velocity[i][1]=0.0;
-		velocity[i][2]=0.0;
-	}
-	/*Multiply B by velocity, to get strain rate: */
-	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvx,0);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetVyStrainRate3d{{{1*/
-void PentaVertexInput::GetVyStrainRate3d(double* epsilonvy,double* xyz_list, GaussPenta* gauss){
-	int i,j;
-
-	const int numnodes=6;
-	const int DOFVELOCITY=3;
-	double B[8][27];
-	double B_reduced[6][DOFVELOCITY*numnodes];
-	double velocity[numnodes][DOFVELOCITY];
-
-	/*Get B matrix: */
-	GetBStokes(&B[0][0], xyz_list, gauss);
-	/*Create a reduced matrix of B to get rid of pressure */
-	for (i=0;i<6;i++){
-		for (j=0;j<3;j++){
-			B_reduced[i][j]=B[i][j];
-		}
-		for (j=4;j<7;j++){
-			B_reduced[i][j-1]=B[i][j];
-		}
-		for (j=8;j<11;j++){
-			B_reduced[i][j-2]=B[i][j];
-		}
-		for (j=12;j<15;j++){
-			B_reduced[i][j-3]=B[i][j];
-		}
-		for (j=16;j<19;j++){
-			B_reduced[i][j-4]=B[i][j];
-		}
-		for (j=20;j<23;j++){
-			B_reduced[i][j-5]=B[i][j];
-		}
-	}
-
-	/*Here, we are computing the strain rate of (0,vy,0)*/
-	for(i=0;i<numnodes;i++){
-		velocity[i][0]=0.0;
-		velocity[i][1]=this->values[i];
-		velocity[i][2]=0.0;
-	}
-	/*Multiply B by velocity, to get strain rate: */
-	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvy,0);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetVzStrainRate3d{{{1*/
-void PentaVertexInput::GetVzStrainRate3d(double* epsilonvz,double* xyz_list, GaussPenta* gauss){
-	int i,j;
-
-	const int numnodes=6;
-	const int DOFVELOCITY=3;
-	double B[8][27];
-	double B_reduced[6][DOFVELOCITY*numnodes];
-	double velocity[numnodes][DOFVELOCITY];
-
-	/*Get B matrix: */
-	GetBStokes(&B[0][0], xyz_list, gauss);
-	/*Create a reduced matrix of B to get rid of pressure */
-	for (i=0;i<6;i++){
-		for (j=0;j<3;j++){
-			B_reduced[i][j]=B[i][j];
-		}
-		for (j=4;j<7;j++){
-			B_reduced[i][j-1]=B[i][j];
-		}
-		for (j=8;j<11;j++){
-			B_reduced[i][j-2]=B[i][j];
-		}
-		for (j=12;j<15;j++){
-			B_reduced[i][j-3]=B[i][j];
-		}
-		for (j=16;j<19;j++){
-			B_reduced[i][j-4]=B[i][j];
-		}
-		for (j=20;j<23;j++){
-			B_reduced[i][j-5]=B[i][j];
-		}
-	}
-
-	/*Here, we are computing the strain rate of (0,0,vz)*/
-	for(i=0;i<numnodes;i++){
-		velocity[i][0]=0.0;
-		velocity[i][1]=0.0;
-		velocity[i][2]=this->values[i];
-	}
-
-	/*Multiply B by velocity, to get strain rate: */
-	MatrixMultiply(&B_reduced[0][0],6,DOFVELOCITY*numnodes,0,&velocity[0][0],DOFVELOCITY*numnodes,1,0,epsilonvz,0);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetVxStrainRate3dPattyn{{{1*/
-void PentaVertexInput::GetVxStrainRate3dPattyn(double* epsilonvx,double* xyz_list, GaussPenta* gauss){
-
-	int i;
-	const int numnodes=6;
-	double B[5][NDOF2*numnodes];
-	double velocity[numnodes][NDOF2];
-
-	/*Get B matrix: */
-	GetBPattyn(&B[0][0], xyz_list, gauss);
-
-	/*Here, we are computing the strain rate of (vx,0)*/
-	for(i=0;i<numnodes;i++){
-		velocity[i][0]=this->values[i];
-		velocity[i][1]=0.0;
-	}
-
-	/*Multiply B by velocity, to get strain rate: */
-	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
-				&velocity[0][0],NDOF2*numnodes,1,0,
-				epsilonvx,0);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetVyStrainRate3dPattyn{{{1*/
-void PentaVertexInput::GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, GaussPenta* gauss){
-
-	int i;
-	const int numnodes=6;
-	double B[5][NDOF2*numnodes];
-	double velocity[numnodes][NDOF2];
-
-	/*Get B matrix: */
-	GetBPattyn(&B[0][0], xyz_list, gauss);
-
-	/*Here, we are computing the strain rate of (0,vy)*/
-	for(i=0;i<numnodes;i++){
-		velocity[i][0]=0.0;
-		velocity[i][1]=this->values[i];
-	}
-
-	/*Multiply B by velocity, to get strain rate: */
-	MatrixMultiply( &B[0][0],5,NDOF2*numnodes,0,
-				&velocity[0][0],NDOF2*numnodes,1,0,
-				epsilonvy,0);
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::ChangeEnum{{{1*/
-void PentaVertexInput::ChangeEnum(int newenumtype){
-	this->enum_type=newenumtype;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetInputAverage{{{1*/
-void PentaVertexInput::GetInputAverage(double* pvalue){
-	*pvalue=1./6.*(values[0]+values[1]+values[2]+values[3]+values[4]+values[5]);
-}
-/*}}}*/
-
-/*Intermediary*/
-/*FUNCTION PentaVertexInput::SquareMin{{{1*/
-void PentaVertexInput::SquareMin(double* psquaremin, bool process_units,Parameters* parameters){
-
-	int i;
-	const int numnodes=6;
-	double valuescopy[numnodes];
-	double squaremin;
-
-	/*First,  copy values, to process units if requested: */
-	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
-
-	/*Process units if requested: */
-	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
-
-	/*Now, figure out minimum of valuescopy: */
-	squaremin=pow(valuescopy[0],2);
-	for(i=1;i<numnodes;i++){
-		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
-	}
-	/*Assign output pointers:*/
-	*psquaremin=squaremin;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::ConstrainMin{{{1*/
-void PentaVertexInput::ConstrainMin(double minimum){
-	
-	int i;
-	const int numnodes=6;
-
-	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::InfinityNorm{{{1*/
-double PentaVertexInput::InfinityNorm(void){
-
-	/*Output*/
-	const int numnodes=6;
-	double norm=0;
-
-	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
-	return norm;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Max{{{1*/
-double PentaVertexInput::Max(void){
-
-	const int numnodes=6;
-	double    max=values[0];
-
-	for(int i=1;i<numnodes;i++){
-		if(values[i]>max) max=values[i];
-	}
-	return max;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::MaxAbs{{{1*/
-double PentaVertexInput::MaxAbs(void){
-
-	const int numnodes=6;
-	double    max=fabs(values[0]);
-
-	for(int i=1;i<numnodes;i++){
-		if(fabs(values[i])>max) max=fabs(values[i]);
-	}
-	return max;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Min{{{1*/
-double PentaVertexInput::Min(void){
-
-	const int numnodes=6;
-	double    min=values[0];
-
-	for(int i=1;i<numnodes;i++){
-		if(values[i]<min) min=values[i];
-	}
-	return min;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::MinAbs{{{1*/
-double PentaVertexInput::MinAbs(void){
-
-	const int numnodes=6;
-	double    min=fabs(values[0]);
-
-	for(int i=1;i<numnodes;i++){
-		if(fabs(values[i])<min) min=fabs(values[i]);
-	}
-	return min;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Scale{{{1*/
-void PentaVertexInput::Scale(double scale_factor){
-	
-	int i;
-	const int numnodes=6;
-
-	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::AXPY{{{1*/
-void PentaVertexInput::AXPY(Input* xinput,double scalar){
-
-	int i;
-	const int numnodes=6;
-
-	/*xinput is of the same type, so cast it: */
-
-	/*Carry out the AXPY operation depending on type:*/
-	switch(xinput->ObjectEnum()){
-
-		case PentaVertexInputEnum:{
-			PentaVertexInput* cast_input=(PentaVertexInput*)xinput;
-			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
-			return;
-		case ControlInputEnum:{
-			ControlInput* cont_input=(ControlInput*)xinput;
-			if(cont_input->values->ObjectEnum()!=PentaVertexInputEnum) _error_("not supported yet");
-			PentaVertexInput* cast_input=(PentaVertexInput*)cont_input->values;
-			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*(cast_input->values[i]);}
-			return;
-		default:
-			_error_("not implemented yet");
-	}
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Constrain{{{1*/
-void PentaVertexInput::Constrain(double cm_min, double cm_max){
-
-	int i;
-	const int numnodes=6;
-		
-	if(!isnan(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
-	if(!isnan(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Extrude{{{1*/
-void PentaVertexInput::Extrude(void){
-
-	int i;
-
-	/*First 3 values copied on 3 last values*/
-	for(i=0;i<3;i++) this->values[3+i]=this->values[i];
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::VerticallyIntegrate{{{1*/
-void PentaVertexInput::VerticallyIntegrate(Input* thickness_input){
-
-	/*Intermediaries*/
-	int i;
-	const int  numnodes = 6;
-	int        num_thickness_values;
-	double    *thickness_values = NULL;
-
-	/*Check that input provided is a thickness*/
-	if (thickness_input->InstanceEnum()!=ThicknessEnum) _error_("Input provided is not a Thickness (enum_type is %s)",EnumToStringx(thickness_input->InstanceEnum()));
-
-	/*Get Thickness value pointer*/
-	thickness_input->GetValuesPtr(&thickness_values,&num_thickness_values);
-
-	/*vertically integrate depending on type:*/
-	switch(thickness_input->ObjectEnum()){
-
-		case PentaVertexInputEnum:
-			for(i=0;i<3;i++){
-				this->values[i]=0.5*(this->values[i]+this->values[i+3]) * thickness_values[i];
-				this->values[i+3]=this->values[i];
-			}
-			return;
-
-		default:
-			_error_("not implemented yet");
-	}
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::PointwiseDivide{{{1*/
-Input* PentaVertexInput::PointwiseDivide(Input* inputB){
-
-	/*Ouput*/
-	PentaVertexInput* outinput=NULL;
-
-	/*Intermediaries*/
-	int               i;
-	PentaVertexInput *xinputB     = NULL;
-	int               B_numvalues;
-	const int         numnodes    = 6;
-	double            AdotBvalues[numnodes];
-
-	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=PentaVertexInputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
-	xinputB=(PentaVertexInput*)inputB;
-
-	/*Create point wise sum*/
-	for(i=0;i<numnodes;i++){
-		_assert_(xinputB->values[i]!=0);
-		AdotBvalues[i]=this->values[i]/xinputB->values[i];
-	}
-
-	/*Create new Penta vertex input (copy of current input)*/
-	outinput=new PentaVertexInput(this->enum_type,&AdotBvalues[0]);
-
-	/*Return output pointer*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::PointwiseMin{{{1*/
-Input* PentaVertexInput::PointwiseMin(Input* inputB){
-
-	/*Ouput*/
-	PentaVertexInput* outinput=NULL;
-
-	/*Intermediaries*/
-	int               i;
-	PentaVertexInput *xinputB     = NULL;
-	int               B_numvalues;
-	const int         numnodes    = 6;
-	double            minvalues[numnodes];
-
-	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=PentaVertexInputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
-	xinputB=(PentaVertexInput*)inputB;
-
-	/*Create point wise min*/
-	for(i=0;i<numnodes;i++){
-		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
-		else minvalues[i]=this->values[i];
-	}
-
-	/*Create new Penta vertex input (copy of current input)*/
-	outinput=new PentaVertexInput(this->enum_type,&minvalues[0]);
-
-	/*Return output pointer*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::PointwiseMax{{{1*/
-Input* PentaVertexInput::PointwiseMax(Input* inputB){
-
-	/*Ouput*/
-	PentaVertexInput* outinput=NULL;
-
-	/*Intermediaries*/
-	int               i;
-	PentaVertexInput *xinputB     = NULL;
-	int               B_numvalues;
-	const int         numnodes    = 6;
-	double            maxvalues[numnodes];
-
-	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=PentaVertexInputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
-	xinputB=(PentaVertexInput*)inputB;
-
-	/*Create point wise max*/
-	for(i=0;i<numnodes;i++){
-		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
-		else maxvalues[i]=this->values[i];
-	}
-
-	/*Create new Penta vertex input (copy of current input)*/
-	outinput=new PentaVertexInput(this->enum_type,&maxvalues[0]);
-
-	/*Return output pointer*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::GetVectorFromInputs{{{1*/
-void PentaVertexInput::GetVectorFromInputs(Vec vector,int* doflist){
-
-	const int numvertices=6;
-	VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);
-
-} /*}}}*/
-/*FUNCTION PentaVertexInput::GetValuesPtr{{{1*/
-void PentaVertexInput::GetValuesPtr(double** pvalues,int* pnum_values){
-
-	*pvalues=this->values;
-	*pnum_values=6;
-
-}
-/*}}}*/
-/*FUNCTION PentaVertexInput::Configure{{{1*/
-void PentaVertexInput::Configure(Parameters* parameters){
-	/*do nothing: */
-}
-/*}}}*/

Deleted: issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/PentaVertexInput.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,89 +0,0 @@
-/*! \file PentaVertexInput.h 
- *  \brief: header file for triavertexinput object
- */
-
-
-#ifndef _PENTAVERTEXINPUT_H_
-#define _PENTAVERTEXINPUT_H_
-
-/*Headers:*/
-/*{{{1*/
-#include "./Input.h"
-#include "../Elements/PentaRef.h"
-class GaussTria;
-/*}}}*/
-
-class PentaVertexInput: public Input, public PentaRef{
-
-	public:
-		/*just hold 6 values for 6 vertices: */
-		int    enum_type;
-		double values[6];
-
-		/*PentaVertexInput constructors, destructors: {{{1*/
-		PentaVertexInput();
-		PentaVertexInput(int enum_type,double* values);
-		~PentaVertexInput();
-		/*}}}*/
-		/*Object virtual functions definitions:{{{1 */
-		void  Echo();
-		void  DeepEcho();
-		int   Id(); 
-		int   MyRank();
-		#ifdef _SERIAL_
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		void  Demarshall(char** pmarshalled_dataset);
-		#endif
-		int   ObjectEnum();
-		Object* copy();
-		/*}}}*/
-		/*PentaVertexInput management: {{{1*/
-		int   InstanceEnum();
-		Input* SpawnTriaInput(int* indices);
-		Input* PointwiseDivide(Input* inputB);
-		Input* PointwiseMin(Input* inputB);
-		Input* PointwiseMax(Input* inputB);
-		ElementResult* SpawnResult(int step, double time);
-		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
-		void Configure(Parameters* parameters);
-		/*}}}*/
-		/*numerics: {{{1*/
-		void GetInputValue(bool* pvalue){_error_("not implemented yet");};
-		void GetInputValue(int* pvalue){_error_("not implemented yet");};
-		void GetInputValue(double* pvalue){_error_("not implemented yet");};
-		void GetInputValue(double* pvalue,GaussTria* gauss){_error_("not implemented yet");};
-		void GetInputValue(double* pvalue,GaussPenta* gauss);
-		void GetInputValue(double* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
-		void GetInputValue(double* pvalue,GaussPenta* gauss ,int index){_error_("not implemented yet");};
-		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
-		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussPenta* gauss);
-		void GetInputAverage(double* pvalue);
-		void GetVxStrainRate2d(double* epsilonvx,double* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
-		void GetVyStrainRate2d(double* epsilonvy,double* xyz_list, GaussTria* gauss){_error_("not implemented yet");};
-		void GetVxStrainRate3d(double* epsilonvx,double* xyz_list, GaussPenta* gauss);
-		void GetVyStrainRate3d(double* epsilonvy,double* xyz_list, GaussPenta* gauss);
-		void GetVzStrainRate3d(double* epsilonvz,double* xyz_list, GaussPenta* gauss);
-		void GetVxStrainRate3dPattyn(double* epsilonvx,double* xyz_list, GaussPenta* gauss);
-		void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, GaussPenta* gauss);
-		void ChangeEnum(int newenumtype);
-
-		void SquareMin(double* psquaremin, bool process_units,Parameters* parameters);
-		void ConstrainMin(double minimum);
-		void Scale(double scale_factor);
-		void ArtificialNoise(double min,double max){_error_("not implemented yet");};
-		void AXPY(Input* xinput,double scalar);
-		void Constrain(double cm_min, double cm_max);
-		double InfinityNorm(void);
-		double Max(void);
-		double MaxAbs(void);
-		double Min(void);
-		double MinAbs(void);
-		void Extrude(void);
-		void VerticallyIntegrate(Input* thickness_input);
-		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double** pvalues,int* pnum_values);
-		/*}}}*/
-
-};
-#endif  /* _PENTAVERTEXINPUT_H */

Copied: issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp (from rev 11526, issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.cpp)
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp	                        (rev 0)
+++ issm/trunk/src/c/objects/Inputs/TriaP1Input.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,473 @@
+/*!\file TriaP1Input.c
+ * \brief: implementation of the TriaP1Input 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 "../objects.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+#include "../../shared/shared.h"
+#include "../../Container/Container.h"
+#include "../../include/include.h"
+
+/*TriaP1Input constructors and destructor*/
+/*FUNCTION TriaP1Input::TriaP1Input(){{{1*/
+TriaP1Input::TriaP1Input(){
+	return;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::TriaP1Input(int in_enum_type,double* values){{{1*/
+TriaP1Input::TriaP1Input(int in_enum_type,double* in_values)
+	:TriaRef(1)
+{
+
+	/*Set TriaRef*/
+	this->SetElementType(P1Enum,0);
+	this->element_type=P1Enum;
+
+	/*Set Enum*/
+	enum_type=in_enum_type;
+
+	/*Set values*/
+	values[0]=in_values[0];
+	values[1]=in_values[1];
+	values[2]=in_values[2];
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::~TriaP1Input(){{{1*/
+TriaP1Input::~TriaP1Input(){
+	return;
+}
+/*}}}*/
+
+/*Object virtual functions definitions:*/
+/*FUNCTION TriaP1Input::Echo {{{1*/
+void TriaP1Input::Echo(void){
+	this->DeepEcho();
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::DeepEcho{{{1*/
+void TriaP1Input::DeepEcho(void){
+
+	printf("TriaP1Input:\n");
+	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
+	printf("   values: [%g %g %g]\n",this->values[0],this->values[1],this->values[2]);
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Id{{{1*/
+int    TriaP1Input::Id(void){ return -1; }
+/*}}}*/
+/*FUNCTION TriaP1Input::MyRank{{{1*/
+int    TriaP1Input::MyRank(void){ 
+	extern int my_rank;
+	return my_rank; 
+}
+/*}}}*/
+#ifdef _SERIAL_
+/*FUNCTION TriaP1Input::Marshall{{{1*/
+void  TriaP1Input::Marshall(char** pmarshalled_dataset){
+
+	char* marshalled_dataset=NULL;
+	int   enum_value=0;
+
+	/*recover marshalled_dataset: */
+	marshalled_dataset=*pmarshalled_dataset;
+
+	/*get enum value of TriaP1Input: */
+	enum_value=TriaP1InputEnum;
+	
+	/*marshall enum: */
+	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
+	
+	/*marshall TriaP1Input data: */
+	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	*pmarshalled_dataset=marshalled_dataset;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::MarshallSize{{{1*/
+int   TriaP1Input::MarshallSize(){
+	
+	return sizeof(values)+
+		+sizeof(enum_type)+
+		+sizeof(int); //sizeof(int) for enum value
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Demarshall{{{1*/
+void  TriaP1Input::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
+	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
+
+	/*return: */
+	*pmarshalled_dataset=marshalled_dataset;
+	return;
+}
+/*}}}*/
+#endif
+/*FUNCTION TriaP1Input::ObjectEnum{{{1*/
+int TriaP1Input::ObjectEnum(void){
+
+	return TriaP1InputEnum;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::copy{{{1*/
+Object* TriaP1Input::copy() {
+	
+	return new TriaP1Input(this->enum_type,this->values);
+
+}
+/*}}}*/
+	
+/*TriaP1Input management*/
+/*FUNCTION TriaP1Input::InstanceEnum{{{1*/
+int TriaP1Input::InstanceEnum(void){
+
+	return this->enum_type;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::SpawnTriaInput{{{1*/
+Input* TriaP1Input::SpawnTriaInput(int* indices){
+
+	/*output*/
+	TriaP1Input* outinput=NULL;
+
+	/*Create new Tria input (copy of current input)*/
+	outinput=new TriaP1Input(this->enum_type,&this->values[0]);
+
+	/*Assign output*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::SpawnResult{{{1*/
+ElementResult* TriaP1Input::SpawnResult(int step, double time){
+
+	return new TriaP1ElementResult(this->enum_type,this->values,step,time);
+
+}
+/*}}}*/
+
+/*Object functions*/
+/*FUNCTION TriaP1Input::GetInputValue(double* pvalue,GaussTria* gauss){{{1*/
+void TriaP1Input::GetInputValue(double* pvalue,GaussTria* gauss){
+
+	/*Call TriaRef function*/
+	TriaRef::GetInputValue(pvalue,&values[0],gauss);
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::GetInputDerivativeValue(double* p, double* xyz_list, GaussTria* gauss){{{1*/
+void TriaP1Input::GetInputDerivativeValue(double* p, double* xyz_list, GaussTria* gauss){
+
+	/*Call TriaRef function*/
+	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::GetVxStrainRate2d{{{1*/
+void TriaP1Input::GetVxStrainRate2d(double* epsilonvx,double* xyz_list, GaussTria* gauss){
+
+	/*Intermediary*/
+	int       i;
+	const int numnodes=3;
+	double B[3][NDOF2*numnodes];
+	double velocity[3][NDOF2];
+
+	/*Get B matrix: */
+	GetBMacAyeal(&B[0][0], xyz_list, gauss);
+
+	/*Here, we are computing the strain rate of (vx,0)*/
+	for(i=0;i<3;i++){
+		velocity[i][0]=this->values[i];
+		velocity[i][1]=0.0;
+	}
+	/*Get epsilon(vx) = B*velocity*/
+	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
+				&velocity[0][0],NDOF2*numnodes,1,0,
+				epsilonvx,0);
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::GetVyStrainRate2d{{{1*/
+void TriaP1Input::GetVyStrainRate2d(double* epsilonvy,double* xyz_list, GaussTria* gauss){
+
+	/*Intermediary*/
+	int       i;
+	const int numnodes=3;
+	double B[3][NDOF2*numnodes];
+	double velocity[3][NDOF2];
+
+	/*Get B matrix: */
+	GetBMacAyeal(&B[0][0], xyz_list, gauss);
+
+	/*Here, we are computing the strain rate of (0,vy)*/
+	for(i=0;i<3;i++){
+		velocity[i][0]=0.0;
+		velocity[i][1]=this->values[i];
+	}
+	/*Get epsilon(vy) = B*velocity*/
+	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
+				&velocity[0][0],NDOF2*numnodes,1,0,
+				epsilonvy,0);
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::ChangeEnum{{{1*/
+void TriaP1Input::ChangeEnum(int newenumtype){
+	this->enum_type=newenumtype;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::GetInputAverage{{{1*/
+void TriaP1Input::GetInputAverage(double* pvalue){
+	*pvalue=1./3.*(values[0]+values[1]+values[2]);
+}
+/*}}}*/
+
+/*Intermediary*/
+/*FUNCTION TriaP1Input::SquareMin{{{1*/
+void TriaP1Input::SquareMin(double* psquaremin, bool process_units,Parameters* parameters){
+
+	int i;
+	const int numnodes=3;
+	double valuescopy[numnodes];
+	double squaremin;
+
+	/*First,  copy values, to process units if requested: */
+	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
+
+	/*Process units if requested: */
+	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
+
+	/*Now, figure out minimum of valuescopy: */
+	squaremin=pow(valuescopy[0],2);
+	for(i=1;i<numnodes;i++){
+		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
+	}
+	/*Assign output pointers:*/
+	*psquaremin=squaremin;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::ContrainMin{{{1*/
+void TriaP1Input::ConstrainMin(double minimum){
+	
+	int i;
+	const int numnodes=3;
+
+	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::InfinityNorm{{{1*/
+double TriaP1Input::InfinityNorm(void){
+
+	/*Output*/
+	double norm=0;
+	const int numnodes=3;
+
+	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
+	return norm;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Max{{{1*/
+double TriaP1Input::Max(void){
+
+	const int numnodes=3;
+	double    max=values[0];
+
+	for(int i=1;i<numnodes;i++){
+		if(values[i]>max) max=values[i];
+	}
+	return max;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::MaxAbs{{{1*/
+double TriaP1Input::MaxAbs(void){
+
+	const int numnodes=3;
+	double    max=fabs(values[0]);
+
+	for(int i=1;i<numnodes;i++){
+		if(fabs(values[i])>max) max=fabs(values[i]);
+	}
+	return max;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Min{{{1*/
+double TriaP1Input::Min(void){
+
+	const int numnodes=3;
+	double    min=values[0];
+
+	for(int i=1;i<numnodes;i++){
+		if(values[i]<min) min=values[i];
+	}
+	return min;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::MinAbs{{{1*/
+double TriaP1Input::MinAbs(void){
+
+	const int numnodes=3;
+	double    min=fabs(values[0]);
+
+	for(int i=1;i<numnodes;i++){
+		if(fabs(values[i])<min) min=fabs(values[i]);
+	}
+	return min;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Scale{{{1*/
+void TriaP1Input::Scale(double scale_factor){
+	
+	int i;
+	const int numnodes=3;
+
+	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::ArtificialNoise{{{1*/
+void TriaP1Input::ArtificialNoise(double min,double max){
+
+	int i;
+	const int numnodes=3;
+	double noise;
+
+	/*Compute random number between bounds:
+	 * rand() outputs an integer in [0 RAND_MAX]
+	 * (double)rand()/RAND_MAX is in [0 1]
+	 */
+	 noise=min+(max-min)*(double)rand()/RAND_MAX;
+
+	for(i=0;i<numnodes;i++)values[i]=values[i]+noise;
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::AXPY{{{1*/
+void TriaP1Input::AXPY(Input* xinput,double scalar){
+
+	int i;
+	const int numnodes=3;
+	TriaP1Input*  xtriavertexinput=NULL;
+
+	/*xinput is of the same type, so cast it: */
+	xtriavertexinput=(TriaP1Input*)xinput;
+
+	/*Carry out the AXPY operation depending on type:*/
+	switch(xinput->ObjectEnum()){
+
+		case TriaP1InputEnum :
+			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];
+			return;
+
+		default :
+			_error_("not implemented yet");
+	}
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Constrain{{{1*/
+void TriaP1Input::Constrain(double cm_min, double cm_max){
+
+	int i;
+	const int numnodes=3;
+		
+	if(!isnan(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
+	if(!isnan(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::GetVectorFromInputs{{{1*/
+void TriaP1Input::GetVectorFromInputs(Vec vector,int* doflist){
+
+	const int numvertices=3;
+	VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);
+
+} /*}}}*/
+/*FUNCTION TriaP1Input::GetValuesPtr{{{1*/
+void TriaP1Input::GetValuesPtr(double** pvalues,int* pnum_values){
+
+	*pvalues=this->values;
+	if(pnum_values)*pnum_values=3;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::PointwiseMin{{{1*/
+Input* TriaP1Input::PointwiseMin(Input* inputB){
+
+	/*Ouput*/
+	TriaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	TriaP1Input *xinputB     = NULL;
+	int               B_numvalues;
+	const int         numnodes    = 3;
+	double            minvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(TriaP1Input*)inputB;
+
+	/*Create point wise min*/
+	for(i=0;i<numnodes;i++){
+		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
+		else minvalues[i]=this->values[i];
+	}
+
+	/*Create new Tria vertex input (copy of current input)*/
+	outinput=new TriaP1Input(this->enum_type,&minvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::PointwiseMax{{{1*/
+Input* TriaP1Input::PointwiseMax(Input* inputB){
+
+	/*Ouput*/
+	TriaP1Input* outinput=NULL;
+
+	/*Intermediaries*/
+	int               i;
+	TriaP1Input *xinputB     = NULL;
+	int               B_numvalues;
+	const int         numnodes    = 3;
+	double            maxvalues[numnodes];
+
+	/*Check that inputB is of the same type*/
+	if (inputB->ObjectEnum()!=TriaP1InputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
+	xinputB=(TriaP1Input*)inputB;
+
+	/*Create point wise max*/
+	for(i=0;i<numnodes;i++){
+		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
+		else maxvalues[i]=this->values[i];
+	}
+
+	/*Create new Tria vertex input (copy of current input)*/
+	outinput=new TriaP1Input(this->enum_type,&maxvalues[0]);
+
+	/*Return output pointer*/
+	return outinput;
+
+}
+/*}}}*/
+/*FUNCTION TriaP1Input::Configure{{{1*/
+void TriaP1Input::Configure(Parameters* parameters){
+	/*do nothing: */
+}
+/*}}}*/

Copied: issm/trunk/src/c/objects/Inputs/TriaP1Input.h (from rev 11526, issm/trunk-jpl/src/c/objects/Inputs/TriaP1Input.h)
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaP1Input.h	                        (rev 0)
+++ issm/trunk/src/c/objects/Inputs/TriaP1Input.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,89 @@
+/*! \file TriaP1Input.h 
+ *  \brief: header file for TriaP1Input object
+ */
+
+
+#ifndef _TRIAP1INPUT_H_
+#define _TRIAP1INPUT_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "./Input.h"
+#include "../Elements/TriaRef.h"
+class GaussTria;
+/*}}}*/
+
+class TriaP1Input: public Input,public TriaRef{
+
+	public:
+		/*just hold 3 values for 3 vertices: */
+		int    enum_type;
+		double values[3];
+
+		/*TriaP1Input constructors, destructors: {{{1*/
+		TriaP1Input();
+		TriaP1Input(int enum_type,double* values);
+		~TriaP1Input();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1 */
+		void  Echo();
+		void  DeepEcho();
+		int   Id(); 
+		int   MyRank();
+		#ifdef _SERIAL_
+		void  Marshall(char** pmarshalled_dataset);
+		int   MarshallSize();
+		void  Demarshall(char** pmarshalled_dataset);
+		#endif
+		int   ObjectEnum();
+		Object* copy();
+		/*}}}*/
+		/*TriaP1Input management: {{{1*/
+		int   InstanceEnum();
+		Input* SpawnTriaInput(int* indices);
+		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
+		Input* PointwiseMin(Input* inputB);
+		Input* PointwiseMax(Input* inputB);
+		ElementResult* SpawnResult(int step, double time);
+		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
+		void Configure(Parameters* parameters);
+		/*}}}*/
+		/*numerics: {{{1*/
+		void GetInputValue(bool* pvalue){_error_("not implemented yet");}
+		void GetInputValue(int* pvalue){_error_("not implemented yet");}
+		void GetInputValue(double* pvalue){_error_("not implemented yet");}
+		void GetInputValue(double* pvalue,GaussTria* gauss);
+		void GetInputValue(double* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
+		void GetInputValue(double* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
+		void GetInputValue(double* pvalue,GaussPenta* gauss,int index){_error_("not implemented yet");};
+		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussTria* gauss);
+		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+		void GetInputAverage(double* pvalue);
+		void GetVxStrainRate2d(double* epsilonvx,double* xyz_list, GaussTria* gauss);
+		void GetVyStrainRate2d(double* epsilonvy,double* xyz_list, GaussTria* gauss);
+		void GetVxStrainRate3d(double* epsilonvx,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+		void GetVyStrainRate3d(double* epsilonvy,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+		void GetVzStrainRate3d(double* epsilonvz,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+		void GetVxStrainRate3dPattyn(double* epsilonvx,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+		void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
+		void ChangeEnum(int newenumtype);
+
+		void SquareMin(double* psquaremin, bool process_units,Parameters* parameters);
+		void ConstrainMin(double minimum);
+		void Scale(double scale_factor);
+		void ArtificialNoise(double min,double max);
+		void AXPY(Input* xinput,double scalar);
+		void Constrain(double cm_min, double cm_max);
+		double InfinityNorm(void);
+		double Max(void);
+		double MaxAbs(void);
+		double Min(void);
+		double MinAbs(void);
+		void Extrude(void){_error_("not supported yet");};
+		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
+		void GetVectorFromInputs(Vec vector,int* doflist);
+		void GetValuesPtr(double** pvalues,int* pnum_values);
+		/*}}}*/
+
+};
+#endif  /* _TRIAP1INPUT_H */

Deleted: issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,473 +0,0 @@
-/*!\file TriaVertexInput.c
- * \brief: implementation of the TriaVertexInput 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 "../objects.h"
-#include "../../EnumDefinitions/EnumDefinitions.h"
-#include "../../shared/shared.h"
-#include "../../Container/Container.h"
-#include "../../include/include.h"
-
-/*TriaVertexInput constructors and destructor*/
-/*FUNCTION TriaVertexInput::TriaVertexInput(){{{1*/
-TriaVertexInput::TriaVertexInput(){
-	return;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::TriaVertexInput(int in_enum_type,double* values){{{1*/
-TriaVertexInput::TriaVertexInput(int in_enum_type,double* in_values)
-	:TriaRef(1)
-{
-
-	/*Set TriaRef*/
-	this->SetElementType(P1Enum,0);
-	this->element_type=P1Enum;
-
-	/*Set Enum*/
-	enum_type=in_enum_type;
-
-	/*Set values*/
-	values[0]=in_values[0];
-	values[1]=in_values[1];
-	values[2]=in_values[2];
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::~TriaVertexInput(){{{1*/
-TriaVertexInput::~TriaVertexInput(){
-	return;
-}
-/*}}}*/
-
-/*Object virtual functions definitions:*/
-/*FUNCTION TriaVertexInput::Echo {{{1*/
-void TriaVertexInput::Echo(void){
-	this->DeepEcho();
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::DeepEcho{{{1*/
-void TriaVertexInput::DeepEcho(void){
-
-	printf("TriaVertexInput:\n");
-	printf("   enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
-	printf("   values: [%g %g %g]\n",this->values[0],this->values[1],this->values[2]);
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Id{{{1*/
-int    TriaVertexInput::Id(void){ return -1; }
-/*}}}*/
-/*FUNCTION TriaVertexInput::MyRank{{{1*/
-int    TriaVertexInput::MyRank(void){ 
-	extern int my_rank;
-	return my_rank; 
-}
-/*}}}*/
-#ifdef _SERIAL_
-/*FUNCTION TriaVertexInput::Marshall{{{1*/
-void  TriaVertexInput::Marshall(char** pmarshalled_dataset){
-
-	char* marshalled_dataset=NULL;
-	int   enum_value=0;
-
-	/*recover marshalled_dataset: */
-	marshalled_dataset=*pmarshalled_dataset;
-
-	/*get enum value of TriaVertexInput: */
-	enum_value=TriaVertexInputEnum;
-	
-	/*marshall enum: */
-	memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
-	
-	/*marshall TriaVertexInput data: */
-	memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(marshalled_dataset,&values,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	*pmarshalled_dataset=marshalled_dataset;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::MarshallSize{{{1*/
-int   TriaVertexInput::MarshallSize(){
-	
-	return sizeof(values)+
-		+sizeof(enum_type)+
-		+sizeof(int); //sizeof(int) for enum value
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Demarshall{{{1*/
-void  TriaVertexInput::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(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
-	memcpy(&values,marshalled_dataset,sizeof(values));marshalled_dataset+=sizeof(values);
-
-	/*return: */
-	*pmarshalled_dataset=marshalled_dataset;
-	return;
-}
-/*}}}*/
-#endif
-/*FUNCTION TriaVertexInput::ObjectEnum{{{1*/
-int TriaVertexInput::ObjectEnum(void){
-
-	return TriaVertexInputEnum;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::copy{{{1*/
-Object* TriaVertexInput::copy() {
-	
-	return new TriaVertexInput(this->enum_type,this->values);
-
-}
-/*}}}*/
-	
-/*TriaVertexInput management*/
-/*FUNCTION TriaVertexInput::InstanceEnum{{{1*/
-int TriaVertexInput::InstanceEnum(void){
-
-	return this->enum_type;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::SpawnTriaInput{{{1*/
-Input* TriaVertexInput::SpawnTriaInput(int* indices){
-
-	/*output*/
-	TriaVertexInput* outinput=NULL;
-
-	/*Create new Tria input (copy of current input)*/
-	outinput=new TriaVertexInput(this->enum_type,&this->values[0]);
-
-	/*Assign output*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::SpawnResult{{{1*/
-ElementResult* TriaVertexInput::SpawnResult(int step, double time){
-
-	return new TriaVertexElementResult(this->enum_type,this->values,step,time);
-
-}
-/*}}}*/
-
-/*Object functions*/
-/*FUNCTION TriaVertexInput::GetInputValue(double* pvalue,GaussTria* gauss){{{1*/
-void TriaVertexInput::GetInputValue(double* pvalue,GaussTria* gauss){
-
-	/*Call TriaRef function*/
-	TriaRef::GetInputValue(pvalue,&values[0],gauss);
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::GetInputDerivativeValue(double* p, double* xyz_list, GaussTria* gauss){{{1*/
-void TriaVertexInput::GetInputDerivativeValue(double* p, double* xyz_list, GaussTria* gauss){
-
-	/*Call TriaRef function*/
-	TriaRef::GetInputDerivativeValue(p,&values[0],xyz_list,gauss);
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::GetVxStrainRate2d{{{1*/
-void TriaVertexInput::GetVxStrainRate2d(double* epsilonvx,double* xyz_list, GaussTria* gauss){
-
-	/*Intermediary*/
-	int       i;
-	const int numnodes=3;
-	double B[3][NDOF2*numnodes];
-	double velocity[3][NDOF2];
-
-	/*Get B matrix: */
-	GetBMacAyeal(&B[0][0], xyz_list, gauss);
-
-	/*Here, we are computing the strain rate of (vx,0)*/
-	for(i=0;i<3;i++){
-		velocity[i][0]=this->values[i];
-		velocity[i][1]=0.0;
-	}
-	/*Get epsilon(vx) = B*velocity*/
-	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
-				&velocity[0][0],NDOF2*numnodes,1,0,
-				epsilonvx,0);
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::GetVyStrainRate2d{{{1*/
-void TriaVertexInput::GetVyStrainRate2d(double* epsilonvy,double* xyz_list, GaussTria* gauss){
-
-	/*Intermediary*/
-	int       i;
-	const int numnodes=3;
-	double B[3][NDOF2*numnodes];
-	double velocity[3][NDOF2];
-
-	/*Get B matrix: */
-	GetBMacAyeal(&B[0][0], xyz_list, gauss);
-
-	/*Here, we are computing the strain rate of (0,vy)*/
-	for(i=0;i<3;i++){
-		velocity[i][0]=0.0;
-		velocity[i][1]=this->values[i];
-	}
-	/*Get epsilon(vy) = B*velocity*/
-	MatrixMultiply( &B[0][0],3,NDOF2*numnodes,0,
-				&velocity[0][0],NDOF2*numnodes,1,0,
-				epsilonvy,0);
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::ChangeEnum{{{1*/
-void TriaVertexInput::ChangeEnum(int newenumtype){
-	this->enum_type=newenumtype;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::GetInputAverage{{{1*/
-void TriaVertexInput::GetInputAverage(double* pvalue){
-	*pvalue=1./3.*(values[0]+values[1]+values[2]);
-}
-/*}}}*/
-
-/*Intermediary*/
-/*FUNCTION TriaVertexInput::SquareMin{{{1*/
-void TriaVertexInput::SquareMin(double* psquaremin, bool process_units,Parameters* parameters){
-
-	int i;
-	const int numnodes=3;
-	double valuescopy[numnodes];
-	double squaremin;
-
-	/*First,  copy values, to process units if requested: */
-	for(i=0;i<numnodes;i++)valuescopy[i]=this->values[i];
-
-	/*Process units if requested: */
-	if(process_units)UnitConversion(&valuescopy[0],numnodes,IuToExtEnum,enum_type);
-
-	/*Now, figure out minimum of valuescopy: */
-	squaremin=pow(valuescopy[0],2);
-	for(i=1;i<numnodes;i++){
-		if(pow(valuescopy[i],2)<squaremin)squaremin=pow(valuescopy[i],2);
-	}
-	/*Assign output pointers:*/
-	*psquaremin=squaremin;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::ContrainMin{{{1*/
-void TriaVertexInput::ConstrainMin(double minimum){
-	
-	int i;
-	const int numnodes=3;
-
-	for(i=0;i<numnodes;i++) if (values[i]<minimum) values[i]=minimum;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::InfinityNorm{{{1*/
-double TriaVertexInput::InfinityNorm(void){
-
-	/*Output*/
-	double norm=0;
-	const int numnodes=3;
-
-	for(int i=0;i<numnodes;i++) if(fabs(values[i])>norm) norm=fabs(values[i]);
-	return norm;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Max{{{1*/
-double TriaVertexInput::Max(void){
-
-	const int numnodes=3;
-	double    max=values[0];
-
-	for(int i=1;i<numnodes;i++){
-		if(values[i]>max) max=values[i];
-	}
-	return max;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::MaxAbs{{{1*/
-double TriaVertexInput::MaxAbs(void){
-
-	const int numnodes=3;
-	double    max=fabs(values[0]);
-
-	for(int i=1;i<numnodes;i++){
-		if(fabs(values[i])>max) max=fabs(values[i]);
-	}
-	return max;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Min{{{1*/
-double TriaVertexInput::Min(void){
-
-	const int numnodes=3;
-	double    min=values[0];
-
-	for(int i=1;i<numnodes;i++){
-		if(values[i]<min) min=values[i];
-	}
-	return min;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::MinAbs{{{1*/
-double TriaVertexInput::MinAbs(void){
-
-	const int numnodes=3;
-	double    min=fabs(values[0]);
-
-	for(int i=1;i<numnodes;i++){
-		if(fabs(values[i])<min) min=fabs(values[i]);
-	}
-	return min;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Scale{{{1*/
-void TriaVertexInput::Scale(double scale_factor){
-	
-	int i;
-	const int numnodes=3;
-
-	for(i=0;i<numnodes;i++)values[i]=values[i]*scale_factor;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::ArtificialNoise{{{1*/
-void TriaVertexInput::ArtificialNoise(double min,double max){
-
-	int i;
-	const int numnodes=3;
-	double noise;
-
-	/*Compute random number between bounds:
-	 * rand() outputs an integer in [0 RAND_MAX]
-	 * (double)rand()/RAND_MAX is in [0 1]
-	 */
-	 noise=min+(max-min)*(double)rand()/RAND_MAX;
-
-	for(i=0;i<numnodes;i++)values[i]=values[i]+noise;
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::AXPY{{{1*/
-void TriaVertexInput::AXPY(Input* xinput,double scalar){
-
-	int i;
-	const int numnodes=3;
-	TriaVertexInput*  xtriavertexinput=NULL;
-
-	/*xinput is of the same type, so cast it: */
-	xtriavertexinput=(TriaVertexInput*)xinput;
-
-	/*Carry out the AXPY operation depending on type:*/
-	switch(xinput->ObjectEnum()){
-
-		case TriaVertexInputEnum :
-			for(i=0;i<numnodes;i++)this->values[i]=this->values[i]+scalar*xtriavertexinput->values[i];
-			return;
-
-		default :
-			_error_("not implemented yet");
-	}
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Constrain{{{1*/
-void TriaVertexInput::Constrain(double cm_min, double cm_max){
-
-	int i;
-	const int numnodes=3;
-		
-	if(!isnan(cm_min)) for(i=0;i<numnodes;i++)if (this->values[i]<cm_min)this->values[i]=cm_min;
-	if(!isnan(cm_max)) for(i=0;i<numnodes;i++)if (this->values[i]>cm_max)this->values[i]=cm_max;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::GetVectorFromInputs{{{1*/
-void TriaVertexInput::GetVectorFromInputs(Vec vector,int* doflist){
-
-	const int numvertices=3;
-	VecSetValues(vector,numvertices,doflist,(const double*)this->values,INSERT_VALUES);
-
-} /*}}}*/
-/*FUNCTION TriaVertexInput::GetValuesPtr{{{1*/
-void TriaVertexInput::GetValuesPtr(double** pvalues,int* pnum_values){
-
-	*pvalues=this->values;
-	if(pnum_values)*pnum_values=3;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::PointwiseMin{{{1*/
-Input* TriaVertexInput::PointwiseMin(Input* inputB){
-
-	/*Ouput*/
-	TriaVertexInput* outinput=NULL;
-
-	/*Intermediaries*/
-	int               i;
-	TriaVertexInput *xinputB     = NULL;
-	int               B_numvalues;
-	const int         numnodes    = 3;
-	double            minvalues[numnodes];
-
-	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=TriaVertexInputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
-	xinputB=(TriaVertexInput*)inputB;
-
-	/*Create point wise min*/
-	for(i=0;i<numnodes;i++){
-		if(this->values[i] > xinputB->values[i]) minvalues[i]=xinputB->values[i];
-		else minvalues[i]=this->values[i];
-	}
-
-	/*Create new Tria vertex input (copy of current input)*/
-	outinput=new TriaVertexInput(this->enum_type,&minvalues[0]);
-
-	/*Return output pointer*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::PointwiseMax{{{1*/
-Input* TriaVertexInput::PointwiseMax(Input* inputB){
-
-	/*Ouput*/
-	TriaVertexInput* outinput=NULL;
-
-	/*Intermediaries*/
-	int               i;
-	TriaVertexInput *xinputB     = NULL;
-	int               B_numvalues;
-	const int         numnodes    = 3;
-	double            maxvalues[numnodes];
-
-	/*Check that inputB is of the same type*/
-	if (inputB->ObjectEnum()!=TriaVertexInputEnum) _error_("Operation not permitted because inputB is of type %s",EnumToStringx(inputB->ObjectEnum()));
-	xinputB=(TriaVertexInput*)inputB;
-
-	/*Create point wise max*/
-	for(i=0;i<numnodes;i++){
-		if(this->values[i] < xinputB->values[i]) maxvalues[i]=xinputB->values[i];
-		else maxvalues[i]=this->values[i];
-	}
-
-	/*Create new Tria vertex input (copy of current input)*/
-	outinput=new TriaVertexInput(this->enum_type,&maxvalues[0]);
-
-	/*Return output pointer*/
-	return outinput;
-
-}
-/*}}}*/
-/*FUNCTION TriaVertexInput::Configure{{{1*/
-void TriaVertexInput::Configure(Parameters* parameters){
-	/*do nothing: */
-}
-/*}}}*/

Deleted: issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
===================================================================
--- issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Inputs/TriaVertexInput.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,89 +0,0 @@
-/*! \file TriaVertexInput.h 
- *  \brief: header file for triavertexinput object
- */
-
-
-#ifndef _TRIAVERTEXINPUT_H_
-#define _TRIAVERTEXINPUT_H_
-
-/*Headers:*/
-/*{{{1*/
-#include "./Input.h"
-#include "../Elements/TriaRef.h"
-class GaussTria;
-/*}}}*/
-
-class TriaVertexInput: public Input,public TriaRef{
-
-	public:
-		/*just hold 3 values for 3 vertices: */
-		int    enum_type;
-		double values[3];
-
-		/*TriaVertexInput constructors, destructors: {{{1*/
-		TriaVertexInput();
-		TriaVertexInput(int enum_type,double* values);
-		~TriaVertexInput();
-		/*}}}*/
-		/*Object virtual functions definitions:{{{1 */
-		void  Echo();
-		void  DeepEcho();
-		int   Id(); 
-		int   MyRank();
-		#ifdef _SERIAL_
-		void  Marshall(char** pmarshalled_dataset);
-		int   MarshallSize();
-		void  Demarshall(char** pmarshalled_dataset);
-		#endif
-		int   ObjectEnum();
-		Object* copy();
-		/*}}}*/
-		/*TriaVertexInput management: {{{1*/
-		int   InstanceEnum();
-		Input* SpawnTriaInput(int* indices);
-		Input* PointwiseDivide(Input* inputB){_error_("not implemented yet");};
-		Input* PointwiseMin(Input* inputB);
-		Input* PointwiseMax(Input* inputB);
-		ElementResult* SpawnResult(int step, double time);
-		void AddTimeValues(double* values,int step,double time){_error_("not supported yet");};
-		void Configure(Parameters* parameters);
-		/*}}}*/
-		/*numerics: {{{1*/
-		void GetInputValue(bool* pvalue){_error_("not implemented yet");}
-		void GetInputValue(int* pvalue){_error_("not implemented yet");}
-		void GetInputValue(double* pvalue){_error_("not implemented yet");}
-		void GetInputValue(double* pvalue,GaussTria* gauss);
-		void GetInputValue(double* pvalue,GaussPenta* gauss){_error_("not implemented yet");};
-		void GetInputValue(double* pvalue,GaussTria* gauss ,int index){_error_("not implemented yet");};
-		void GetInputValue(double* pvalue,GaussPenta* gauss,int index){_error_("not implemented yet");};
-		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussTria* gauss);
-		void GetInputDerivativeValue(double* derivativevalues, double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
-		void GetInputAverage(double* pvalue);
-		void GetVxStrainRate2d(double* epsilonvx,double* xyz_list, GaussTria* gauss);
-		void GetVyStrainRate2d(double* epsilonvy,double* xyz_list, GaussTria* gauss);
-		void GetVxStrainRate3d(double* epsilonvx,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
-		void GetVyStrainRate3d(double* epsilonvy,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
-		void GetVzStrainRate3d(double* epsilonvz,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
-		void GetVxStrainRate3dPattyn(double* epsilonvx,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
-		void GetVyStrainRate3dPattyn(double* epsilonvy,double* xyz_list, GaussPenta* gauss){_error_("not implemented yet");};
-		void ChangeEnum(int newenumtype);
-
-		void SquareMin(double* psquaremin, bool process_units,Parameters* parameters);
-		void ConstrainMin(double minimum);
-		void Scale(double scale_factor);
-		void ArtificialNoise(double min,double max);
-		void AXPY(Input* xinput,double scalar);
-		void Constrain(double cm_min, double cm_max);
-		double InfinityNorm(void);
-		double Max(void);
-		double MaxAbs(void);
-		double Min(void);
-		double MinAbs(void);
-		void Extrude(void){_error_("not supported yet");};
-		void VerticallyIntegrate(Input* thickness_input){_error_("not supported yet");};
-		void GetVectorFromInputs(Vec vector,int* doflist);
-		void GetValuesPtr(double** pvalues,int* pnum_values);
-		/*}}}*/
-
-};
-#endif  /* _TRIAVERTEXINPUT_H */

Modified: issm/trunk/src/c/objects/KML/KMLFileReadUtils.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KMLFileReadUtils.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KMLFileReadUtils.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -228,6 +228,61 @@
 }
 /*}}}*/
 
+/*FUNCTION  KMLFileTagName {{{1*/
+char* KMLFileTagName(char* pname,
+					 char* ktag){
+
+	return(KMLFileTagName(pname,NULL,0,
+						  ktag));
+}
+/*}}}*/
+
+/*FUNCTION  KMLFileTagName {{{1*/
+char* KMLFileTagName(char* pname,int *m,int maxlen,
+					 char* ktag){
+
+/*  for the given tag buffer, read and store the name  */
+
+	char*   ktagi;
+	char*   ktokn;
+
+	if (strncmp(&ktag[0],"<"        ,1) || strncmp(&ktag[strlen(ktag)-1],">",1))
+		_error_("KMLFileTagName -- Missing tag delimiters in %s.\n",ktag);
+
+/*  strtok modifies ktag, so work on copy  */
+
+	ktagi=(char *) xmalloc((strlen(ktag)+1)*sizeof(char));
+	memcpy(ktagi,ktag,(strlen(ktag)+1)*sizeof(char));
+
+/*  skip opening delimeter and find subsequent blank or closing delimiter  */
+
+	ktokn=strtok(ktagi,"< >");
+//	_printf_(true,"KMLFileTagName -- initial token=\"%s\".\n",ktokn);
+
+	if (!pname) {
+		if (maxlen)
+			pname=(char *) xmalloc((maxlen       +1)*sizeof(char));
+		else
+			pname=(char *) xmalloc((strlen(ktokn)+1)*sizeof(char));
+	}
+
+	if (maxlen && (maxlen < strlen(ktokn))) {
+		_printf_(true,"KMLFileTagName -- string field too short for %s.\n",ktag);
+		_printf_(true,"KMLFileTagName -- \"%s\" truncated to %d characters.\n",ktokn,maxlen);
+		strncpy(pname,ktokn,maxlen);
+	}
+	else
+		memcpy(pname,ktokn,(strlen(ktokn)+1)*sizeof(char));
+
+	xfree((void**)&ktagi);
+
+	if (m)
+		*m=strlen(pname);
+
+	return(pname);
+}
+/*}}}*/
+
 /*FUNCTION  KMLFileTagAttrib {{{1*/
 int KMLFileTagAttrib(KML_Object* kobj,
 					 char* ktag){
@@ -351,12 +406,22 @@
 /*}}}*/
 
 /*FUNCTION  KMLFileTokenParse {{{1*/
+char* KMLFileTokenParse(char* pstr,
+						char* ktag,
+						FILE* fid){
+
+	return(KMLFileTokenParse(pstr,NULL,0,
+							 ktag,
+							 fid));
+}
+/*}}}*/
+
+/*FUNCTION  KMLFileTokenParse {{{1*/
 char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
 						char* ktag,
 						FILE* fid){
 
 	char*   kstr;
-	char*   pstro=NULL;
 
 /*  get next token and allocate if necessary  */
 
@@ -370,7 +435,6 @@
 			pstr=(char *) xmalloc((maxlen      +1)*sizeof(char));
 		else
 			pstr=(char *) xmalloc((strlen(kstr)+1)*sizeof(char));
-		pstro=pstr;
 	}
 
 	if (maxlen && (maxlen < strlen(kstr))) {
@@ -400,7 +464,7 @@
 
 //	_printf_(true,"KMLFileTokenParse -- %s=\"%s\".\n",ktag,pstr);
 
-	return(pstro);
+	return(pstr);
 }
 /*}}}*/
 

Modified: issm/trunk/src/c/objects/KML/KMLFileReadUtils.h
===================================================================
--- issm/trunk/src/c/objects/KML/KMLFileReadUtils.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KMLFileReadUtils.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -20,6 +20,10 @@
 void KMLFileTokenBuffer(char** pbuffer,int* pibuf,int* pbuflen,
 						int c,
 						int bufblk);
+char* KMLFileTagName(char* pname,
+					 char* ktag);
+char* KMLFileTagName(char* pname,int *m,int maxlen,
+					 char* ktag);
 int KMLFileTagAttrib(KML_Object* kobj,
 					 char* ktag);
 int KMLFileTokenParse(int* pival,
@@ -28,9 +32,12 @@
 int KMLFileTokenParse(bool* pbval,
 					  char* ktag,
 					  FILE* fid);
+char* KMLFileTokenParse(char* pstr,
+						char* ktag,
+						FILE* fid);
 char* KMLFileTokenParse(char* pstr,int *m,int maxlen,
-					  char* ktag,
-					  FILE* fid);
+						char* ktag,
+						FILE* fid);
 int KMLFileTokenParse(float* pfval,
 					  char* ktag,
 					  FILE* fid);

Modified: issm/trunk/src/c/objects/KML/KML_Container.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Container.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Container.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -73,7 +73,6 @@
 /*  loop over the features for the container  */
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	if (feature->Size())

Modified: issm/trunk/src/c/objects/KML/KML_Feature.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Feature.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Feature.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -95,7 +95,6 @@
 /*  loop over any styles for the feature  */
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	if (style->Size())

Modified: issm/trunk/src/c/objects/KML/KML_File.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_File.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_File.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,17 +23,14 @@
 /*FUNCTION KML_File::KML_File(){{{1*/
 KML_File::KML_File(){
 
-	kmlobj    =new DataSet;
+	;
 
 }
 /*}}}*/
 /*FUNCTION KML_File::~KML_File(){{{1*/
 KML_File::~KML_File(){
 
-	if (kmlobj) {
-		delete kmlobj;
-		kmlobj    =NULL;
-	}
+	;
 
 }
 /*}}}*/
@@ -47,8 +44,6 @@
 	_printf_(flag,"KML_File:\n");
 	KML_Object::Echo();
 
-	_printf_(flag,"        kmlobj: (size=%d)\n" ,kmlobj->Size());
-
 	return;
 }
 /*}}}*/
@@ -65,37 +60,17 @@
 /*FUNCTION KML_File::DeepEcho {{{1*/
 void  KML_File::DeepEcho(const char* indent){
 
-	int   i;
-	char  indent2[81];
 	bool  flag=true;
 
 	_printf_(flag,"%sKML_File:\n",indent);
 	KML_Object::DeepEcho(indent);
 
-/*  loop over the kml objects for the file  */
-
-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
-	strcat(indent2,"  ");
-
-	if (kmlobj->Size())
-		for (i=0; i<kmlobj->Size(); i++) {
-			_printf_(flag,"%s        kmlobj: -------- begin [%d] --------\n" ,indent,i);
-			((KML_Object *)kmlobj->GetObjectByOffset(i))->DeepEcho(indent2);
-			_printf_(flag,"%s        kmlobj: --------  end  [%d] --------\n" ,indent,i);
-		}
-	else
-		_printf_(flag,"%s        kmlobj: [empty]\n"    ,indent);
-
 	return;
 }
 /*}}}*/
 /*FUNCTION KML_File::Write {{{1*/
 void  KML_File::Write(FILE* filout,const char* indent){
 
-	int   i;
-	char  indent2[81];
-
 	fprintf(filout,"%s<kml",indent);
 	WriteAttrib(filout," ");
 	fprintf(filout,">\n");
@@ -103,15 +78,6 @@
 
 	KML_Object::Write(filout,indent);
 
-/*  loop over the kml objects for the file  */
-
-	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
-	strcat(indent2,"  ");
-
-	for (i=0; i<kmlobj->Size(); i++)
-		((KML_Object *)kmlobj->GetObjectByOffset(i))->Write(filout,indent2);
-
 	fprintf(filout,"%s</kml>\n",indent);
 
 	return;
@@ -144,108 +110,6 @@
 		else if (strncmp(kstri,"<",1))
 			_error_("KML_File::Read -- Unexpected field \"%s\".\n",kstri);
 
-		else if (!strncmp(kstri,"<Placemark",10)) {
-			kobj=(KML_Object*)new KML_Placemark();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<Folder", 7)) {
-			kobj=(KML_Object*)new KML_Folder();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<Document", 9)) {
-			kobj=(KML_Object*)new KML_Document();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<GroundOverlay",14)) {
-			kobj=(KML_Object*)new KML_GroundOverlay();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<LatLonBox",10)) {
-			kobj=(KML_Object*)new KML_LatLonBox();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<Icon", 5)) {
-			kobj=(KML_Object*)new KML_Icon();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<Point", 6)) {
-			kobj=(KML_Object*)new KML_Point();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<LineString",11)) {
-			kobj=(KML_Object*)new KML_LineString();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<LinearRing",11)) {
-			kobj=(KML_Object*)new KML_LinearRing();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<Polygon", 8)) {
-			kobj=(KML_Object*)new KML_Polygon();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<MultiGeometry",14)) {
-			kobj=(KML_Object*)new KML_MultiGeometry();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-//		else if (!strncmp(kstri,"<IconStyle",10)) {
-//			kobj=(KML_Object*)new KML_IconStyle();
-//			kobj->Read(fid,kstri);
-//			kmlobj    ->AddObject((Object*)kobj);
-//		}
-
-//		else if (!strncmp(kstri,"<LabelStyle",11)) {
-//			kobj=(KML_Object*)new KML_LabelStyle();
-//			kobj->Read(fid,kstri);
-//			kmlobj    ->AddObject((Object*)kobj);
-//		}
-
-		else if (!strncmp(kstri,"<LineStyle",10)) {
-			kobj=(KML_Object*)new KML_LineStyle();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-		else if (!strncmp(kstri,"<PolyStyle",10)) {
-			kobj=(KML_Object*)new KML_PolyStyle();
-			kobj->Read(fid,kstri);
-			kmlobj    ->AddObject((Object*)kobj);
-		}
-
-//		else if (!strncmp(kstri,"<BalloonStyle",13)) {
-//			kobj=(KML_Object*)new KML_BalloonStyle();
-//			kobj->Read(fid,kstri);
-//			kmlobj    ->AddObject((Object*)kobj);
-//		}
-
-//		else if (!strncmp(kstri,"<ListStyle",10)) {
-//			kobj=(KML_Object*)new KML_ListStyle();
-//			kobj->Read(fid,kstri);
-//			kmlobj    ->AddObject((Object*)kobj);
-//		}
-
 		else if (!strncmp(kstri,"<",1))
 			KML_Object::Read(fid,kstri);
 

Modified: issm/trunk/src/c/objects/KML/KML_File.h
===================================================================
--- issm/trunk/src/c/objects/KML/KML_File.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_File.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -19,8 +19,6 @@
 
 	public:
 
-		DataSet* kmlobj;
-
 		/*KML_File constructors, destructors {{{1*/
 		KML_File();
 		~KML_File();

Modified: issm/trunk/src/c/objects/KML/KML_GroundOverlay.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_GroundOverlay.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_GroundOverlay.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -79,7 +79,6 @@
 	KML_Overlay::DeepEcho(indent);
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	_printf_(flag,"%s      altitude: %0.16g\n"      ,indent,altitude);

Modified: issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_MultiGeometry.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -77,7 +77,6 @@
 /*  loop over the geometry elements for the multigeometry  */
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	if (geometry->Size())

Modified: issm/trunk/src/c/objects/KML/KML_Object.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Object.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Object.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -25,6 +25,7 @@
 
 	attrib    =new DataSet;
 	commnt    =new DataSet;
+	kmlobj    =new DataSet;
 
 }
 /*}}}*/
@@ -39,6 +40,10 @@
 		delete commnt;
 		commnt    =NULL;
 	}
+	if (kmlobj) {
+		delete kmlobj;
+		kmlobj    =NULL;
+	}
 
 }
 /*}}}*/
@@ -51,6 +56,7 @@
 
 	_printf_(flag,"        attrib: (size=%d)\n" ,attrib->Size());
 	_printf_(flag,"        commnt: (size=%d)\n" ,commnt->Size());
+	_printf_(flag,"        kmlobj: (size=%d)\n" ,kmlobj->Size());
 
 	return;
 }
@@ -69,6 +75,7 @@
 void  KML_Object::DeepEcho(const char* indent){
 
 	int   i;
+	char  indent2[81];
 	bool  flag=true;
 
 /*  loop over the attributes for the object  */
@@ -89,23 +96,50 @@
 	else
 		_printf_(flag,"%s        commnt: [empty]\n"    ,indent);
 
+/*  loop over the unknown objects for the object  */
+
+	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+	strcat(indent2,"  ");
+
+	if (kmlobj->Size())
+		for (i=0; i<kmlobj->Size(); i++) {
+            _printf_(flag,"%s        kmlobj: -------- begin [%d] --------\n" ,indent,i);
+			((KML_Unknown *)kmlobj->GetObjectByOffset(i))->DeepEcho(indent2);
+            _printf_(flag,"%s        kmlobj: --------  end  [%d] --------\n" ,indent,i);
+		}
+	else
+		_printf_(flag,"%s        kmlobj: [empty]\n"    ,indent);
+
 	return;
 }
 /*}}}*/
 /*FUNCTION KML_Object::Write {{{1*/
 void  KML_Object::Write(FILE* filout,const char* indent){
 
+	int   i;
+	char  indent2[81];
+
 //  attributes always written in keyword line of derived classes
 //  comments always written after keyword line of derived classes
 
-	;
+/*  loop over the unknown objects for the object  */
 
+	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
+	strcat(indent2,"  ");
+
+	if (kmlobj->Size())
+		for (i=0; i<kmlobj->Size(); i++) {
+			((KML_Unknown *)kmlobj->GetObjectByOffset(i))->Write(filout,indent2);
+		}
+
 	return;
 }
 /*}}}*/
 /*FUNCTION KML_Object::Read {{{1*/
 void  KML_Object::Read(FILE* fid,char* kstr){
 
+	KML_Object*  kobj;
+
 /*  process field within opening and closing tags  */
 
 	if      (!strncmp(kstr,"</Object", 8))
@@ -115,10 +149,115 @@
 	else if (strncmp(kstr,"<",1))
 		_error_("KML_Object::Read -- Unexpected field \"%s\".\n",kstr);
 
+	else if (!strncmp(kstr,"<Placemark",10)) {
+		kobj=(KML_Object*)new KML_Placemark();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<Folder", 7)) {
+		kobj=(KML_Object*)new KML_Folder();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<Document", 9)) {
+		kobj=(KML_Object*)new KML_Document();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<GroundOverlay",14)) {
+		kobj=(KML_Object*)new KML_GroundOverlay();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<LatLonBox",10)) {
+		kobj=(KML_Object*)new KML_LatLonBox();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<Icon", 5)) {
+		kobj=(KML_Object*)new KML_Icon();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<Point", 6)) {
+		kobj=(KML_Object*)new KML_Point();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<LineString",11)) {
+		kobj=(KML_Object*)new KML_LineString();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<LinearRing",11)) {
+		kobj=(KML_Object*)new KML_LinearRing();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<Polygon", 8)) {
+		kobj=(KML_Object*)new KML_Polygon();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<MultiGeometry",14)) {
+		kobj=(KML_Object*)new KML_MultiGeometry();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+//	else if (!strncmp(kstr,"<IconStyle",10)) {
+//		kobj=(KML_Object*)new KML_IconStyle();
+//		kobj->Read(fid,kstr);
+//		kmlobj    ->AddObject((Object*)kobj);
+//	}
+
+//	else if (!strncmp(kstr,"<LabelStyle",11)) {
+//		kobj=(KML_Object*)new KML_LabelStyle();
+//		kobj->Read(fid,kstr);
+//		kmlobj    ->AddObject((Object*)kobj);
+//	}
+
+	else if (!strncmp(kstr,"<LineStyle",10)) {
+		kobj=(KML_Object*)new KML_LineStyle();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+	else if (!strncmp(kstr,"<PolyStyle",10)) {
+		kobj=(KML_Object*)new KML_PolyStyle();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
+	}
+
+//	else if (!strncmp(kstr,"<BalloonStyle",13)) {
+//		kobj=(KML_Object*)new KML_BalloonStyle();
+//		kobj->Read(fid,kstr);
+//		kmlobj    ->AddObject((Object*)kobj);
+//	}
+
+//	else if (!strncmp(kstr,"<ListStyle",10)) {
+//		kobj=(KML_Object*)new KML_ListStyle();
+//		kobj->Read(fid,kstr);
+//		kmlobj    ->AddObject((Object*)kobj);
+//	}
+
 	else if (!strncmp(kstr,"<",1)) {
 		_printf_(true,"KML_Object::Read -- Unrecognized opening tag %s.\n",kstr);
-		KMLFileTagSkip(kstr,
-					   fid);
+//		KMLFileTagSkip(kstr,
+//					   fid);
+		kobj=(KML_Object*)new KML_Unknown();
+		kobj->Read(fid,kstr);
+		kmlobj    ->AddObject((Object*)kobj);
 	}
 
 	return;

Modified: issm/trunk/src/c/objects/KML/KML_Object.h
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Object.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Object.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -20,6 +20,7 @@
 
 		DataSet* attrib;
 		DataSet* commnt;
+		DataSet* kmlobj;
 
 		/*KML_Object constructors, destructors {{{1*/
 		KML_Object();

Modified: issm/trunk/src/c/objects/KML/KML_Overlay.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Overlay.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Overlay.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -78,7 +78,6 @@
 	KML_Feature::DeepEcho(indent);
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	_printf_(flag,"%s         color: %s\n"          ,indent,color);

Modified: issm/trunk/src/c/objects/KML/KML_Placemark.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Placemark.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Placemark.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -75,7 +75,6 @@
 /*  loop over the geometry elements for the placemark  */
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	if (geometry->Size())

Modified: issm/trunk/src/c/objects/KML/KML_Polygon.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Polygon.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Polygon.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -91,7 +91,6 @@
 	_printf_(flag,"%s       altmode: \"%s\"\n"      ,indent,altmode);
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 	if (outer->Size())
@@ -133,7 +132,6 @@
 	fprintf(filout,"%s  <altitudeMode>%s</altitudeMode>\n",indent,altmode);
 
 	memcpy(indent4,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent4,"    ");
 
 /*  check outer boundary for the polygon  */

Modified: issm/trunk/src/c/objects/KML/KML_Style.cpp
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Style.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/KML/KML_Style.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -108,7 +108,6 @@
 	KML_StyleSelector::DeepEcho(indent);
 
 	memcpy(indent2,indent,(strlen(indent)+1)*sizeof(char));
-
 	strcat(indent2,"  ");
 
 //	if (icon)

Copied: issm/trunk/src/c/objects/KML/KML_Unknown.cpp (from rev 11526, issm/trunk-jpl/src/c/objects/KML/KML_Unknown.cpp)
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Unknown.cpp	                        (rev 0)
+++ issm/trunk/src/c/objects/KML/KML_Unknown.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,189 @@
+/*!\file KML_Unknown.cpp
+ * \brief: implementation of the kml_unknown object
+ */
+
+/*Headers:*/
+/*{{{1*/
+#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 "../objects.h"
+#include "../../shared/shared.h"
+#include "../../io/io.h"
+#include "../../Container/Container.h"
+#include "../../include/include.h"
+/*}}}*/
+
+/*Constructors/destructor/copy*/
+/*FUNCTION KML_Unknown::KML_Unknown(){{{1*/
+KML_Unknown::KML_Unknown(){
+
+	name      =NULL;
+	value     =NULL;
+
+}
+/*}}}*/
+/*FUNCTION KML_Unknown::~KML_Unknown(){{{1*/
+KML_Unknown::~KML_Unknown(){
+
+	if (name      ) xfree((void**)&name);
+	if (value     ) xfree((void**)&value);
+
+}
+/*}}}*/
+
+/*Other*/
+/*FUNCTION KML_Unknown::Echo {{{1*/
+void  KML_Unknown::Echo(){
+
+	bool  flag=true;
+
+	_printf_(flag,"KML_Unknown %s:\n",name);
+	KML_Object::Echo();
+
+	if (value     )
+		_printf_(flag,"         value: \"%s\"\n"     ,value);
+    else
+        _printf_(flag,"         value: [none]\n"     );
+
+	return;
+}
+/*}}}*/
+/*FUNCTION KML_Unknown::DeepEcho {{{1*/
+void  KML_Unknown::DeepEcho(){
+
+	char  indent[81]="";
+
+	KML_Unknown::DeepEcho(indent);
+
+	return;
+}
+/*}}}*/
+/*FUNCTION KML_Unknown::DeepEcho {{{1*/
+void  KML_Unknown::DeepEcho(const char* indent){
+
+	char*        valuei;
+	char*        vtoken;
+	char         nl[]={'\n','\0'};
+	bool         flag=true;
+
+	_printf_(flag,"%sKML_Unknown %s:\n",indent,name);
+	KML_Object::DeepEcho(indent);
+
+	if (value     ) {
+		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
+		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
+        
+		vtoken=strtok(valuei,nl);
+		_printf_(flag,"%s         value: \"%s"     ,indent,vtoken);
+    
+		while (vtoken=strtok(NULL,nl))
+			_printf_(flag,"\n%s                 %s"     ,indent,vtoken);
+		_printf_(flag,"\"\n");
+
+		xfree((void**)&valuei);
+	}
+    else
+        _printf_(flag,"%s         value: [none]\n"     ,indent);
+
+	return;
+}
+/*}}}*/
+/*FUNCTION KML_Unknown::Write {{{1*/
+void  KML_Unknown::Write(FILE* filout,const char* indent){
+
+	char*        valuei;
+	char*        vtoken;
+	char         nl[]={'\n','\0'};
+
+	fprintf(filout,"%s<%s",indent,name);
+	WriteAttrib(filout," ");
+	fprintf(filout,">\n");
+	WriteCommnt(filout,indent);
+
+	if (value     ) {
+		valuei=(char *) xmalloc((strlen(value)+1)*sizeof(char));
+		memcpy(valuei,value,(strlen(value)+1)*sizeof(char)); 
+        
+		vtoken=strtok(valuei,nl);
+		fprintf(filout,"%s  %s\n",indent,vtoken);
+    
+		while (vtoken=strtok(NULL,nl))
+			fprintf(filout,"%s  %s\n",indent,vtoken);
+
+		xfree((void**)&valuei);
+	}
+
+	KML_Object::Write(filout,indent);
+
+	fprintf(filout,"%s</%s>\n",indent,name);
+
+	return;
+}
+/*}}}*/
+/*FUNCTION KML_Unknown::Read {{{1*/
+void  KML_Unknown::Read(FILE* fid,char* kstr){
+
+	char*        kstri;
+	int          ncom=0;
+	char**       pcom=NULL;
+	char         nl[]={'\n','\0'};
+
+/*  get object name  */
+
+	name=KMLFileTagName(NULL,
+						kstr);
+//	_printf_(true,"KML_Unknown::Read -- opening name=%s.\n",name);
+
+/*  get object attributes and check for solo tag  */
+
+	if (KMLFileTagAttrib(this,
+						 kstr))
+		return;
+
+/*  loop over and process fields within opening and closing tags  */
+
+	while (kstri=KMLFileToken(fid,
+							  &ncom,&pcom)) {
+//		_printf_(true,"KML_Unknown::Read -- kstri=%s.\n",kstri);
+		if      (!strncmp(&kstri[0],"</", 2) &&
+				 !strncmp(&kstri[2],name,strlen(name))) {
+//			_printf_(true,"KML_Unknown::Read -- closing name=%s.\n",name);
+			xfree((void**)&kstri);
+			break;
+		}
+		else if (!strncmp(kstri,"</",2))
+			_error_("KML_Unknown::Read -- Unexpected closing tag %s.\n",kstri);
+
+		else if (strncmp(kstri,"<",1)) {
+			if (value) {
+				value=(char *) xrealloc(value,(strlen(value)+1+strlen(kstri)+1)*sizeof(char));
+				strcat(value,nl);
+				strcat(value,kstri);
+			}
+			else {
+				value=(char *) xmalloc((strlen(kstri)+1)*sizeof(char));
+				memcpy(value,kstri,(strlen(kstri)+1)*sizeof(char));
+			}
+		}
+
+		else if (!strncmp(kstri,"<",1))
+			KML_Object::Read(fid,kstri);
+
+		xfree((void**)&kstri);
+	}
+
+	this->AddCommnt(ncom,pcom);
+
+	for (ncom; ncom>0; ncom--)
+		xfree((void**)&(pcom[ncom-1]));
+	xfree((void**)&pcom);
+
+	return;
+}
+/*}}}*/

Copied: issm/trunk/src/c/objects/KML/KML_Unknown.h (from rev 11526, issm/trunk-jpl/src/c/objects/KML/KML_Unknown.h)
===================================================================
--- issm/trunk/src/c/objects/KML/KML_Unknown.h	                        (rev 0)
+++ issm/trunk/src/c/objects/KML/KML_Unknown.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,45 @@
+/*! \file KML_Unknown.h 
+ *  \brief: header file for kml_unknown object
+ */
+
+#ifndef _KML_UNKNOWN_H_
+#define _KML_UNKNOWN_H_
+
+/*Headers:*/
+/*{{{1*/
+#include "../../include/include.h"
+#include "../../shared/Exceptions/exceptions.h"
+#include "../../EnumDefinitions/EnumDefinitions.h"
+
+#include "./KML_Object.h"
+/*}}}*/
+
+class KML_Unknown: public KML_Object {
+
+	public:
+
+		char* name;
+		char* value;
+
+		/*KML_Unknown constructors, destructors {{{1*/
+		KML_Unknown();
+		~KML_Unknown();
+		/*}}}*/
+		/*Object virtual functions definitions:{{{1*/
+		void  Echo();
+		void  DeepEcho();
+		void  DeepEcho(const char* indent);
+		void  Write(FILE* fid,const char* indent);
+		void  Read(FILE* fid,char* kstr);
+		int   Id(){_error_("Not implemented yet.");};
+		int   MyRank(){_error_("Not implemented yet.");};
+		void  Marshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+		int   MarshallSize(){_error_("Not implemented yet.");};
+		void  Demarshall(char** pmarshalled_dataset){_error_("Not implemented yet.");};
+		int   ObjectEnum(){_error_("Not implemented yet.");};
+		Object* copy(){_error_("Not implemented yet.");};
+		/*}}}*/
+
+};
+#endif  /* _KML_UNKNOWN_H */
+

Modified: issm/trunk/src/c/objects/Loads/Icefront.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Icefront.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Icefront.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -360,6 +360,11 @@
 	}
 }
 /*}}}*/
+/*FUNCTION Icefront::CreateJacobianMatrix{{{1*/
+void  Icefront::CreateJacobianMatrix(Mat Jff){
+	this->CreateKMatrix(Jff,NULL);
+}
+/*}}}1*/
 /*FUNCTION Icefront::PenaltyCreateKMatrix {{{1*/
 void  Icefront::PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax){
 	/*do nothing: */
@@ -372,6 +377,11 @@
 	return;
 }
 /*}}}*/
+/*FUNCTION Icefront::PenaltyCreateJacobianMatrix{{{1*/
+void  Icefront::PenaltyCreateJacobianMatrix(Mat Jff,double kmax){
+	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+}
+/*}}}1*/
 /*FUNCTION Icefront::InAnalysis{{{1*/
 bool Icefront::InAnalysis(int in_analysis_type){
 	if (in_analysis_type==this->analysis_type)return true;

Modified: issm/trunk/src/c/objects/Loads/Icefront.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Icefront.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Icefront.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -75,8 +75,10 @@
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kff, Mat Kfs);
 		void  CreatePVector(Vec pf);
+		void  CreateJacobianMatrix(Mat Jff);
 		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
 		void  PenaltyCreatePVector(Vec pf, double kmax);
+		void  PenaltyCreateJacobianMatrix(Mat Jff,double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
 		/*Load management: {{{1*/

Modified: issm/trunk/src/c/objects/Loads/Load.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Load.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Load.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -28,6 +28,8 @@
 		virtual void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
 		virtual void  CreateKMatrix(Mat Kff, Mat Kfs)=0;
 		virtual void  CreatePVector(Vec pf)=0;
+		virtual void  CreateJacobianMatrix(Mat Jff)=0;
+		virtual void  PenaltyCreateJacobianMatrix(Mat Jff,double kmax)=0;
 		virtual void  PenaltyCreateKMatrix(Mat Kff, Mat Kfs, double kmax)=0;
 		virtual void  PenaltyCreatePVector(Vec pf, double kmax)=0;
 		virtual bool  InAnalysis(int analysis_type)=0;

Modified: issm/trunk/src/c/objects/Loads/Numericalflux.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Numericalflux.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Numericalflux.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -71,6 +71,8 @@
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kff, Mat Kfs);
 		void  CreatePVector(Vec pf);
+		void  CreateJacobianMatrix(Mat Jff){_error_("Not implemented yet");};
+		void  PenaltyCreateJacobianMatrix(Mat Jff,double kmax){_error_("Not implemented yet");};
 		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
 		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);

Modified: issm/trunk/src/c/objects/Loads/Pengrid.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Pengrid.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Pengrid.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -76,6 +76,8 @@
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kff, Mat Kfs);
 		void  CreatePVector(Vec pf);
+		void  CreateJacobianMatrix(Mat Jff){_error_("Not implemented yet");};
+		void  PenaltyCreateJacobianMatrix(Mat Jff,double kmax){_error_("Not implemented yet");};
 		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
 		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);

Modified: issm/trunk/src/c/objects/Loads/Penpair.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Penpair.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Penpair.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -213,6 +213,11 @@
 
 }
 /*}}}1*/
+/*FUNCTION Penpair::CreateJacobianMatrix{{{1*/
+void  Penpair::CreateJacobianMatrix(Mat Jff){
+	this->CreateKMatrix(Jff,NULL);
+}
+/*}}}1*/
 /*FUNCTION Penpair::PenaltyCreateKMatrix {{{1*/
 void  Penpair::PenaltyCreateKMatrix(Mat Kff, Mat Kfs,double kmax){
 
@@ -245,6 +250,11 @@
 	return;
 }
 /*}}}1*/
+/*FUNCTION Penpair::PenaltyCreateJacobianMatrix{{{1*/
+void  Penpair::PenaltyCreateJacobianMatrix(Mat Jff,double kmax){
+	this->PenaltyCreateKMatrix(Jff,NULL,kmax);
+}
+/*}}}1*/
 /*FUNCTION Penpair::InAnalysis{{{1*/
 bool Penpair::InAnalysis(int in_analysis_type){
 	if (in_analysis_type==this->analysis_type)return true;
@@ -268,6 +278,21 @@
 	/*Nothing updated yet*/
 }
 /*}}}*/
+/*FUNCTION Penpair::InputUpdateFromVector(double* vector, int name, int type) {{{1*/
+void  Penpair::InputUpdateFromVector(double* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Penpair::InputUpdateFromVector(int* vector, int name, int type) {{{1*/
+void  Penpair::InputUpdateFromVector(int* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
+/*FUNCTION Penpair::InputUpdateFromVector(bool* vector, int name, int type) {{{1*/
+void  Penpair::InputUpdateFromVector(bool* vector, int name, int type){
+	/*Nothing updated yet*/
+}
+/*}}}*/
 
 /*Penpair management:*/
 /*FUNCTION Penpair::PenaltyCreateKMatrixDiagnosticHoriz{{{1*/

Modified: issm/trunk/src/c/objects/Loads/Penpair.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Penpair.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Penpair.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -45,9 +45,9 @@
 		Object* copy();
 		/*}}}*/
 		/*Update virtual functions resolution: {{{1*/
-		void  InputUpdateFromVector(double* vector, int name, int type){_error_("Not implemented yet!");}
-		void  InputUpdateFromVector(int* vector, int name, int type){_error_("Not implemented yet!");}
-		void  InputUpdateFromVector(bool* vector, int name, int type){_error_("Not implemented yet!");}
+		void  InputUpdateFromVector(double* vector, int name, int type);
+		void  InputUpdateFromVector(int* vector, int name, int type);
+		void  InputUpdateFromVector(bool* vector, int name, int type);
 		void  InputUpdateFromMatrixDakota(double* matrix, int nrow, int ncols,int name, int type){_error_("Not implemented yet!");}
 		void  InputUpdateFromVectorDakota(double* vector, int name, int type){_error_("Not implemented yet!");}
 		void  InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
@@ -63,8 +63,10 @@
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kff, Mat Kfs);
 		void  CreatePVector(Vec pf);
-		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
+		void  CreateJacobianMatrix(Mat Jff);
+		void  PenaltyCreateKMatrix(Mat Kff,Mat Kfs,double kmax);
 		void  PenaltyCreatePVector(Vec pf, double kmax);
+		void  PenaltyCreateJacobianMatrix(Mat Jff,double kmax);
 		bool  InAnalysis(int analysis_type);
 		/*}}}*/
 			/*Penpair management: {{{1*/

Modified: issm/trunk/src/c/objects/Loads/Riftfront.cpp
===================================================================
--- issm/trunk/src/c/objects/Loads/Riftfront.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Riftfront.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -365,14 +365,14 @@
 /*}}}*/
 		
 /*Update virtual functions definitions:*/
-/*FUNCTION Riftfront::InputUpdateFromConstant(int constant,int name) {{{1*/
-void  Riftfront::InputUpdateFromConstant(int constant,int name){
+/*FUNCTION Riftfront::InputUpdateFromConstant(bool constant,int name) {{{1*/
+void  Riftfront::InputUpdateFromConstant(bool constant,int name){
 
 	/*Check that name is a Riftfront input*/
 	if (!IsInput(name)) return;
 
 	/*update input*/
-	this->inputs->AddInput(new IntInput(name,constant));
+	this->inputs->AddInput(new BoolInput(name,constant));
 
 }
 /*}}}*/
@@ -387,7 +387,7 @@
 
 }
 /*}}}*/
-/*FUNCTION Riftfront::InputUpdateFromConstant(double constant,int name) {{{1*/
+/*FUNCTION Riftfront::InputUpdateFromConstant(double* constant,int name) {{{1*/
 void    Riftfront::InputUpdateFromVector(double* vector, int name, int type){
 
 	/*Check that name is a Riftfront input*/

Modified: issm/trunk/src/c/objects/Loads/Riftfront.h
===================================================================
--- issm/trunk/src/c/objects/Loads/Riftfront.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Loads/Riftfront.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -73,8 +73,8 @@
 		void    InputUpdateFromVectorDakota(int* vector, int name, int type){_error_("Not implemented yet!");}
 		void    InputUpdateFromVectorDakota(bool* vector, int name, int type){_error_("Not implemented yet!");}
 		void    InputUpdateFromConstant(double constant, int name);
-		void    InputUpdateFromConstant(int constant, int name);
-		void    InputUpdateFromConstant(bool constant, int name){_error_("Not implemented yet!");}
+		void    InputUpdateFromConstant(int constant, int name){_error_("Not implemented yet!");}
+		void    InputUpdateFromConstant(bool constant, int name);
 		void    InputUpdateFromSolution(double* solution){_error_("Not implemented yet!");}
 		void  InputUpdateFromIoModel(int index, IoModel* iomodel){_error_("not implemented yet");};
 		/*}}}*/
@@ -83,6 +83,8 @@
 		void  SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters);
 		void  CreateKMatrix(Mat Kff, Mat Kfs);
 		void  CreatePVector(Vec pf);
+		void  CreateJacobianMatrix(Mat Jff){_error_("Not implemented yet");};
+		void  PenaltyCreateJacobianMatrix(Mat Jff,double kmax){_error_("Not implemented yet");};
 		void  PenaltyCreateKMatrix(Mat Kff, Mat kfs, double kmax);
 		void  PenaltyCreatePVector(Vec pf, double kmax);
 		bool  InAnalysis(int analysis_type);

Modified: issm/trunk/src/c/objects/Materials/Matice.cpp
===================================================================
--- issm/trunk/src/c/objects/Materials/Matice.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Materials/Matice.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -522,6 +522,71 @@
 	*pviscosity_complement=viscosity_complement;
 }
 /*}}}*/
+/*FUNCTION Matice::GetViscosityDerivativeEpsSquare{{{1*/
+void  Matice::GetViscosityDerivativeEpsSquare(double* pmu_prime, double* epsilon){
+
+	/*output: */
+	double mu_prime;
+	double mu,n,eff2;
+
+	/*input strain rate: */
+	double exx,eyy,exy,exz,eyz;
+
+	/*Get visocisty and n*/
+	GetViscosity3d(&mu,epsilon);
+	n=GetN();
+
+	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
+				(epsilon[3]==0) && (epsilon[4]==0)){
+		mu_prime=0.5*pow((double)10,(double)14);
+	}
+	else{
+		/*Retrive strain rate components: */
+		exx=epsilon[0];
+		eyy=epsilon[1];
+		exy=epsilon[2];
+		exz=epsilon[3];
+		eyz=epsilon[4];
+		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy + exz*exz + eyz*eyz;
+
+		mu_prime=(1-n)/(2*n) * mu/eff2;
+	}
+
+	/*Assign output pointers:*/
+	*pmu_prime=mu_prime;
+}
+/*}}}*/
+/*FUNCTION Matice::GetViscosity2dDerivativeEpsSquare{{{1*/
+void  Matice::GetViscosity2dDerivativeEpsSquare(double* pmu_prime, double* epsilon){
+
+	/*output: */
+	double mu_prime;
+	double mu,n,eff2;
+
+	/*input strain rate: */
+	double exx,eyy,exy,exz;
+
+	/*Get visocisty and n*/
+	GetViscosity2d(&mu,epsilon);
+	n=GetN();
+
+	if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
+		mu_prime=0.5*pow((double)10,(double)14);
+	}
+	else{
+		/*Retrive strain rate components: */
+		exx=epsilon[0];
+		eyy=epsilon[1];
+		exy=epsilon[2];
+		eff2 = exx*exx + eyy*eyy + exx*eyy + exy*exy ;
+
+		mu_prime=(1-n)/(2*n) * mu/eff2;
+	}
+
+	/*Assign output pointers:*/
+	*pmu_prime=mu_prime;
+}
+/*}}}*/
 /*FUNCTION Matice::InputDuplicate{{{1*/
 void  Matice::InputDuplicate(int original_enum,int new_enum){
 
@@ -551,7 +616,7 @@
 				case TriaEnum:
 					double values[3];
 					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetVertexDof()];
-					this->inputs->AddInput(new TriaVertexInput(name,values));
+					this->inputs->AddInput(new TriaP1Input(name,values));
 					return;
 
 				default: _error_("element %s not implemented yet",EnumToStringx(element->ObjectEnum()));
@@ -593,7 +658,7 @@
 				case TriaEnum:
 					double values[3];
 					for (int i=0;i<3;i++) values[i]=vector[((Tria*)element)->nodes[i]->GetSidList()]; //use sid list, to index into serial oriented vector 
-					this->inputs->AddInput(new TriaVertexInput(name,values));
+					this->inputs->AddInput(new TriaP1Input(name,values));
 					/*Special case for rheology B in 2D: Pourave land for this solution{{{2*/
 					if(name==MaterialsRheologyBEnum){
 						/*Are we in 2D?:*/
@@ -606,7 +671,7 @@
 						parameters->FindParam(&dim,MeshDimensionEnum);
 						if(dim==2){
 							/*Dupliacte rheology input: */
-							this->inputs->AddInput(new TriaVertexInput(MaterialsRheologyBbarEnum,values));
+							this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,values));
 						}
 					}
 					/*}}}*/
@@ -682,13 +747,13 @@
 		/*Get B*/
 		if (iomodel->Data(MaterialsRheologyBEnum)) {
 			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
-			this->inputs->AddInput(new TriaVertexInput(MaterialsRheologyBbarEnum,nodeinputs));
+			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyBbarEnum,nodeinputs));
 		}
 
 		/*Get n*/
 		if (iomodel->Data(MaterialsRheologyNEnum)) {
 			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
-			this->inputs->AddInput(new TriaVertexInput(MaterialsRheologyNEnum,nodeinputs));
+			this->inputs->AddInput(new TriaP1Input(MaterialsRheologyNEnum,nodeinputs));
 		}
 
 		/*Control Inputs*/
@@ -702,7 +767,7 @@
 							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
 							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
 							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
-							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+							this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
 						break;
 				}
@@ -724,13 +789,13 @@
 		/*Get B*/
 		if (iomodel->Data(MaterialsRheologyBEnum)) {
 			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+i]-1)];
-			this->inputs->AddInput(new PentaVertexInput(MaterialsRheologyBEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyBEnum,nodeinputs));
 		}
 
 		/*Get n*/
 		if (iomodel->Data(MaterialsRheologyNEnum)) {
 			for(i=0;i<num_vertices;i++) nodeinputs[i]=iomodel->Data(MaterialsRheologyNEnum)[index];
-			this->inputs->AddInput(new PentaVertexInput(MaterialsRheologyNEnum,nodeinputs));
+			this->inputs->AddInput(new PentaP1Input(MaterialsRheologyNEnum,nodeinputs));
 		}
 
 		/*Control Inputs*/
@@ -744,7 +809,7 @@
 							for(j=0;j<num_vertices;j++)nodeinputs[j]=iomodel->Data(MaterialsRheologyBEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)];
 							for(j=0;j<num_vertices;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
 							for(j=0;j<num_vertices;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[int(iomodel->Data(MeshElementsEnum)[num_vertices*index+j]-1)*num_control_type+i];
-							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaVertexInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
+							this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaP1InputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1));
 						}
 						break;
 				}

Modified: issm/trunk/src/c/objects/Materials/Matice.h
===================================================================
--- issm/trunk/src/c/objects/Materials/Matice.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Materials/Matice.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -67,6 +67,8 @@
 		void   GetViscosity3d(double* pviscosity3d, double* pepsilon);
 		void   GetViscosity3dStokes(double* pviscosity3d, double* epsilon);
 		void   GetViscosityComplement(double* pviscosity_complement, double* pepsilon);
+		void   GetViscosityDerivativeEpsSquare(double* pmu_prime, double* pepsilon);
+		void   GetViscosity2dDerivativeEpsSquare(double* pmu_prime, double* pepsilon);
 		double GetB();
 		double GetBbar();
 		double GetN();

Modified: issm/trunk/src/c/objects/Materials/Matpar.cpp
===================================================================
--- issm/trunk/src/c/objects/Materials/Matpar.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Materials/Matpar.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -415,7 +415,12 @@
 /*}}}1*/
 /*FUNCTION Matpar::GetEnthalpyDiffusionParameter{{{1*/
 double Matpar::GetEnthalpyDiffusionParameter(double enthalpy,double pressure){
-	return thermalconductivity/(rho_ice*heatcapacity);
+	if(enthalpy<PureIceEnthalpy(pressure)){
+		return thermalconductivity/(rho_ice*heatcapacity);
+	}
+	else{
+		return 0.1*thermalconductivity/(rho_ice*heatcapacity);
+	}
 }
 /*}}}1*/
 /*FUNCTION Matpar::EnthalpyToThermal {{{1*/

Modified: issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp
===================================================================
--- issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Numerics/ElementMatrix.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -244,12 +244,18 @@
 /*}}}*/
 
 /*ElementMatrix specific routines: */
-/*FUNCTION ElementMatrix::AddToGlobal{{{1*/
+/*FUNCTION ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){{{1*/
 void ElementMatrix::AddToGlobal(Mat Kff, Mat Kfs){
 
 	int i,j;
 	double* localvalues=NULL;
 
+	/*If Kfs is not provided, call the other function*/
+	if(!Kfs){
+		this->AddToGlobal(Kff);
+		return;
+	}
+
 	/*In debugging mode, check consistency (no NaN, and values not too big)*/
 	this->CheckConsistency();
 
@@ -293,6 +299,43 @@
 
 }
 /*}}}*/
+/*FUNCTION ElementMatrix::AddToGlobal(Mat Jff){{{1*/
+void ElementMatrix::AddToGlobal(Mat Jff){
+
+	int i,j;
+	double* localvalues=NULL;
+
+	/*Check that Jff is not NULL*/
+	_assert_(Jff); 
+
+	/*In debugging mode, check consistency (no NaN, and values not too big)*/
+	this->CheckConsistency();
+
+	if(this->dofsymmetrical){
+		/*only use row dofs to add values into global matrices: */
+
+		if(this->row_fsize){
+			/*first, retrieve values that are in the f-set from the g-set values matrix: */
+			localvalues=(double*)xmalloc(this->row_fsize*this->row_fsize*sizeof(double));
+			for(i=0;i<this->row_fsize;i++){
+				for(j=0;j<this->row_fsize;j++){
+					*(localvalues+this->row_fsize*i+j)=*(this->values+this->ncols*this->row_flocaldoflist[i]+this->row_flocaldoflist[j]);
+				}
+			}
+			/*add local values into global  matrix, using the fglobaldoflist: */
+			MatSetValues(Jff,this->row_fsize,this->row_fglobaldoflist,this->row_fsize,this->row_fglobaldoflist,(const double*)localvalues,ADD_VALUES);
+
+			/*Free ressources:*/
+			xfree((void**)&localvalues);
+		}
+
+	}
+	else{
+		_error_(" non dofsymmetrical matrix AddToGlobal routine not support yet!");
+	}
+
+}
+/*}}}*/
 /*FUNCTION ElementMatrix::CheckConsistency{{{1*/
 void ElementMatrix::CheckConsistency(void){
 	/*Check element matrix values, only in debugging mode*/

Modified: issm/trunk/src/c/objects/Numerics/ElementMatrix.h
===================================================================
--- issm/trunk/src/c/objects/Numerics/ElementMatrix.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Numerics/ElementMatrix.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -58,6 +58,7 @@
 		/*}}}*/
 		/*ElementMatrix specific routines {{{1*/
 		void AddToGlobal(Mat Kff, Mat Kfs);
+		void AddToGlobal(Mat Jff);
 		void Echo(void);
 		void CheckConsistency(void);
 		void Transpose(void);

Modified: issm/trunk/src/c/objects/Params/BoolParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/BoolParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/BoolParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -56,7 +56,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Bool param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("Bool param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("Bool param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Bool param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Bool param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("Bool param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Bool param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/DoubleMatArrayParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -59,7 +59,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("DoubleMatArray param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("DoubleMatArray param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("DoubleMatArray param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("DoubleMatArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("DoubleMatArray param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims);

Modified: issm/trunk/src/c/objects/Params/DoubleMatParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleMatParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/DoubleMatParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -58,7 +58,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
 		void  GetParameterValue(double* pdouble){_error_("DoubleMat param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("DoubleMat param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("DoubleMat param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM,int* pN);
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/DoubleParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/DoubleParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -57,7 +57,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
 		void  GetParameterValue(double* pdouble){*pdouble=value;}
 		void  GetParameterValue(char** pstring){_error_("Double param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Double param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Double param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM);
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN);
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Double param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/DoubleVecParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/DoubleVecParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/DoubleVecParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -54,10 +54,10 @@
 		void  GetParameterValue(bool* pbool){_error_("DoubleVec param of enum %i (%s) cannot return a bool",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(int* pinteger){_error_("DoubleVec param of enum %i (%s) cannot return an integer",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(int** pintarray,int* pM);
-		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("DoubleVec param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));};
+		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("DoubleVec param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));};
 		void  GetParameterValue(double* pdouble){_error_("DoubleVec param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("DoubleVec param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleVec param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("DoubleVec param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM);
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN);
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("DoubleVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/FileParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/FileParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/FileParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -56,7 +56,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("FileParam of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("FileParam of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("FileParam of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("FileParam of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("FileParam of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("FileParam of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("FileParam of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("File param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/IntMatParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/IntMatParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/IntMatParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -58,7 +58,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN);
 		void  GetParameterValue(double* pdouble){_error_("IntMat param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("IntMat param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("IntMat param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("IntMat param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("IntMat param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM,int* pN){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));};
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("IntMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/IntParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/IntParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/IntParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -57,7 +57,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("Int param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("Int param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("Int param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Int param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("Int param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("Int param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("Int param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("Int param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/PetscMatParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/PetscMatParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/PetscMatParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -57,7 +57,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("PetscMat param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("PetscMat param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("PetscMat param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("PetscMat param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("PetscMat param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("PetscMat param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("PetscMat param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("PetscMat param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/PetscVecParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/PetscVecParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/PetscVecParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -57,7 +57,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("PetscVec param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("PetscVec param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring){_error_("PetscVec param of enum %i (%s) cannot return a string",enum_type,EnumToStringx(enum_type));}
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("PetscVec param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("PetscVec param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("PetscVec param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("PetscVec param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("PetscVec param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Params/StringParam.h
===================================================================
--- issm/trunk/src/c/objects/Params/StringParam.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Params/StringParam.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -57,7 +57,7 @@
 		void  GetParameterValue(int** pintarray,int* pM,int* pN){_error_("String param of enum %i (%s) cannot return an array of integers",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double* pdouble){_error_("String param of enum %i (%s) cannot return a double",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(char** pstring);
-		void  GetParameterValue(char*** pstringarray,int* pM){_error_("String param of enum %i (%s) cannot return a string arrayl",enum_type,EnumToStringx(enum_type));}
+		void  GetParameterValue(char*** pstringarray,int* pM){_error_("String param of enum %i (%s) cannot return a string array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM){_error_("String param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double** pdoublearray,int* pM, int* pN){_error_("String param of enum %i (%s) cannot return a double array",enum_type,EnumToStringx(enum_type));}
 		void  GetParameterValue(double*** parray, int* pM,int** pmdims, int** pndims){_error_("String param of enum %i (%s) cannot return a matrix array",enum_type,EnumToStringx(enum_type));}

Modified: issm/trunk/src/c/objects/Patch.cpp
===================================================================
--- issm/trunk/src/c/objects/Patch.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Patch.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -11,6 +11,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <math.h>
 #include "./objects.h"
 #include "../Container/Container.h"
 #include "../io/io.h"

Modified: issm/trunk/src/c/objects/Vertex.cpp
===================================================================
--- issm/trunk/src/c/objects/Vertex.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Vertex.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -272,10 +272,21 @@
 int    Vertex::Sid(void){ return sid; }
 /*}}}*/
 /*FUNCTION Vertex::UpdateVertexPosition {{{1*/
-void  Vertex::UpdatePosition(double* thickness,double* bed){
+void  Vertex::UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed){
 
+	double oldz,newz;
+	double dt,velz;
+
+	/*Get time stepping*/
+	parameters->FindParam(&dt,TimesteppingTimeStepEnum);
+
 	/*sigma remains constant. z=bed+sigma*thickness*/
-	this->z=bed[this->dof]+sigma*thickness[this->dof];
+	oldz = this->z;
+	newz = bed[this->dof]+sigma*thickness[this->dof];
+	velz = (newz-oldz)/dt;
+	this->z = newz;
 
+	/*put vz in vector*/
+	VecSetValue(vz,this->dof,velz,INSERT_VALUES);
 }
 /*}}}*/

Modified: issm/trunk/src/c/objects/Vertex.h
===================================================================
--- issm/trunk/src/c/objects/Vertex.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/Vertex.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -62,7 +62,7 @@
 		/*Vertex management: {{{1*/
 		int   Sid(void); 
 		int   Connectivity(void); 
-		void  UpdatePosition(double* thickness,double* bed);
+		void  UpdatePosition(Vec vz,Parameters* parameters,double* thickness,double* bed);
 		/*}}}*/
 };
 #endif  /* _VERTEX_H */

Modified: issm/trunk/src/c/objects/objects.h
===================================================================
--- issm/trunk/src/c/objects/objects.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/objects/objects.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -71,6 +71,7 @@
 #include "./KML/KML_Style.h"
 #include "./KML/KML_StyleSelector.h"
 #include "./KML/KML_SubStyle.h"
+#include "./KML/KML_Unknown.h"
 #include "./KML/KMLFileReadUtils.h"
 
 /*Option parsing objects: */
@@ -87,8 +88,8 @@
 #include "./Inputs/BoolInput.h"
 #include "./Inputs/DoubleInput.h"
 #include "./Inputs/IntInput.h"
-#include "./Inputs/PentaVertexInput.h"
-#include "./Inputs/TriaVertexInput.h"
+#include "./Inputs/PentaP1Input.h"
+#include "./Inputs/TriaP1Input.h"
 #include "./Inputs/ControlInput.h"
 #include "./Inputs/DatasetInput.h"
 #include "./Inputs/TransientInput.h"
@@ -96,8 +97,8 @@
 /*ElementResults: */
 #include "./ElementResults/ElementResult.h"
 #include "./ElementResults/DoubleElementResult.h"
-#include "./ElementResults/TriaVertexElementResult.h"
-#include "./ElementResults/PentaVertexElementResult.h" 
+#include "./ElementResults/TriaP1ElementResult.h"
+#include "./ElementResults/PentaP1ElementResult.h" 
 #include "./ElementResults/BoolElementResult.h"
 
 /*ExternalResults: */

Modified: issm/trunk/src/c/shared/Numerics/Synchronize.sh
===================================================================
--- issm/trunk/src/c/shared/Numerics/Synchronize.sh	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/shared/Numerics/Synchronize.sh	2012-02-24 16:12:47 UTC (rev 11527)
@@ -164,6 +164,7 @@
 	level=mxGetScalar(output);
 
 	verbositylevel = (int)level;
+	return verbositylevel;
 
 #else
 

Modified: issm/trunk/src/c/shared/Numerics/UnitConversion.cpp
===================================================================
--- issm/trunk/src/c/shared/Numerics/UnitConversion.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/shared/Numerics/UnitConversion.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -62,8 +62,7 @@
 		case BalancethicknessThickeningRateEnum:  scale=yts;break; //m/yr
 		case BasalforcingsMeltingRateEnum:        scale=yts;break; //m/yr
 		case BasalforcingsMeltingRateCorrectionEnum: scale=yts;break; //m/yr
-		case SurfaceforcingsAccumulationRateEnum: scale=yts;break; //m/yr
-		case SurfaceforcingsAblationRateEnum:     scale=yts;break; //m/yr
+		case SurfaceforcingsPrecipitationEnum:     scale=yts;break; //m/yr
 		case SurfaceforcingsMassBalanceEnum:      scale=yts;break; //m/yr
 		case MisfitEnum:      scale=pow(yts,2);break; //(m/yr)^2
 		case MassFluxEnum:    scale=pow((double)10,-12)*yts;break; // (GigaTon/year)

Modified: issm/trunk/src/c/shared/Numerics/Verbosity.cpp
===================================================================
--- issm/trunk/src/c/shared/Numerics/Verbosity.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/shared/Numerics/Verbosity.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -63,6 +63,7 @@
 	level=mxGetScalar(output);
 
 	verbositylevel = (int)level;
+	return verbositylevel;
 
 #else
 

Modified: issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp
===================================================================
--- issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/shared/TriMesh/TriMeshUtils.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -123,7 +123,7 @@
                                    RiftSegmentsFromSegments
 ******************************************************************************************************************************/
 
-int RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments){
+void RiftSegmentsFromSegments(int* pnriftsegs, int** priftsegments, int nel, double* index, int nsegs,double* segments){
 	
 	int i,counter;
 	int el,el2;
@@ -378,26 +378,26 @@
 /******************************************************************************************************************************
                                    IsInPoly
 ******************************************************************************************************************************/
-int IsInPoly(double* in,double* xc,double* yc,int numnodes,double* x,double* y,int nods){
+//void IsInPoly(double* in,double* xc,double* yc,int numnodes,double* x,double* y,int nods){
+//
+//	int i;
+//	double x0,y0;
+//
+//	/*Go through all nodes of the mesh:*/
+//	for (i=0;i<nods;i++){
+//		if (in[i]){
+//			/*this node already is inside one of the contours, continue*/
+//			continue;
+//		}
+//		/*pick up node: */
+//		x0=x[i];
+//		y0=y[i];
+//		if (pnpoly(numnodes,xc,yc,x0,y0)){
+//			in[i]=1;
+//		}
+//	}
+//}
 
-	int i;
-	double x0,y0;
-
-	/*Go through all nodes of the mesh:*/
-	for (i=0;i<nods;i++){
-		if (in[i]){
-			/*this node already is inside one of the contours, continue*/
-			continue;
-		}
-		/*pick up node: */
-		x0=x[i];
-		y0=y[i];
-		if (pnpoly(numnodes,xc,yc,x0,y0)){
-			in[i]=1;
-		}
-	}
-}
-
 /******************************************************************************************************************************
                                    FindElement
 ******************************************************************************************************************************/

Modified: issm/trunk/src/c/shared/TriMesh/trimesh.h
===================================================================
--- issm/trunk/src/c/shared/TriMesh/trimesh.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/shared/TriMesh/trimesh.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -25,7 +25,7 @@
 int GridElementsList(int** pGridElements, int* pNumGridElements,int node,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);
+void 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 node,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);

Modified: issm/trunk/src/c/solutions/AnalysisConfiguration.cpp
===================================================================
--- issm/trunk/src/c/solutions/AnalysisConfiguration.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/AnalysisConfiguration.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -94,7 +94,7 @@
 			break;
 
 		case TransientSolutionEnum:
-			numanalyses=8;
+			numanalyses=9;
 			analyses=(int*)xmalloc(numanalyses*sizeof(int));
 			analyses[0]=DiagnosticHorizAnalysisEnum;
 			analyses[1]=DiagnosticVertAnalysisEnum;
@@ -103,7 +103,8 @@
 			analyses[4]=BedSlopeAnalysisEnum;
 			analyses[5]=ThermalAnalysisEnum;
 			analyses[6]=MeltingAnalysisEnum;
-			analyses[7]=PrognosticAnalysisEnum;
+			analyses[7]=EnthalpyAnalysisEnum;
+			analyses[8]=PrognosticAnalysisEnum;
 			break;
 		
 		default:

Modified: issm/trunk/src/c/solutions/control_core.cpp
===================================================================
--- issm/trunk/src/c/solutions/control_core.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/control_core.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -33,7 +33,7 @@
 	double* cm_jump=NULL;
 		
 	/*intermediary: */
-	double  search_scalar=0;
+	double  search_scalar=1;
 	OptArgs optargs;
 	OptPars optpars;
 
@@ -69,7 +69,7 @@
 
 	/*Initialize responses: */
 	J=(double*)xmalloc(nsteps*sizeof(double));
-	step_responses=(int*)xmalloc(num_responses*sizeof(double));
+	step_responses=(int*)xmalloc(num_responses*sizeof(int));
 		
 	/*Initialize some of the BrentSearch arguments: */
 	optargs.femmodel=femmodel;
@@ -83,12 +83,12 @@
 		for(i=0;i<num_responses;i++) step_responses[i]=(int)responses[n*num_responses+i];
 		femmodel->parameters->SetParam(step_responses,1,num_responses,StepResponsesEnum);
 		
-		/*In case we are running a steady state control method, compute new temperature field using new parameter distribution: */
+		/*In steady state inversion, compute new temperature field now*/
 		if(solution_type==SteadystateSolutionEnum) solutioncore(femmodel);
 
 		_printf_(VerboseControl(),"%s\n","   compute adjoint state:");
 		adjointcore(femmodel);
-		gradient_core(femmodel,n,search_scalar);
+		gradient_core(femmodel,n,search_scalar==0);
 
 		/*Return gradient if asked: */
 		if (cm_gradient){
@@ -99,18 +99,11 @@
 		_printf_(VerboseControl(),"%s\n","   optimizing along gradient direction");
 		optpars.maxiter=(int)maxiter[n]; optpars.cm_jump=cm_jump[n];
 		BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs);
-		//OptimalSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs);
 
 		_printf_(VerboseControl(),"%s\n","   updating parameter using optimized search scalar"); //true means update save controls
 		InputControlUpdatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,search_scalar,true);
 		
 		if(controlconvergence(J[n],tol_cm)) break;
-
-		/*Temporary saving every 5 control steps: */
-		/*if (((n+1)%5)==0){
-			_printf_(VerboseControl(),"%s\n","   saving temporary results");
-			controlrestart(femmodel,J);
-		}*/
 	}
 
 	_printf_(VerboseControl(),"%s\n","   preparing final solution");
@@ -121,7 +114,6 @@
 	if(!dakota_analysis){ //do not save this if we are running the control core from a qmu run!
 		for(i=0;i<num_controls;i++) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type[i]);
 		femmodel->results->AddObject(new DoubleVecExternalResult(femmodel->results->Size()+1,JEnum,J,nsteps,1,0));
-		//femmodel->results->AddObject(new StringExternalResult(femmodel->results->Size()+1,InversionControlParametersEnum,EnumToStringx(control_type),1,0));
 	}
 
 	cleanup_and_return:

Modified: issm/trunk/src/c/solutions/controltao_core.cpp
===================================================================
--- issm/trunk/src/c/solutions/controltao_core.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/controltao_core.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -12,12 +12,12 @@
 #include "../include/include.h"
 #include "../solvers/solvers.h"
 
+#if defined (_HAVE_TAO_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ == 2)
+#include <tao.h>
 
-#if defined (_HAVE_TAO_) && (_PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2))
-#include "tao.h"
-
 /*Local prototype*/
-int FormFunctionGradient(TAO_APPLICATION,Vec,double *,Vec,void*);
+int FormFunctionGradient(TaoSolver,Vec,double*,Vec,void*);
+int IssmMonitor(TaoSolver,void*);
 typedef struct {
 	FemModel* femmodel;
 } AppCtx;
@@ -25,114 +25,153 @@
 void controltao_core(FemModel* femmodel){
 
 	/*TAO*/
-	int                i,n,info;
-	//TaoMethod          method = "tao_blmvm";
-	//TaoMethod        method = "tao_lmvm";
-	TaoMethod        method = "tao_cg";
-	TaoTerminateReason reason;
-	TAO_SOLVER         tao;
-	TAO_APPLICATION    controlapp;
-	Vec                initial_solution = NULL;
-	AppCtx             user;
-	PetscInt           iter;
-	double             ff,gnorm;
+	int        ierr;
+	int        num_controls,solution_type;
+	int        nsteps,maxiter;
+	AppCtx     user;
+	TaoSolver  tao;
+	double    *dummy          = NULL;
+	int       *control_list   = NULL;
+	Vec        X              = NULL;
+	Vec        XL             = NULL;
+	Vec        XU             = NULL;
 
 	/*Initialize TAO*/
-	int argc; char **args; PetscGetArgs(&argc,&args);
-	int ierr=TaoInitialize(&argc,&args,(char*)0,"");
+	int argc; char **args=NULL;
+	PetscGetArgs(&argc,&args);
+	ierr = TaoInitialize(&argc,&args,(char*)0,"");
 	if(ierr) _error_("Could not initialize Tao");
 
-	/*Line search options*/
-	info = PetscOptionsSetValue("-tao_ls_stepmax","10e11"); if(info) _error_("STOP"); //does not work
-	info = PetscOptionsSetValue("-tao_ls_stepmin","10e5"); if(info) _error_("STOP");    //does not work
-	info = PetscOptionsSetValue("-tao_ls_maxfev","8"); if(info) _error_("STOP");
+	/*Recover some parameters*/
+	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
+	femmodel->parameters->FindParam(&control_list,NULL,InversionControlParametersEnum);
+	femmodel->parameters->FindParam(&nsteps,InversionNstepsEnum);
+	femmodel->parameters->FindParam(&dummy,NULL,NULL,InversionMaxiterPerStepEnum);
+	maxiter=nsteps*(int)dummy[0]; xfree((void**)&dummy);
 
-	/*TAO options: http://www.mcs.anl.gov/research/projects/tao/docs/manualpages/solver/TaoSetFromOptions.html*/
-	info = PetscOptionsSetValue("-tao_monitor",""); if(info) _error_("STOP");
-	info = PetscOptionsSetValue("-tao_gatol","10e-18"); if(info) _error_("STOP");
-	info = PetscOptionsSetValue("-tao_max_its","10"); if(info) _error_("STOP");
-	info = PetscOptionsSetValue("-tao_max_funcs","20"); if(info) _error_("STOP");
+	/*Initialize TAO*/
+	_printf_(VerboseControl(),"%s\n","   Initializing the Toolkit for Advanced Optimization (TAO)");
+	TaoCreate(PETSC_COMM_WORLD,&tao);
+	TaoSetFromOptions(tao);
+	TaoSetType(tao,"tao_blmvm");
+	//TaoSetType(tao,"tao_cg");
+	//TaoSetType(tao,"tao_lmvm");
 
-	/*Additional options*/
-	//info = PetscOptionsSetValue("-info","/u/astrid-r1b/morlighe/svn/issm/trunk/test/NightlyRun/taolog.txt"); if(info) _error_("STOP");
+	/*Prepare all TAO parameters*/
+	TaoSetMonitor(tao,IssmMonitor,&user,NULL);
+	TaoSetMaximumFunctionEvaluations(tao,maxiter);
+	TaoSetMaximumIterations(tao,nsteps);
+	TaoSetTolerances(tao,0.,0.,0.,0.,0.);
 
-	/*Initialize argument*/
+	GetVectorFromControlInputsx(&X, femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"value");
+	GetVectorFromControlInputsx(&XL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"lowerbound");
+	GetVectorFromControlInputsx(&XU,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,"upperbound");
+	TaoSetInitialVector(tao,X);
+	TaoSetVariableBounds(tao,XL,XU);
+	VecFree(&XL);
+	VecFree(&XU);
+
 	user.femmodel=femmodel;
+	TaoSetObjectiveAndGradientRoutine(tao,FormFunctionGradient,(void*)&user); 
 
-	/*Set up and solve TAO*/
-	GetVectorFromInputsx(&initial_solution,femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,MaterialsRheologyBbarEnum,VertexEnum);
-	info = TaoCreate(PETSC_COMM_WORLD,method,&tao); if(info) _error_("STOP");
-	info = TaoApplicationCreate(PETSC_COMM_WORLD,&controlapp); if(info) _error_("STOP");
-	info = TaoAppSetInitialSolutionVec(controlapp,initial_solution);  if(info) _error_("STOP");
-	info = TaoAppSetObjectiveAndGradientRoutine(controlapp,FormFunctionGradient,(void*)&user);  if(info) _error_("STOP");
-	info = TaoSetOptions(controlapp,tao);  if(info) _error_("STOP");
-	info = TaoSolveApplication(controlapp,tao); //if(info) _error_("STOP");
-
-	/*Get solution status*/
-	info = TaoGetSolutionStatus(tao,&iter,&ff,&gnorm,0,0,&reason); //CHKERRQ(info);
-	switch(reason){ /*http://www.mcs.anl.gov/research/projects/tao/docs/manualpages/solver/TaoGetTerminationReason.html*/
-		case TAO_CONVERGED_ATOL:       _printf_(true,"TAO_CONVERGED_ATOL (res <= atol)\n"); break;
-		case TAO_CONVERGED_RTOL:       _printf_(true,"TAO_CONVERGED_RTOL (res/res0 <= rtol)\n"); break;
-		case TAO_CONVERGED_TRTOL:      _printf_(true,"TAO_CONVERGED_TRTOL (xdiff <= trtol) \n"); break;
-		case TAO_CONVERGED_MINF:       _printf_(true,"TAO_CONVERGED_MINF  (f <= fmin)\n"); break;
-		case TAO_CONVERGED_USER:       _printf_(true,"TAO_CONVERGED_USER (user defined)\n"); break;
-		case TAO_DIVERGED_MAXITS:      _printf_(true,"TAO_DIVERGED_MAXITS (its>maxits)\n"); break;
-		case TAO_DIVERGED_NAN:         _printf_(true,"TAO_DIVERGED_NAN (Numerical problems)\n"); break;
-		case TAO_DIVERGED_MAXFCN:      _printf_(true,"TAO_DIVERGED_MAXFCN (nfunc > maxnfuncts)\n"); break;
-		case TAO_DIVERGED_LS_FAILURE:  _printf_(true,"TAO_DIVERGED_LS_FAILURE (line search failure)\n"); break;
-		case TAO_DIVERGED_TR_REDUCTION:_printf_(true,"TAO_DIVERGED_TR_REDUCTION \n"); break;
-		case TAO_DIVERGED_USER:        _printf_(true,"TAO_DIVERGED_USER (user defined)\n"); break;
-		default: _printf_(true,"unknown reason");
+	/*Solver optimization problem*/
+	_printf_(VerboseControl(),"%s\n","   Starting optimization");
+	TaoSolve(tao);
+	TaoView(tao,PETSC_VIEWER_STDOUT_WORLD);
+	TaoGetSolutionVector(tao,&X);
+	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
+	for(int i=0;i<num_controls;i++){
+		InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_list[i]);
 	}
-	if (reason<=0){
-		_printf_(true,"Try a different TAO method, adjust some parameters, or check the function evaluation routines\n");
-		_printf_(true," Iterations: %d,  Function Value: %4.2e, Residual: %4.2e \n",iter,ff,gnorm);
-	}
-	else{
-	 _printf_(true,"TAO found a solution");
-	}
-	info = TaoView(tao);  if(info) _error_("STOP");
 
-	/*Clean up*/
-	info = TaoDestroy(tao);  if(info) _error_("STOP");
-	info = TaoAppDestroy(controlapp);  if(info) _error_("STOP");
-	VecFree(&initial_solution);
+	/*Finalize*/
+	_printf_(VerboseControl(),"%s\n","   preparing final solution");
+	femmodel->parameters->SetParam(false,InversionIscontrolEnum); //needed to turn control result output in solutioncore
+	void (*solutioncore)(FemModel*)=NULL;
+	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
+	solutioncore(femmodel);
 
-	/* Finalize TAO */
+	/*Clean up and return*/
+	xfree((void**)&control_list);
+	VecFree(&X);
+	TaoDestroy(&tao);
 	TaoFinalize();
 }
+int FormFunctionGradient(TaoSolver tao, Vec X, double *fcn,Vec G,void *userCtx){
 
-int FormFunctionGradient(TAO_APPLICATION taoapp, Vec X, double *fcn,Vec G,void *userCtx){
-
 	/*Retreive arguments*/
-	AppCtx   *user     = (AppCtx*)userCtx;
-	FemModel *femmodel = user->femmodel;
-	Vec       gradient = NULL;
+	int       solution_type,num_cost_functions;
+	AppCtx   *user           = (AppCtx *)userCtx;
+	FemModel *femmodel       = user->femmodel;
+	int      *cost_functions = NULL;
+	double   *cost_functionsd= NULL;
+	Vec       gradient       = NULL;
 
-	/*Temp*/
-//	double*   Xserial=NULL;
-//	VecToMPISerial(&Xserial,X);
-//	printf("X= [%20.20g %20.20g %20.20g]\n",Xserial[0],Xserial[1],Xserial[2]);
-	/*End Temp*/
+	/*Set new variable*/
+	//VecView(X,PETSC_VIEWER_STDOUT_WORLD);
+	SetControlInputsFromVectorx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,X);
 
-	InputUpdateFromConstantx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,SurfaceAbsVelMisfitEnum,InversionCostFunctionEnum);
-	InputUpdateFromVectorx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,X,MaterialsRheologyBbarEnum,VertexEnum);
-	adjointdiagnostic_core(user->femmodel);
-	Gradjx(&gradient, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters, MaterialsRheologyBbarEnum);
-	VecScale(gradient,10e7);
-	//VecScale(gradient,-1.);
-	VecCopy(gradient,G);
-	CostFunctionx(fcn, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials, femmodel->parameters);
+	/*Recover some parameters*/
+	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
+	femmodel->parameters->FindParam(&num_cost_functions,InversionNumCostFunctionsEnum);
+	femmodel->parameters->FindParam(&cost_functionsd,NULL,NULL,InversionCostFunctionsEnum);
 
-	//printf("X\n");
-	//VecView(X,PETSC_VIEWER_STDOUT_SELF);
+	/*Prepare objective function*/
+	cost_functions=(int*)xmalloc(num_cost_functions*sizeof(int));
+	for(int i=0;i<num_cost_functions;i++) cost_functions[i]=(int)cost_functionsd[i]; //FIXME
+	femmodel->parameters->SetParam(cost_functions,1,num_cost_functions,StepResponsesEnum);
 
-	//printf("Gradient\n");
-	//VecView(G,PETSC_VIEWER_STDOUT_SELF);
+	/*Compute solution and adjoint*/
+	void (*solutioncore)(FemModel*)=NULL;
+	void (*adjointcore)(FemModel*)=NULL;
+	CorePointerFromSolutionEnum(&solutioncore,femmodel->parameters,solution_type);
+	AdjointCorePointerFromSolutionEnum(&adjointcore,solution_type);
+	solutioncore(femmodel);
+	adjointcore(femmodel);
 
-	printf("f(x) = %g\n",*fcn);
+	/*Compute objective function*/
+	CostFunctionx(fcn,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+
+	/*Compute gradient*/
+	Gradjx(&gradient,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+	VecCopy(gradient,G); VecFree(&gradient);
+	VecScale(G,-1.);
+
+	/*Clean-up and return*/
+	xfree((void**)&cost_functions);
+	xfree((void**)&cost_functionsd);
 	return 0;
 }
+int IssmMonitor(TaoSolver tao, void *userCtx){
+
+	int       i,its,num_responses;
+	double    f,gnorm,cnorm,xdiff;
+	AppCtx   *user      = (AppCtx *)userCtx;
+	FemModel *femmodel  = user->femmodel;
+	Element  *element   = NULL;
+	int      *responses = NULL;
+
+	femmodel->parameters->FindParam(&num_responses,InversionNumCostFunctionsEnum);
+	femmodel->parameters->FindParam(&responses,NULL,NULL,StepResponsesEnum);
+
+	TaoGetSolutionStatus(tao, &its, &f, &gnorm, &cnorm, &xdiff, NULL);
+	if(its==0) _printf_(true,"Iter       Function      Residual  |  List of contributions\n");
+	if(its==0) _printf_(true,"-----------------------------------+-----------------------\n");
+	_printf_(true,"%4i   %12.7g  %12.7g  | ",its,f,gnorm);
+
+	/*Retrieve objective functions independently*/
+	for(i=0;i<num_responses;i++){
+		Responsex(&f,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnumToStringx(responses[i]),false,i);
+		_printf_(true," %12.7g ","",f);
+	}
+	_printf_(true,"\n");
+
+	/*Clean-up and return*/
+	xfree((void**)&responses);
+	return 0;
+}
+
 #else
 void controltao_core(FemModel* femmodel){
 	_error_("TAO not installed or PETSc version not supported");

Modified: issm/trunk/src/c/solutions/convergence.cpp
===================================================================
--- issm/trunk/src/c/solutions/convergence.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/convergence.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,10 +7,10 @@
 #include "../io/io.h"
 #include "../EnumDefinitions/EnumDefinitions.h"
 
-void convergence(int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
+void convergence(bool* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){
 
 	/*output*/
-	int converged=0;
+	bool converged=false;
 
 	/*intermediary*/
 	Vec KU=NULL;
@@ -33,7 +33,7 @@
 	/*If uf is NULL in input, f-set is nil, model is fully constrained, therefore converged from 
 	 * the get go: */
 	if(!uf){
-		*pconverged=1;
+		*pconverged=true;
 		return;
 	}
 
@@ -81,11 +81,11 @@
 	//print
 	if(res<eps_res){
 		_printf_(VerboseConvergence(),"%-50s%g%s%g%s\n","   mechanical equilibrium convergence criterion",res*100," < ",eps_res*100," %");
-		converged=1;
+		converged=true;
 	}
 	else{ 
 		_printf_(VerboseConvergence(),"%-50s%g%s%g%s\n","   mechanical equilibrium convergence criterion",res*100," > ",eps_res*100," %");
-		converged=0;
+		converged=false;
 	}
 
 	/*Relative criterion (optional)*/
@@ -107,7 +107,7 @@
 			}
 			else{ 
 				_printf_(VerboseConvergence(),"%-50s%g%s%g%s\n","   Convergence criterion: norm(du)/norm(u)",ndu/nu*100," > ",eps_rel*100," %");
-				converged=0;
+				converged=false;
 			}
 		}
 		else _printf_(true,"%-50s%g%s\n","   Convergence criterion: norm(du)/norm(u)",ndu/nu*100," %");
@@ -132,7 +132,7 @@
 			}
 			else{
 				_printf_(VerboseConvergence(),"%-50s%g%s%g%s\n","   Convergence criterion: max(du)",nduinf*yts," > ",eps_abs," m/yr");
-				converged=0;
+				converged=false;
 			}
 		}
 		else  _printf_(true,"%-50s%g%s\n","   Convergence criterion: max(du)",nduinf*yts," m/yr");

Modified: issm/trunk/src/c/solutions/diagnostic_core.cpp
===================================================================
--- issm/trunk/src/c/solutions/diagnostic_core.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/diagnostic_core.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -15,23 +15,25 @@
 void diagnostic_core(FemModel* femmodel){
 
 	/*parameters: */
-	bool   dakota_analysis         = false;
-	int    dim                  = -1;
-	bool   ishutter             = false;
-	bool   ismacayealpattyn     = false;
-	bool   isstokes             = false;
-	bool   conserve_loads       = true;
-	bool   modify_loads         = true;
-	bool   control_analysis;
-	int    solution_type;
-	int    numoutputs         = 0;
-	int    *requested_outputs = NULL;
+	bool  dakota_analysis   = false;
+	int   dim               = -1;
+	bool  ishutter          = false;
+	bool  ismacayealpattyn  = false;
+	bool  isstokes          = false;
+	bool  isnewton          = false;
+	bool  conserve_loads    = true;
+	bool  modify_loads      = true;
+	bool  control_analysis;
+	int   solution_type;
+	int   numoutputs        = 0;
+	int  *requested_outputs = NULL;
 
 	/* recover parameters:*/
 	femmodel->parameters->FindParam(&dim,MeshDimensionEnum);
 	femmodel->parameters->FindParam(&ishutter,FlowequationIshutterEnum);
 	femmodel->parameters->FindParam(&ismacayealpattyn,FlowequationIsmacayealpattynEnum);
 	femmodel->parameters->FindParam(&isstokes,FlowequationIsstokesEnum);
+	femmodel->parameters->FindParam(&isnewton,DiagnosticIsnewtonEnum);
 	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
 	femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
 	femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum);
@@ -71,7 +73,10 @@
 		
 		_printf_(VerboseSolution(),"%s\n","   computing velocities");
 		femmodel->SetCurrentConfiguration(DiagnosticHorizAnalysisEnum);
-		solver_nonlinear(femmodel,modify_loads); 
+		if(isnewton)
+		 solver_newton(femmodel); 
+		else
+		 solver_nonlinear(femmodel,conserve_loads); 
 	}
 
 	if (ismacayealpattyn && isstokes){

Modified: issm/trunk/src/c/solutions/enthalpy_core.cpp
===================================================================
--- issm/trunk/src/c/solutions/enthalpy_core.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/enthalpy_core.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -45,8 +45,7 @@
 		time=(i+1)*dt;
 
 		/*call enthalpy_core_step: */
-		femmodel->SetCurrentConfiguration(EnthalpyAnalysisEnum);
-		solver_linear(femmodel);
+		enthalpy_core_step(femmodel,i,time);
 
 		if(solution_type==EnthalpySolutionEnum && !control_analysis){
 			_printf_(VerboseSolution(),"   saving results\n");

Copied: issm/trunk/src/c/solutions/enthalpy_core_step.cpp (from rev 11526, issm/trunk-jpl/src/c/solutions/enthalpy_core_step.cpp)
===================================================================
--- issm/trunk/src/c/solutions/enthalpy_core_step.cpp	                        (rev 0)
+++ issm/trunk/src/c/solutions/enthalpy_core_step.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,26 @@
+/*!\file: enthalpy_core_step.cpp
+ * \brief: core of the enthalpy solution 
+ */ 
+
+#include "../toolkits/toolkits.h"
+#include "../objects/objects.h"
+#include "../shared/shared.h"
+#include "../io/io.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "./solutions.h"
+#include "../modules/modules.h"
+#include "../include/include.h"
+#include "../solvers/solvers.h"
+
+void enthalpy_core_step(FemModel* femmodel,int step, double time){
+	
+	bool modify_loads=true;
+
+	_printf_(VerboseSolution(),"   computing enthalpy\n");
+	femmodel->SetCurrentConfiguration(EnthalpyAnalysisEnum);
+	solver_nonlinear(femmodel,modify_loads);
+
+	/*transfer enthalpy to enthalpy picard for the next step: */
+	InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnthalpyEnum,EnthalpyPicardEnum);
+
+}

Modified: issm/trunk/src/c/solutions/gradient_core.cpp
===================================================================
--- issm/trunk/src/c/solutions/gradient_core.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/gradient_core.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -12,60 +12,40 @@
 #include "../include/include.h"
 #include "../solvers/solvers.h"
 
+void gradient_core(FemModel* femmodel,int step,bool orthogonalize){ 
 
-void gradient_core(FemModel* femmodel,int step, double search_scalar){ //step defaults to 0, search_scalar defaults to 0
-	
-	/*parameters: */
-	bool    control_steady;
-	int     num_controls;
-	int    *control_type   = NULL;
-	double *optscal_list   = NULL;
-	double  optscal,norm_grad;
-
 	/*Intermediaries*/
-	Vec new_gradient=NULL;
-	Vec gradient=NULL;
-	Vec old_gradient=NULL;
+	double  norm_inf;
+	double *norm_list    = NULL;
+	Vec     new_gradient = NULL;
+	Vec     gradient     = NULL;
+	Vec     old_gradient = NULL;
 
-	/*retrieve parameters:*/
-	femmodel->parameters->FindParam(&control_steady,ControlSteadyEnum);
-	femmodel->parameters->FindParam(&num_controls,InversionNumControlParametersEnum);
-	femmodel->parameters->FindParam(&control_type,NULL,InversionControlParametersEnum);
-	femmodel->parameters->FindParam(&optscal_list,NULL,NULL,InversionGradientScalingEnum);
+	/*Compute gradient*/
+	_printf_(VerboseControl(),"   compute cost function gradient\n");
+	Gradjx(&gradient,&norm_list,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters);
 
-	/*Compute and norm gradient of all controls*/
-	for (int i=0;i<num_controls;i++){
+	if (orthogonalize){
+		_printf_(VerboseControl(),"   orthogonalization\n");
+		ControlInputGetGradientx(&old_gradient,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters);
+		Orthx(&new_gradient,gradient,old_gradient); VecFree(&old_gradient); VecFree(&gradient);
+	}
+	else{ 
+		new_gradient=gradient;
+	}
 
-		_printf_(VerboseControl(),"   compute gradient of J with respect to %s\n",EnumToStringx(control_type[i]));
-		Gradjx(&gradient, femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters, control_type[i]);
+	/*Check that gradient is clean*/
+	VecNorm(new_gradient,NORM_INFINITY,&norm_inf);
+	if(norm_inf<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm is zero");
+	if(isnan(norm_inf))_error_("||∂J/∂α||∞ = NaN  gradient norm is NaN");
 
-		if(control_steady)diagnostic_core(femmodel);
+	/*plug back into inputs: */
+	ControlInputSetGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,new_gradient);
+	VecFree(&new_gradient);
 
-		if (step>0 && search_scalar==0){
-			_printf_(VerboseControl(),"   orthogonalization\n");
-			ControlInputGetGradientx(&old_gradient,femmodel->elements,femmodel->nodes, femmodel->vertices,femmodel->loads, femmodel->materials,femmodel->parameters,control_type[i]);
-			Orthx(&new_gradient,gradient,old_gradient); VecFree(&old_gradient); VecFree(&gradient);
-		}
-		else{ 
-			_printf_(VerboseControl(),"   normalizing directions\n");
-			Orthx(&new_gradient,gradient,NULL); VecFree(&gradient);
-		}
-
-		/*Get scaling factor of current control:*/
-		VecNorm(new_gradient,NORM_INFINITY,&norm_grad);
-		if(norm_grad<=0)    _error_("||∂J/∂α||∞ = 0    gradient norm of J with respect to %s is zero",EnumToStringx(control_type[i]));
-		if(isnan(norm_grad))_error_("||∂J/∂α||∞ = NaN  gradient norm of J with respect to %s is NaN" ,EnumToStringx(control_type[i]));
-		if(i==0 || (optscal_list[num_controls*step+i]/norm_grad)<optscal) optscal=optscal_list[num_controls*step+i]/norm_grad;
-
-		/*plug back into inputs: */
-		ControlInputSetGradientx(femmodel-> elements,femmodel-> nodes, femmodel-> vertices,femmodel-> loads, femmodel-> materials,  femmodel->parameters,control_type[i],new_gradient);
-		VecFree(&new_gradient);
-	}
-
 	/*Scale Gradients*/
-	for (int i=0;i<num_controls;i++) ControlInputScaleGradientx(femmodel-> elements,femmodel-> nodes, femmodel-> vertices,femmodel-> loads, femmodel-> materials,  femmodel->parameters,control_type[i],optscal);
+	ControlInputScaleGradientx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,norm_list,step);
 
 	/*Clean up and return*/
-	xfree((void**)&control_type);
-	xfree((void**)&optscal_list);
+	xfree((void**)&norm_list);
 }

Modified: issm/trunk/src/c/solutions/issm.cpp
===================================================================
--- issm/trunk/src/c/solutions/issm.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/issm.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -15,8 +15,7 @@
 	FILE *output_fid       = NULL;
 	FILE *petscoptionsfid  = NULL;
 	bool  waitonlock       = false;
-	bool  dakota_analysis;
-	bool  control_analysis; 
+	bool  dakota_analysis,control_analysis,tao_analysis;
 
 	/*FemModel: */
 	FemModel *femmodel = NULL;
@@ -80,10 +79,9 @@
 	femmodel->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum);
 	femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
 	femmodel->parameters->FindParam(&control_analysis,InversionIscontrolEnum);
+	femmodel->parameters->FindParam(&tao_analysis,InversionTaoEnum);
 	MPI_Barrier(MPI_COMM_WORLD); finish_init=MPI_Wtime();
 
-	/*are we running the solution sequence, or a qmu wrapper around it? : */
-
 	_printf_(true,"call computational core:\n");
 	MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( );
 	if(dakota_analysis){
@@ -95,7 +93,10 @@
 	}
 	else if(control_analysis){
 		#ifdef _HAVE_CONTROL_
-		control_core(femmodel);
+		if(tao_analysis)
+		 controltao_core(femmodel);
+		else
+		 control_core(femmodel);
 		#else
 		_error_("ISSM was not compiled with control support, cannot carry out dakota analysis!");
 		#endif

Modified: issm/trunk/src/c/solutions/solutions.h
===================================================================
--- issm/trunk/src/c/solutions/solutions.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/solutions.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -14,13 +14,14 @@
 /*cores: */
 void adjointdiagnostic_core(FemModel* femmodel);
 void adjointbalancethickness_core(FemModel* femmodel);
-void gradient_core(FemModel* femmodel,int step=0, double search_scalar=0);
+void gradient_core(FemModel* femmodel,int n=0,bool orthogonalize=false);
 void diagnostic_core(FemModel* femmodel);
 void hydrology_core(FemModel* femmodel);
 void hydrology_core_step(FemModel* femmodel,int step, double time);
 void thermal_core(FemModel* femmodel);
 void thermal_core_step(FemModel* femmodel,int step, double time);
 void enthalpy_core(FemModel* femmodel);
+void enthalpy_core_step(FemModel* femmodel,int step, double time);
 void surfaceslope_core(FemModel* femmodel);
 void bedslope_core(FemModel* femmodel);
 void control_core(FemModel* femmodel);
@@ -33,7 +34,7 @@
 double objectivefunctionC(double search_scalar,OptArgs* optargs);
 
 //convergence:
-void convergence(int* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,Parameters* parameters);
+void convergence(bool* pconverged, Mat K_ff,Vec p_f,Vec u_f,Vec u_f_old,Parameters* parameters);
 bool controlconvergence(double J,double tol_cm);
 bool steadystateconvergence(FemModel* femmodel);
 

Modified: issm/trunk/src/c/solutions/transient_core.cpp
===================================================================
--- issm/trunk/src/c/solutions/transient_core.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solutions/transient_core.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,7 +23,7 @@
 
 	/*parameters: */
 	double finaltime,dt,yts;
-	bool   control_analysis,isdiagnostic,isprognostic,isthermal,isgroundingline;
+	bool   control_analysis,isdiagnostic,isprognostic,isthermal,isgroundingline,isenthalpy;
 	bool   dakota_analysis=false;
 	bool   time_adapt=false;
 	int    solution_type;
@@ -50,6 +50,7 @@
 	femmodel->parameters->FindParam(&isprognostic,TransientIsprognosticEnum);
 	femmodel->parameters->FindParam(&isthermal,TransientIsthermalEnum);
 	femmodel->parameters->FindParam(&isgroundingline,TransientIsgroundinglineEnum);
+	femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum);
 	if(isgroundingline) femmodel->parameters->FindParam(&groundingline_migration,GroundinglineMigrationEnum);
 	femmodel->parameters->FindParam(&numoutputs,TransientNumRequestedOutputsEnum);
 	if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,TransientRequestedOutputsEnum);
@@ -90,7 +91,12 @@
 		if(isthermal && dim==3){
 			_printf_(VerboseSolution(),"   computing temperatures:\n");
 			#ifdef _HAVE_THERMAL_
-			thermal_core_step(femmodel,step,time);
+			if(isenthalpy==0){
+				thermal_core_step(femmodel,step,time);
+			}
+			else{
+				enthalpy_core_step(femmodel,step,time);
+			}
 			#else
 			_error_("ISSM was not compiled with thermal capabilities. Exiting");
 			#endif
@@ -124,6 +130,7 @@
 		//save should be done by the analysis... see control_core
 		if(solution_type==TransientSolutionEnum && !control_analysis && (step%output_frequency==0 || time==finaltime)){
 			_printf_(VerboseSolution(),"   saving results\n");
+			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzMeshEnum,step,time);
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,step,time);
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,step,time);
 			if(dim==3) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,step,time);
@@ -133,7 +140,9 @@
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceEnum,step,time);
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BedEnum,step,time);
 			if(dim==3 && isthermal) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,step,time);
-			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum,step,time);
+			if(isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,WaterfractionEnum,step,time);
+			if(isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,EnthalpyEnum,step,time);
+			if(!isenthalpy) InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,BasalforcingsMeltingRateEnum,step,time);
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,SurfaceforcingsMassBalanceEnum,step,time);
 			InputToResultx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,MaskElementonfloatingiceEnum,step,time);
 			RequestedOutputsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,requested_outputs,numoutputs,step,time);

Copied: issm/trunk/src/c/solvers/solver_newton.cpp (from rev 11526, issm/trunk-jpl/src/c/solvers/solver_newton.cpp)
===================================================================
--- issm/trunk/src/c/solvers/solver_newton.cpp	                        (rev 0)
+++ issm/trunk/src/c/solvers/solver_newton.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,95 @@
+/*!\file: solver_nonlinear.cpp
+ * \brief: core of a non-linear solution, using fixed-point method 
+ */ 
+
+#include "../toolkits/toolkits.h"
+#include "../objects/objects.h"
+#include "../io/io.h"
+#include "../EnumDefinitions/EnumDefinitions.h"
+#include "../modules/modules.h"
+#include "../solutions/solutions.h"
+#include "./solvers.h"
+
+void solver_newton(FemModel* femmodel){
+
+	/*intermediary: */
+	bool   converged;
+	int    num_unstable_constraints;
+	int    count;
+	double kmax;
+	Mat Kff = NULL, Kfs    = NULL, Jff = NULL;
+	Vec ug  = NULL, old_ug = NULL;
+	Vec uf  = NULL, old_uf = NULL, duf = NULL;
+	Vec pf  = NULL, pJf    = NULL;
+	Vec df  = NULL;
+	Vec ys  = NULL;
+
+	/*parameters:*/
+	int max_nonlinear_iterations;
+	int  configuration_type;
+
+	/*Recover parameters: */
+	femmodel->parameters->FindParam(&max_nonlinear_iterations,DiagnosticMaxiterEnum);
+	femmodel->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
+	UpdateConstraintsx(femmodel->nodes,femmodel->constraints,femmodel->parameters);
+
+	count=1;
+	converged=false;
+
+	/*Start non-linear iteration using input velocity: */
+	GetSolutionFromInputsx(&ug,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+	Reducevectorgtofx(&uf,ug,femmodel->nodes,femmodel->parameters);
+
+	//Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
+	InputUpdateFromConstantx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,converged,ConvergedEnum);
+	InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug);
+
+	for(;;){
+
+		VecFree(&old_ug);old_ug=ug;
+		VecFree(&old_uf);old_uf=uf;
+
+		/*Solver forward model*/
+		SystemMatricesx(&Kff,&Kfs,&pf,&df,NULL,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		Reduceloadx(pf,Kfs,ys);MatFree(&Kfs);
+		Solverx(&uf,Kff,pf,old_uf,df,femmodel->parameters);VecFree(&df);
+		Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters);VecFree(&ys);
+		InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug);VecFree(&ug);
+
+		/*Check convergence*/
+		convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters); 
+		MatFree(&Kff);VecFree(&pf);
+		if(converged==true) break;
+		if(count>=max_nonlinear_iterations){
+			_printf_(true,"   maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations); 
+			break;
+		}
+
+		/*Prepare next iteration using Newton's method*/
+		SystemMatricesx(&Kff,&Kfs,&pf,NULL,&kmax,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
+		CreateNodalConstraintsx(&ys,femmodel->nodes,configuration_type);
+		Reduceloadx(pf,Kfs,ys);   MatFree(&Kfs);
+
+		VecDuplicate(pf,&pJf);
+		MatMultPatch(Kff,uf,pJf); MatFree(&Kff);
+		VecScale(pJf,-1.);
+		VecAXPY(pJf,+1.,pf);      VecFree(&pf);
+
+		CreateJacobianMatrixx(&Jff,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,kmax);
+		Solverx(&duf,Jff,pJf,NULL,NULL,femmodel->parameters); MatFree(&Jff);VecFree(&pJf);
+		VecAXPY(uf,1.,duf);      VecFree(&duf);
+		Mergesolutionfromftogx(&ug,uf,ys,femmodel->nodes,femmodel->parameters);VecFree(&ys);
+		InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ug);
+
+		count++;
+	}
+
+	_printf_(VerboseConvergence(),"\n   total number of iterations: %i\n",count-1);
+
+	/*clean-up*/
+	VecFree(&uf);
+	VecFree(&ug);
+	VecFree(&old_ug);
+	VecFree(&old_uf);
+}

Modified: issm/trunk/src/c/solvers/solver_nonlinear.cpp
===================================================================
--- issm/trunk/src/c/solvers/solver_nonlinear.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solvers/solver_nonlinear.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -21,7 +21,7 @@
 	Vec ys  = NULL;
 	
 	Loads* loads=NULL;
-	int converged;
+	bool converged;
 	int constraints_converged;
 	int num_unstable_constraints;
 	int count;
@@ -42,13 +42,14 @@
 	else               loads=(Loads*)femmodel->loads;         //modify loads  in this solution
 
 	count=1;
-	converged=0;
+	converged=false;
 
 	/*Start non-linear iteration using input velocity: */
 	GetSolutionFromInputsx(&ug, femmodel->elements, femmodel->nodes, femmodel->vertices, loads, femmodel->materials, femmodel->parameters);
 	Reducevectorgtofx(&uf, ug, femmodel->nodes,femmodel->parameters);
 
 	//Update once again the solution to make sure that vx and vxold are similar (for next step in transient or steadystate)
+	InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
 	InputUpdateFromSolutionx(femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
 
 	for(;;){
@@ -62,31 +63,36 @@
 		Reduceloadx(pf, Kfs, ys); MatFree(&Kfs);
 		Solverx(&uf, Kff, pf, old_uf, df, femmodel->parameters);
 		Mergesolutionfromftogx(&ug, uf,ys,femmodel->nodes,femmodel->parameters);VecFree(&ys);
+
+		convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters); MatFree(&Kff);VecFree(&pf); VecFree(&df);
+		InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
 		InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
 
 		ConstraintsStatex(&constraints_converged, &num_unstable_constraints, femmodel->elements,femmodel->nodes,femmodel->vertices,loads,femmodel->materials,femmodel->parameters);
 		_printf_(VerboseConvergence(),"   number of unstable constraints: %i\n",num_unstable_constraints);
 
-		convergence(&converged,Kff,pf,uf,old_uf,femmodel->parameters); MatFree(&Kff);VecFree(&pf); VecFree(&df);
-		InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
-
 		//rift convergence
 		if (!constraints_converged) {
 			if (converged){
-				if (num_unstable_constraints <= min_mechanical_constraints) converged=1;
-				else converged=0;
+				if (num_unstable_constraints <= min_mechanical_constraints) converged=true;
+				else converged=false;
 			}
 		}
 
 		/*Increase count: */
 		count++;
-		if(converged==1)break;
+		if(converged==true)break;
 		if(count>=max_nonlinear_iterations){
 			_printf_(true,"   maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations); 
+			converged=true;
+		InputUpdateFromConstantx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,converged,ConvergedEnum);
+		InputUpdateFromSolutionx( femmodel->elements,femmodel->nodes, femmodel->vertices, femmodel->loads, femmodel->materials, femmodel->parameters,ug);
 			break;
 		}
 	}
 
+	_printf_(VerboseConvergence(),"\n   total number of iterations: %i\n",count-1);
+
 	/*clean-up*/
 	if(conserve_loads) delete loads;
 	VecFree(&uf);

Modified: issm/trunk/src/c/solvers/solver_stokescoupling_nonlinear.cpp
===================================================================
--- issm/trunk/src/c/solvers/solver_stokescoupling_nonlinear.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solvers/solver_stokescoupling_nonlinear.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -13,24 +13,24 @@
 void solver_stokescoupling_nonlinear(FemModel* femmodel,bool conserve_loads){
 
 	/*intermediary: */
-	Mat Kff_horiz = NULL, Kfs_horiz   = NULL;
-	Vec ug_horiz  = NULL, uf_horiz  = NULL, old_uf_horiz = NULL;
-	Vec pf_horiz  = NULL;
-	Vec df_horiz  = NULL;
-	Mat Kff_vert  = NULL, Kfs_vert    = NULL;
-	Vec ug_vert   = NULL, uf_vert   = NULL;
-	Vec pf_vert   = NULL;
-	Vec df_vert   = NULL;
-	Vec ys   = NULL;
-	int converged;
-	int constraints_converged;
-	int num_unstable_constraints;
-	int count;
+	Mat  Kff_horiz = NULL, Kfs_horiz   = NULL;
+	Vec  ug_horiz  = NULL, uf_horiz  = NULL, old_uf_horiz = NULL;
+	Vec  pf_horiz  = NULL;
+	Vec  df_horiz  = NULL;
+	Mat  Kff_vert  = NULL, Kfs_vert    = NULL;
+	Vec  ug_vert   = NULL, uf_vert   = NULL;
+	Vec  pf_vert   = NULL;
+	Vec  df_vert   = NULL;
+	Vec  ys   = NULL;
+	bool converged;
+	int  constraints_converged;
+	int  num_unstable_constraints;
+	int  count;
 
 	/*parameters:*/
-	int min_mechanical_constraints;
-	int max_nonlinear_iterations;
-	int configuration_type;
+	int  min_mechanical_constraints;
+	int  max_nonlinear_iterations;
+	int  configuration_type;
 
 	/*Recover parameters: */
 	femmodel->parameters->FindParam(&min_mechanical_constraints,DiagnosticRiftPenaltyThresholdEnum);
@@ -38,7 +38,7 @@
 	UpdateConstraintsx(femmodel->nodes,femmodel->constraints,femmodel->parameters);
 	
 	count=1;
-	converged=0;
+	converged=false;
 
 	/*First get ug_horiz:*/
 	femmodel->SetCurrentConfiguration(DiagnosticHorizAnalysisEnum);
@@ -83,7 +83,7 @@
 
 		/*Increase count: */
 		count++;
-		if(converged==1)break;
+		if(converged==true)break;
 		if(count>=max_nonlinear_iterations){
 			_printf_(true,"   maximum number of iterations (%i) exceeded\n",max_nonlinear_iterations); 
 			break;

Modified: issm/trunk/src/c/solvers/solvers.h
===================================================================
--- issm/trunk/src/c/solvers/solvers.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/solvers/solvers.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -13,6 +13,7 @@
 
 void solver_thermal_nonlinear(FemModel* femmodel);
 void solver_nonlinear(FemModel* femmodel,bool conserve_loads);
+void solver_newton(FemModel* femmodel);
 void solver_stokescoupling_nonlinear(FemModel* femmodel,bool conserve_loads);
 void solver_linear(FemModel* femmodel);
 void solver_adjoint_linear(FemModel* femmodel);

Modified: issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
===================================================================
--- issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -48,6 +48,18 @@
 	if (strcmp(option,"superlu_dist")==0){
 		solver_type=SUPERLUDISTPACKAGE;
 	}
+	if (strcmp(option,"")==0){
+		solver_type=SUPERLUDISTPACKAGE;
+	}
+
+
+	#if _PETSC_MAJOR_ >= 3 
+	PetscOptionsGetString(PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag);
+	if (strcmp(option,"mumps")==0){
+		solver_type=MUMPSPACKAGE_LU;
+	}
+	#endif
+
 	
 	PetscOptionsGetString(PETSC_NULL,"-issm_option_solver",&option[0],100,&flag);
 	if (strcmp(option,"stokes")==0){

Modified: issm/trunk/src/dox/issm.dox
===================================================================
--- issm/trunk/src/dox/issm.dox	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/dox/issm.dox	2012-02-24 16:12:47 UTC (rev 11527)
@@ -45,22 +45,22 @@
 <th  bgcolor=#7AA9DD style="text-align:left;">Language</th><th  bgcolor=#7AA9DD style="text-align:right;">files</th><th  bgcolor=#7AA9DD style="text-align:right;">blank</th><th  bgcolor=#7AA9DD style="text-align:right;">comment</th><th  bgcolor=#7AA9DD style="text-align:right;">code</th><th  bgcolor=#7AA9DD style="text-align:right;">Total</th>
 </th>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> C++ </th><td  bgcolor=#FFFFFF style="text-align:right;">533</td><td  bgcolor=#FFFFFF style="text-align:right;">15543</td><td  bgcolor=#FFFFFF style="text-align:right;">17244</td><td  bgcolor=#FFFFFF style="text-align:right;">57848</td><td  bgcolor=#FFFFFF style="text-align:right;">90635</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> C++ </th><td  bgcolor=#FFFFFF style="text-align:right;">533</td><td  bgcolor=#FFFFFF style="text-align:right;">15491</td><td  bgcolor=#FFFFFF style="text-align:right;">17275</td><td  bgcolor=#FFFFFF style="text-align:right;">58005</td><td  bgcolor=#FFFFFF style="text-align:right;">90771</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> MATLAB </th><td  bgcolor=#C6E2FF style="text-align:right;">970</td><td  bgcolor=#C6E2FF style="text-align:right;">7187</td><td  bgcolor=#C6E2FF style="text-align:right;">13630</td><td  bgcolor=#C6E2FF style="text-align:right;">31601</td><td  bgcolor=#C6E2FF style="text-align:right;">52418</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> MATLAB </th><td  bgcolor=#C6E2FF style="text-align:right;">977</td><td  bgcolor=#C6E2FF style="text-align:right;">7199</td><td  bgcolor=#C6E2FF style="text-align:right;">13702</td><td  bgcolor=#C6E2FF style="text-align:right;">31690</td><td  bgcolor=#C6E2FF style="text-align:right;">52591</td>
 </tr>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> C/C++  Header </th><td  bgcolor=#FFFFFF style="text-align:right;">399</td><td  bgcolor=#FFFFFF style="text-align:right;">3064</td><td  bgcolor=#FFFFFF style="text-align:right;">2726</td><td  bgcolor=#FFFFFF style="text-align:right;">10343</td><td  bgcolor=#FFFFFF style="text-align:right;">16133</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> C/C++  Header </th><td  bgcolor=#FFFFFF style="text-align:right;">399</td><td  bgcolor=#FFFFFF style="text-align:right;">3069</td><td  bgcolor=#FFFFFF style="text-align:right;">2727</td><td  bgcolor=#FFFFFF style="text-align:right;">10358</td><td  bgcolor=#FFFFFF style="text-align:right;">16154</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> m4 </th><td  bgcolor=#C6E2FF style="text-align:right;">2</td><td  bgcolor=#C6E2FF style="text-align:right;">238</td><td  bgcolor=#C6E2FF style="text-align:right;">163</td><td  bgcolor=#C6E2FF style="text-align:right;">1871</td><td  bgcolor=#C6E2FF style="text-align:right;">2272</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> m4 </th><td  bgcolor=#C6E2FF style="text-align:right;">7</td><td  bgcolor=#C6E2FF style="text-align:right;">1061</td><td  bgcolor=#C6E2FF style="text-align:right;">242</td><td  bgcolor=#C6E2FF style="text-align:right;">8941</td><td  bgcolor=#C6E2FF style="text-align:right;">10244</td>
 </tr>
 <tr>
 <th  bgcolor=#FFFFFF style="text-align:left;"> Objective  C </th><td  bgcolor=#FFFFFF style="text-align:right;">9</td><td  bgcolor=#FFFFFF style="text-align:right;">98</td><td  bgcolor=#FFFFFF style="text-align:right;">0</td><td  bgcolor=#FFFFFF style="text-align:right;">370</td><td  bgcolor=#FFFFFF style="text-align:right;">468</td>
 </tr>
 <tr>
-<th  bgcolor=#C6E2FF style="text-align:left;"> Bourne  Shell </th><td  bgcolor=#C6E2FF style="text-align:right;">8</td><td  bgcolor=#C6E2FF style="text-align:right;">59</td><td  bgcolor=#C6E2FF style="text-align:right;">98</td><td  bgcolor=#C6E2FF style="text-align:right;">262</td><td  bgcolor=#C6E2FF style="text-align:right;">419</td>
+<th  bgcolor=#C6E2FF style="text-align:left;"> Bourne  Shell </th><td  bgcolor=#C6E2FF style="text-align:right;">8</td><td  bgcolor=#C6E2FF style="text-align:right;">61</td><td  bgcolor=#C6E2FF style="text-align:right;">98</td><td  bgcolor=#C6E2FF style="text-align:right;">271</td><td  bgcolor=#C6E2FF style="text-align:right;">430</td>
 </tr>
 <tr>
 <th  bgcolor=#FFFFFF style="text-align:left;"> Perl </th><td  bgcolor=#FFFFFF style="text-align:right;">3</td><td  bgcolor=#FFFFFF style="text-align:right;">21</td><td  bgcolor=#FFFFFF style="text-align:right;">23</td><td  bgcolor=#FFFFFF style="text-align:right;">240</td><td  bgcolor=#FFFFFF style="text-align:right;">284</td>
@@ -75,12 +75,9 @@
 <th  bgcolor=#C6E2FF style="text-align:left;"> Python </th><td  bgcolor=#C6E2FF style="text-align:right;">2</td><td  bgcolor=#C6E2FF style="text-align:right;">1</td><td  bgcolor=#C6E2FF style="text-align:right;">4</td><td  bgcolor=#C6E2FF style="text-align:right;">13</td><td  bgcolor=#C6E2FF style="text-align:right;">18</td>
 </tr>
 <tr>
-<th  bgcolor=#FFFFFF style="text-align:left;"> SUM: </th><td  bgcolor=#FFFFFF style="text-align:right;">1929</td><td  bgcolor=#FFFFFF style="text-align:right;">26232</td><td  bgcolor=#FFFFFF style="text-align:right;">33895</td><td  bgcolor=#FFFFFF style="text-align:right;">102696</td><td  bgcolor=#FFFFFF style="text-align:right;">162823</td>
+<th  bgcolor=#FFFFFF style="text-align:left;"> SUM: </th><td  bgcolor=#FFFFFF style="text-align:right;">1941</td><td  bgcolor=#FFFFFF style="text-align:right;">27022</td><td  bgcolor=#FFFFFF style="text-align:right;">34078</td><td  bgcolor=#FFFFFF style="text-align:right;">110036</td><td  bgcolor=#FFFFFF style="text-align:right;">171136</td>
 </tr>
 </table>
 
-
-
-
-	<I> Copyright (C) 2011 </I>
+	<I> Copyright (C) 2012 </I>
   */


Property changes on: issm/trunk/src/m
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/Makefile.am)
===================================================================
--- issm/trunk/src/m/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+SUBDIRS = classes enum kml model planet qmu shared solutions solvers utils


Property changes on: issm/trunk/src/m/classes
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile



Property changes on: issm/trunk/src/m/classes/@modellist
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/classes/@modellist/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/classes/@modellist/Makefile.am)
===================================================================
--- issm/trunk/src/m/classes/@modellist/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/classes/@modellist/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,2 @@
+classesdir=$(bindir)/@modellist
+classes_DATA=*.m


Property changes on: issm/trunk/src/m/classes/@pairoptions
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/classes/@pairoptions/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/classes/@pairoptions/Makefile.am)
===================================================================
--- issm/trunk/src/m/classes/@pairoptions/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/classes/@pairoptions/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,2 @@
+classesdir=$(bindir)/@pairoptions
+classes_DATA=*.m

Copied: issm/trunk/src/m/classes/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/classes/Makefile.am)
===================================================================
--- issm/trunk/src/m/classes/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/classes/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,2 @@
+SUBDIRS = @pairoptions @modellist model clusters
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/classes/clusters
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/classes/clusters/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/classes/clusters/Makefile.am)
===================================================================
--- issm/trunk/src/m/classes/clusters/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/classes/clusters/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/classes/clusters/castor.m
===================================================================
--- issm/trunk/src/m/classes/clusters/castor.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/clusters/castor.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,13 +9,13 @@
     properties (SetAccess=public) 
 		 % {{{1
 		 name='castor'
-		 login='larour';
-		 np   =128; %number of processors
+		 login='username';
+		 np   =128;
 		 port=0;
 		 queue='shortc';
 		 time=180;
-		 codepath='/workp/edw/larour/issm-2.0/bin'
-		 executionpath='/workp/edw/larour/Testing/Execution'
+		 codepath='/workp/edw/issm-2.0/bin'
+		 executionpath='/workp/edw/Testing/Execution'
 		 %}}}
 	 end
 	 methods

Modified: issm/trunk/src/m/classes/clusters/cosmos.m
===================================================================
--- issm/trunk/src/m/classes/clusters/cosmos.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/clusters/cosmos.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,13 +9,13 @@
     properties (SetAccess=public) 
 		 % {{{1
 		 name='cosmos'
-		 login='larour';
+		 login='username';
 		 np=128;
 		 port=0;
 		 queue='shortq';
 		 time=3*60;
-		 codepath='/work00/edw/larour/issm-2.0/bin';
-		 executionpath='/work00/edw/larour/Execution';
+		 codepath='/work00/edw/issm-2.0/bin';
+		 executionpath='/work00/edw/Execution';
 		 %}}}
 	 end
 	 methods

Modified: issm/trunk/src/m/classes/clusters/gemini.m
===================================================================
--- issm/trunk/src/m/classes/clusters/gemini.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/clusters/gemini.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,13 +9,13 @@
     properties (SetAccess=public) 
 	% {{{1
 		name='gemini'
-		login='larour';
+		login='username';
 		np=50;
 		port=0;
 		queue='debug';
 		time=60;
-		codepath='/workg/edw/larour/issm-2.0/bin'
-		executionpath='/workg/edw/larour/Testing/Execution'
+		codepath='/workg/edw/issm-2.0/bin'
+		executionpath='/workg/edw/Testing/Execution'
 	%}}}
     end
     methods

Modified: issm/trunk/src/m/classes/clusters/generic.m
===================================================================
--- issm/trunk/src/m/classes/clusters/generic.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/clusters/generic.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -77,33 +77,65 @@
 			 isgprof=md.debug.gprof;
 
 			 %open file for writing: 
-			 fid=fopen([modelname '.queue'],'w');
+			 if ~ispc,
+				 fid=fopen([modelname '.queue'],'w');
+			 else
+				 fid=fopen([modelname '.bat'],'w');
+			 end
 
 			 %write instructions for launching a job on the cluster
-			 fprintf(fid,'#!/bin/sh\n');
+			 if ~ispc,
+				 fprintf(fid,'#!/bin/sh\n');
+			 else
+				 fprintf(fid,'@echo off\n');
+			 end
+			 
 			 if ~isvalgrind,
 				 if cluster.interactive
-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',...
-						 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+					 if ~ispc,
+						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+					 else
+						 fprintf(fid,'"%s/issm.exe" %s "%s" %s ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+					 end
 				 else
-					 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
-						 cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					 if ~ispc,
+						 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					 else
+						 fprintf(fid,'"%s/issm.exe" %s "%s" %s 2> %s.errlog >%s.outlog ',cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+					 end
 				 end
 			 else
-				 %Add --gen-suppressions=all to get suppression lines
-				 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
-				 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
+				 if ~ispc,
+					 %Add --gen-suppressions=all to get suppression lines
+					 fprintf(fid,'LD_PRELOAD=%s \\\n',cluster.valgrindlib);
+					 fprintf(fid,'mpiexec -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s 2> %s.errlog >%s.outlog ',...
 					 cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(solution),cluster.executionpath,modelname,modelname,modelname);
+				 else
+					 error('valgrind not supported on windows platforms');
+				 end
 			 end
 
 			 if isgprof,
-				 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				 if ~ispc,
+					 fprintf(fid,'\n gprof %s/issm.exe gmon.out > %s.performance',cluster.codepath,modelname);
+				 else
+					 error('gprof not supported on windows platforms');
+				 end
+
 			 end
 
 			 if ~md.settings.io_gather,
-				 %concatenate the output files:
-				 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+				 if ~ispc,
+					 %concatenate the output files:
+					 fprintf(fid,'\ncat %s.outbin.* > %s.outbin',modelname,modelname);
+				 else
+					 error('iogather not supported on windows platforms');
+				 end
+
 			 end
+			 
+			 %close file: 
+			 fclose(fid);
 
 			 %in interactive mode, create a run file, and errlog and outlog file
 			 if cluster.interactive,
@@ -111,63 +143,73 @@
 				 fid=fopen([modelname '.outlog'],'w'); fclose(fid);
 			 end
 
+
 		 end
 		 %}}}
 		 function LaunchQueueJob(cluster,md,options)% {{{1
 			 
-			 %lauch command, to be executed via ssh
-			 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
-			                ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && source  ' md.miscellaneous.name '.queue '];
+			 if ~ispc,
+					 %lauch command, to be executed via ssh
+					 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
+					 ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && source  ' md.miscellaneous.name '.queue '];
 
-			if ~strcmpi(options.batch,'yes'),
-				
-				%compress the files into one zip.
-				compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
-				if md.qmu.isdakota,
-					compressstring=[compressstring md.miscellaneous.name '.qmu.in'];
+					 if ~strcmpi(options.batch,'yes'),
+
+						 %compress the files into one zip.
+						 compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
+						 if md.qmu.isdakota,
+							 compressstring=[compressstring md.miscellaneous.name '.qmu.in'];
+					end
+					if cluster.interactive,
+						compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
+					end
+					system(compressstring);
+
+					disp('uploading input file and queueing script');
+					issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
+
+					disp('launching solution sequence on remote cluster');
+					issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+				else
+					disp('batch mode requested: not launching job interactively');
+					disp('launch solution sequence on remote cluster by hand');
 				end
-				if cluster.interactive,
-					compressstring=[compressstring ' ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
-				end
-				system(compressstring);
-				
-				disp('uploading input file and queueing script');
-				issmscpout(cluster.name,cluster.executionpath,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
-
-				disp('launching solution sequence on remote cluster');
-				issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
 			else
-				disp('batch mode requested: not launching job interactively');
-				disp('launch solution sequence on remote cluster by hand');
+				%launch right here, do not compress or archive.
+				system([md.miscellaneous.name '.bat']);
 			end
 
-		 end %}}}
+		end %}}}
 		 function Download(cluster,md)% {{{1
 
-			%some check
-			if isempty(md.private.runtimename),
-				error('supply runtime name for results to be loaded!');
-			end
+			if ~ispc,
+				%some check
+				if isempty(md.private.runtimename),
+					error('supply runtime name for results to be loaded!');
+				end
 
-			%Figure out the  directory where all the files are in: 
-			directory=[cluster.executionpath '/' md.private.runtimename '/'];
+				%Figure out the  directory where all the files are in: 
+				directory=[cluster.executionpath '/' md.private.runtimename '/'];
 
-			%What packages are we picking up from remote cluster
-			packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
-			if md.qmu.isdakota,
-				packages{end+1}=[md.miscellaneous.name '.qmu.err'];
-				packages{end+1}=[md.miscellaneous.name '.qmu.out'];
-				if isfield(md.qmu.params,'tabular_graphics_data'),
-					if md.qmu.params.tabular_graphics_data==true,
-						packages{end+1}='dakota_tabular.dat'; 
+				%What packages are we picking up from remote cluster
+				packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
+				if md.qmu.isdakota,
+					packages{end+1}=[md.miscellaneous.name '.qmu.err'];
+					packages{end+1}=[md.miscellaneous.name '.qmu.out'];
+					if isfield(md.qmu.params,'tabular_graphics_data'),
+						if md.qmu.params.tabular_graphics_data==true,
+							packages{end+1}='dakota_tabular.dat'; 
+						end
 					end
+				else
+					packages{end+1}=[md.miscellaneous.name '.outbin'];
 				end
+
+				%copy files from cluster to present directory
+				issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
 			else
-				packages{end+1}=[md.miscellaneous.name '.outbin'];
+				%do nothing!
 			end
-
-			%copy files from cluster to present directory
-			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
 		end %}}}
 	end
 end

Copied: issm/trunk/src/m/classes/clusters/greenplanet.m (from rev 11526, issm/trunk-jpl/src/m/classes/clusters/greenplanet.m)
===================================================================
--- issm/trunk/src/m/classes/clusters/greenplanet.m	                        (rev 0)
+++ issm/trunk/src/m/classes/clusters/greenplanet.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,202 @@
+%PFE class definition
+%
+%   Usage:
+%      cluster=greenplanet();
+%      cluster=greenplanet('np',3);
+%      cluster=greenplanet('np',3,'login','username');
+
+classdef greenplanet
+    properties (SetAccess=public)  
+		 % {{{1
+		 name='greenplanet'
+		 login='';
+		 numnodes=20;
+		 cpuspernode=8; 
+		 port=8000;
+		 queue='rignot';
+		 codepath='';
+		 executionpath='';
+		 interactive=0;
+	 end
+	 properties (SetAccess=private) 
+		 np=20*8;
+		 % }}}
+	 end
+	 methods
+		 function cluster=greenplanet(varargin) % {{{1
+
+			 %initialize cluster using default settings if provided
+			 if (exist('greenplanet_settings')==2), greenplanet_settings; end
+
+			 %use provided options to change fields
+			 options=pairoptions(varargin{:});
+			 for i=1:size(options.list,1),
+				 fieldname=options.list{i,1};
+				 fieldvalue=options.list{i,2};
+				 if ismember(fieldname,properties('greenplanet')),
+					 cluster.(fieldname)=fieldvalue;
+				 else
+					 disp(['''' fieldname ''' is not a property of cluster greenplanet']);
+				 end
+			 end
+		 end
+		 %}}}
+		 function disp(cluster) % {{{1
+			 %  display the object
+			 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
+			 disp(sprintf('    name: %s',cluster.name));
+			 disp(sprintf('    login: %s',cluster.login));
+			 disp(sprintf('    port: %i',cluster.port));
+			 disp(sprintf('    numnodes: %i',cluster.numnodes));
+			 disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
+			 disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
+			 disp(sprintf('    queue: %s',cluster.queue));
+			 disp(sprintf('    codepath: %s',cluster.codepath));
+			 disp(sprintf('    executionpath: %s',cluster.executionpath));
+			 disp(sprintf('    interactive: %i',cluster.interactive));
+		 end
+		 %}}}
+		 function checkconsistency(cluster,md,solution,analyses) % {{{1
+
+			 available_queues={'rignot','default'};
+			 queue_requirements_time=[Inf Inf];
+			 queue_requirements_np=[80 80];
+
+			 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,1)
+
+			 %Miscelaneous
+			 if isempty(cluster.login), checkmessage('login empty'); end
+			 if isempty(cluster.codepath), checkmessage('codepath empty'); end
+			 if isempty(cluster.executionpath), checkmessage('executionpath empty'); end
+
+		 end
+		 %}}}
+		 function BuildQueueScript(cluster,md) % {{{1
+
+			 %retrieve parameters 
+			 modelname=md.miscellaneous.name; 
+			 solution=md.private.solution;
+			 isvalgrind=md.debug.valgrind;
+
+			 %compute number of processors
+			 cluster.np=cluster.numnodes*cluster.cpuspernode;
+
+			 %open file for writing: 
+			 fid=fopen([modelname '.queue'],'w');
+
+			 fprintf(fid,'#PBS -S /bin/bash\n');
+			 fprintf(fid,'#PBS -N %s\n',modelname);
+			 fprintf(fid,'#PBS -q %s \n',cluster.queue);
+			 fprintf(fid,'#PBS -l nodes=%i:ppn=%i\n',cluster.numnodes,cluster.cpuspernode);
+			 fprintf(fid,'#PBS -m bea\n');
+			 fprintf(fid,'#PBS -M mmorligh at uci.edu\n');
+			 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
+			 fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
+
+			 fprintf(fid,'cd %s/%s\n\n',cluster.executionpath,md.private.runtimename);
+			 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+
+			 if ~md.settings.io_gather,
+				 %concatenate the output files:
+				 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+			 end
+
+			 %close file
+			 fclose(fid);
+
+			 %in interactive mode, create a run file, and errlog and outlog file
+			 if cluster.interactive,
+				 fid=fopen([modelname '.run'],'w');
+				 fprintf(fid,'mpiexec -np %i %s/issm.exe %s %s %s\n',cluster.np,cluster.codepath,EnumToString(solution),cluster.executionpath,modelname);
+
+				 if ~md.settings.io_gather,
+					 %concatenate the output files:
+					 fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
+				 end
+				 fclose(fid);
+				 fid=fopen([modelname '.errlog'],'w');
+				 fclose(fid);
+				 fid=fopen([modelname '.outlog'],'w');
+				 fclose(fid);
+			 end
+		 end %}}}
+		 function LaunchQueueJob(cluster,md,options)% {{{1
+			 
+			 %lauch command, to be executed via ssh
+			 if ~cluster.interactive, 
+				launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' md.private.runtimename ' && mkdir ' md.private.runtimename ...
+			                ' && cd ' md.private.runtimename ' && mv ../' md.private.runtimename '.tar.gz ./ && tar -zxf ' md.private.runtimename '.tar.gz  && qsub ' md.miscellaneous.name '.queue '];
+			else
+				launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive) ' && tar -zxf ' md.private.runtimename '.tar.gz'];
+			end
+
+			if ~strcmpi(options.batch,'yes'),
+				
+				%compress the files into one zip.
+				compressstring=['tar -zcf ' md.private.runtimename '.tar.gz ' md.miscellaneous.name '.bin ' md.miscellaneous.name '.queue '  md.miscellaneous.name '.petsc '];
+				if md.qmu.isdakota,
+					compressstring=[compressstring md.miscellaneous.name '.qmu.in '];
+				end
+				if cluster.interactive,
+					compressstring=[compressstring md.miscellaneous.name '.run ' md.miscellaneous.name '.errlog ' md.miscellaneous.name '.outlog '];
+				end
+				system(compressstring);
+				
+				disp('uploading input file and queueing script');
+				if cluster.interactive,
+					directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive)];
+				else 
+					directory=cluster.executionpath;
+				end
+				
+				issmscpout(cluster.name,directory,cluster.login,cluster.port,{[md.private.runtimename '.tar.gz']});
+				
+				disp('launching solution sequence on remote cluster');
+				issmssh(cluster.name,cluster.login,cluster.port,launchcommand);
+
+			else
+				disp('batch mode requested: not launching job interactively');
+				disp('launch solution sequence on remote cluster by hand');
+			end
+		 end
+		 %}}}
+		 function Download(cluster,md)% {{{1
+
+			%some check
+			if isempty(md.private.runtimename),
+				if ~cluster.interactive,
+					error('greenplanet Download error message: supply runtime name for results to be loaded!');
+				end
+			end
+
+			%Figure out the  directory where all the files are in: 
+			if ~cluster.interactive,
+				directory=[cluster.executionpath '/' md.private.runtimename '/'];
+			else
+				directory=[cluster.executionpath '/Interactive' num2str(cluster.interactive) '/'];
+			end
+
+			%What packages are we picking up from remote cluster
+			if ~cluster.interactive,
+				packages={[md.miscellaneous.name '.outlog'],[md.miscellaneous.name '.errlog']};
+			else
+				packages={};
+			end
+			if md.qmu.isdakota,
+				packages{end+1}=[md.miscellaneous.name '.qmu.err'];
+				packages{end+1}=[md.miscellaneous.name '.qmu.out'];
+				if isfield(md.qmu.params,'tabular_graphics_data'),
+					if md.qmu.params.tabular_graphics_data==true,
+						packages{end+1}='dakota_tabular.dat'; 
+					end
+				end
+			else
+				packages{end+1}=[md.miscellaneous.name '.outbin'];
+			end
+
+			%copy files from cluster to present directory
+			issmscpin(cluster.name, cluster.login, cluster.port, directory, packages);
+
+		end %}}}
+	end
+end

Modified: issm/trunk/src/m/classes/clusters/pollux.m
===================================================================
--- issm/trunk/src/m/classes/clusters/pollux.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/clusters/pollux.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,13 +9,13 @@
     properties (SetAccess=public) 
 		 % {{{1
 		 name='pollux'
-		 login='larour';
+		 login='username';
 		 np=128;
 		 port=0;
 		 queue='shortp';
 		 time=180;
-		 codepath='/workc/edw/larour/issm-2.0/bin'
-		 executionpath='/workc/edw/larour/Testing/Execution'
+		 codepath='/workc/edw/issm-2.0/bin'
+		 executionpath='/workc/edw/Testing/Execution'
 		 %}}}
 	 end
 	 methods

Modified: issm/trunk/src/m/classes/diagnostic.m
===================================================================
--- issm/trunk/src/m/classes/diagnostic.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/diagnostic.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -11,6 +11,7 @@
 		restol                   = 0;
 		reltol                   = 0;
 		abstol                   = 0;
+		isnewton                 = 0;
 		stokesreconditioning     = 0;
 		viscosity_overshoot      = 0;
 		icefront                 = NaN;
@@ -81,6 +82,7 @@
 			checkfield(md,'diagnostic.restol','size',[1 1],'>',0);
 			checkfield(md,'diagnostic.reltol','size',[1 1]);
 			checkfield(md,'diagnostic.abstol','size',[1 1]);
+			checkfield(md,'diagnostic.isnewton','numel',1,'values',[0 1]);
 			checkfield(md,'diagnostic.stokesreconditioning','size',[1 1],'NaN',1);
 			checkfield(md,'diagnostic.viscosity_overshoot','size',[1 1],'NaN',1);
 			if md.mesh.dimension==2,
@@ -126,6 +128,7 @@
 			fielddisplay(obj,'restol','mechanical equilibrium residual convergence criterion');
 			fielddisplay(obj,'reltol','velocity relative convergence criterion, NaN -> not applied');
 			fielddisplay(obj,'abstol','velocity absolute convergence criterion, NaN -> not applied');
+			fielddisplay(obj,'isnewton','Apply Newton''s method instead of a Picard fixed point method');
 			fielddisplay(obj,'maxiter','maximum number of nonlinear iterations');
 			fielddisplay(obj,'viscosity_overshoot','over-shooting constant new=new+C*(new-old)');
 
@@ -157,6 +160,7 @@
 			WriteData(fid,'object',obj,'fieldname','restol','format','Double');
 			WriteData(fid,'object',obj,'fieldname','reltol','format','Double');
 			WriteData(fid,'object',obj,'fieldname','abstol','format','Double');
+			WriteData(fid,'object',obj,'fieldname','isnewton','format','Boolean');
 			WriteData(fid,'object',obj,'fieldname','stokesreconditioning','format','Double');
 			WriteData(fid,'object',obj,'fieldname','viscosity_overshoot','format','Double');
 			WriteData(fid,'object',obj,'fieldname','maxiter','format','Integer');

Modified: issm/trunk/src/m/classes/initialization.m
===================================================================
--- issm/trunk/src/m/classes/initialization.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/initialization.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -61,6 +61,9 @@
 				checkfield(md,'initialization.vz','NaN',1,'size',[md.mesh.numberofvertices 1]);
 				checkfield(md,'initialization.pressure','NaN',1,'size',[md.mesh.numberofvertices 1]);
 			end
+			if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy),
+				checkfield(md,'initialization.waterfraction','>=',0,'size',[md.mesh.numberofvertices 1]);
+			end
 		end % }}}
 		function disp(obj) % {{{
 			disp(sprintf('   initial field values:'));

Modified: issm/trunk/src/m/classes/inversion.m
===================================================================
--- issm/trunk/src/m/classes/inversion.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/inversion.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -6,6 +6,8 @@
 classdef inversion
 	properties (SetAccess=public) 
 		iscontrol                   = 0
+		tao                         = 0
+		incomplete_adjoint          = 0
 		control_parameters          = NaN
 		nsteps                      = 0
 		maxiter_per_step            = NaN
@@ -41,40 +43,43 @@
 		end % }}}
 		function obj = setdefaultparameters(obj) % {{{
 
-			 %parameter to be inferred by control methods (only
-			 %drag and B are supported yet)
-			 obj.control_parameters={'FrictionCoefficient'};
+			%default is incomplete adjoint for now
+			obj.incomplete_adjoint=1;
 
-			 %number of steps in the control methods
-			 obj.nsteps=20;
+			%parameter to be inferred by control methods (only
+			%drag and B are supported yet)
+			obj.control_parameters={'FrictionCoefficient'};
 
-			 %maximum number of iteration in the optimization algorithm for
-			 %each step
-			 obj.maxiter_per_step=20*ones(obj.nsteps,1);
+			%number of steps in the control methods
+			obj.nsteps=20;
 
-			 %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
-			 obj.gradient_scaling=50*ones(obj.nsteps,1);
+			%maximum number of iteration in the optimization algorithm for
+			%each step
+			obj.maxiter_per_step=20*ones(obj.nsteps,1);
 
-			 %several responses can be used:
-			 obj.cost_functions=101*ones(obj.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
+			obj.gradient_scaling=50*ones(obj.nsteps,1);
 
-			 %step_threshold is used to speed up control method. When
-			 %misfit(1)/misfit(0) < obj.step_threshold, we go directly to
-			 %the next step
-			 obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement.
+			%several responses can be used:
+			obj.cost_functions=101*ones(obj.nsteps,1);
 
-			 %stop control solution at the gradient computation and return it? 
-			 obj.gradient_only=0;
+			%step_threshold is used to speed up control method. When
+			%misfit(1)/misfit(0) < obj.step_threshold, we go directly to
+			%the next step
+			obj.step_threshold=.7*ones(obj.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
-			 obj.cost_function_threshold=NaN; %not activated
+			%stop control solution at the gradient computation and return it? 
+			obj.gradient_only=0;
 
+			%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
+			obj.cost_function_threshold=NaN; %not activated
+
 		end % }}}
 		function checkconsistency(obj,md,solution,analyses) % {{{
 
@@ -85,6 +90,8 @@
 			num_costfunc=size(md.inversion.cost_functions,2);
 
 			checkfield(md,'inversion.iscontrol','values',[0 1]);
+			checkfield(md,'inversion.tao','values',[0 1]);
+			checkfield(md,'inversion.incomplete_adjoint','values',[0 1]);
 			checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'});
 			checkfield(md,'inversion.nsteps','numel',1,'>=',1);
 			checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
@@ -105,6 +112,7 @@
 		end % }}}
 		function disp(obj) % {{{
 			fielddisplay(obj,'iscontrol','is inversion activated?');
+			fielddisplay(obj,'incomplete_adjoint','do we assume linear viscosity?');
 			fielddisplay(obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}');
 			fielddisplay(obj,'nsteps','number of optimization searches');
 			fielddisplay(obj,'cost_functions','indicate the type of response for each optimization step');
@@ -134,6 +142,8 @@
 		function marshall(obj,fid) % {{{
 
 			WriteData(fid,'object',obj,'fieldname','iscontrol','format','Boolean');
+			WriteData(fid,'object',obj,'fieldname','tao','format','Boolean');
+			WriteData(fid,'object',obj,'fieldname','incomplete_adjoint','format','Boolean');
 			if ~obj.iscontrol, return; end
 			WriteData(fid,'object',obj,'fieldname','nsteps','format','Integer');
 			WriteData(fid,'object',obj,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3);


Property changes on: issm/trunk/src/m/classes/model
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/classes/model/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/classes/model/Makefile.am)
===================================================================
--- issm/trunk/src/m/classes/model/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/classes/model/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/classes/model/model.m
===================================================================
--- issm/trunk/src/m/classes/model/model.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/model/model.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -135,7 +135,6 @@
 			 if isfield(structmd,'melting'), md.basalforcings.melting_rate=structmd.melting; end
 			 if isfield(structmd,'melting_rate'), md.basalforcings.melting_rate=structmd.melting_rate; end
 			 if isfield(structmd,'accumulation'), md.surfaceforcings.mass_balance=structmd.accumulation; end
-			 if isfield(structmd,'accumulation_rate'), md.surfaceforcings.mass_balance=structmd.accumulation_rate; 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
@@ -403,7 +402,11 @@
 			 md.verbose          = verbose('solution',true,'qmu',true,'control',true);
 			 md.settings         = settings();
 			 md.solver           = solver();
-			 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,mumpsoptions);
+			 if ismumps,
+				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,mumpsoptions);
+			 else
+				 md.solver           = addoptions(md.solver,DiagnosticVertAnalysisEnum,iluasmoptions);
+			 end
 			 md.cluster          = none();
 			 md.balancethickness = balancethickness();
 			 md.diagnostic       = diagnostic();

Modified: issm/trunk/src/m/classes/solver.m
===================================================================
--- issm/trunk/src/m/classes/solver.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/solver.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -5,7 +5,7 @@
 
 classdef solver
     properties (SetAccess=public) 
-		 options={NoneAnalysisEnum,mumpsoptions};
+		 options=cell(0,0);
 	 end
 	 methods
 		 function obj = solver(varargin) % {{{
@@ -25,27 +25,43 @@
 			 end % }}}
 		 function obj = setdefaultparameters(obj) % {{{
 
+			 %MUMPS is the default solver
+			 if ismumps,
+				 obj.options={'NoneAnalysis',mumpsoptions};
+			 else
+				 obj.options={'NoneAnalysis',iluasmoptions};
+			 end
+
 		 end % }}}
-		 function obj=addoptions(obj,analysis,solveroptions) % {{{1
+		 function obj = addoptions(obj,analysis,solveroptions) % {{{1
+
+			 %Convert analysis from enum to string
+			 analysis=EnumToString(analysis);
+
 			 %first, find out if analysis has already been supplied
 			 found=false;
 			 for i=1:size(obj.options,1),
 				 inanalysis=obj.options{i,1};
-				 if inanalysis==analysis,
+				 if strcmp(inanalysis,analysis),
 					 found=true;
-					 obj.options{i,1}=analysis;
-					 obj.options{i,2}=solveroptions;
+					 obj.options{i,1} = analysis;
+					 obj.options{i,2} = solveroptions;
 					 break;
 				 end
 			 end
+
 			 if ~found,
-				 obj.options{end+1,1}=analysis;
-				 obj.options{end,2}=solveroptions;
+				 obj.options{end+1,1}= analysis;
+				 obj.options{end,2}  = solveroptions;
 			 end
 		 end
 		 %}}}
 		 function checkconsistency(obj,md,solution,analyses) % {{{
-
+			 for i=1:size(obj.options,1),
+				 if ~ischar(obj.options{i,1}),
+					 checkmessage('solver is not well formatted: Analyses are not strings');
+				 end
+			 end
 		 end % }}}
 		 function PetscFile(solver,filename) % {{{
 			 %PETSCFILE - build petsc file
@@ -69,7 +85,7 @@
 				 options=solver.options{i,2};
 
 				 %first write analysis:
-				 fprintf(fid,'\n+%s\n',EnumToString(analysis)); %append a + to recognize it's an analysis enum
+				 fprintf(fid,'\n+%s\n',analysis); %append a + to recognize it's an analysis enum
 
 				 %now, write options
 				 for j=1:size(options,2),
@@ -125,7 +141,7 @@
 					end
 				end
 
-				disp(sprintf('   %s -> ''%s''',EnumToString(analysis),string));
+				disp(sprintf('   %s -> ''%s''',analysis,string));
 			end
 		 end
 		 %}}}

Modified: issm/trunk/src/m/classes/surfaceforcings.m
===================================================================
--- issm/trunk/src/m/classes/surfaceforcings.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/surfaceforcings.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -5,9 +5,8 @@
 
 classdef surfaceforcings
 	properties (SetAccess=public) 
-		accumulation_rate = NaN;
-		ablation_rate     = NaN;
-		mass_balance      = NaN;
+		precipitation = NaN;
+		mass_balance  = NaN;
 	end
 	methods
 		function obj = surfaceforcings(varargin) % {{{
@@ -40,14 +39,12 @@
 		function disp(obj) % {{{
 			disp(sprintf('   surface forcings parameters:'));
 
-			fielddisplay(obj,'accumulation_rate','surface accumulation rate [m]');
-			fielddisplay(obj,'ablation_rate','surface ablation rate [m]');
-			fielddisplay(obj,'mass_balance','surface mass balance [m]');
+			fielddisplay(obj,'precipitation','surface precipitation [m/yr ice eq]');
+			fielddisplay(obj,'mass_balance','surface mass balance [m/yr ice eq]');
 
 		end % }}}
 		function marshall(obj,fid) % {{{
-			WriteData(fid,'object',obj,'fieldname','accumulation_rate','format','DoubleMat','mattype',1);
-			WriteData(fid,'object',obj,'fieldname','ablation_rate','format','DoubleMat','mattype',1);
+			WriteData(fid,'object',obj,'fieldname','precipitation','format','DoubleMat','mattype',1);
 			WriteData(fid,'object',obj,'fieldname','mass_balance','format','DoubleMat','mattype',1);
 		end % }}}
 	end

Modified: issm/trunk/src/m/classes/thermal.m
===================================================================
--- issm/trunk/src/m/classes/thermal.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/classes/thermal.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -11,6 +11,7 @@
 		maxiter           = 0;
 		penalty_lock      = 0;
 		penalty_factor    = 0;
+		isenthalpy        = 0;
 	end
 	methods
 		function obj = thermal(varargin) % {{{
@@ -41,14 +42,21 @@
 
 			%factor used to compute the values of the penalties: kappa=max(stiffness matrix)*10^penalty_factor
 			obj.penalty_factor=3;
+
+			%Should we use cold ice (default) or enthalpy formulation
+			obj.isenthalpy=0;
 		end % }}}
 		function checkconsistency(obj,md,solution,analyses) % {{{
 
 			%Early return
-			if ~ismember(ThermalAnalysisEnum,analyses) | (solution==TransientSolutionEnum & md.transient.isthermal==0), return; end
+			if (~ismember(ThermalAnalysisEnum,analyses) & ~ismember(EnthalpyAnalysisEnum,analyses)) | (solution==TransientSolutionEnum & md.transient.isthermal==0), return; end
 
 			checkfield(md,'thermal.stabilization','numel',1,'values',[0 1 2]);
 			checkfield(md,'thermal.spctemperature','forcing',1);
+			if (ismember(EnthalpyAnalysisEnum,analyses) & md.thermal.isenthalpy),
+			checkfield(md,'thermal.spctemperature','<',md.materials.meltingpoint-md.materials.beta*md.materials.rho_ice*md.constants.g*md.geometry.thickness,'message','spctemperature should be below the adjusted melting point');
+			checkfield(md,'thermal.isenthalpy','numel',1,'values',[0 1]);
+			end
 		end % }}}
 		function disp(obj) % {{{
 			disp(sprintf('   Thermal solution parameters:'));
@@ -58,6 +66,7 @@
 			fielddisplay(obj,'maxiter','maximum number of non linear iterations');
 			fielddisplay(obj,'penalty_lock','stabilize unstable thermal constraints that keep zigzagging after n iteration (default is 0, no stabilization)');
 			fielddisplay(obj,'penalty_threshold','threshold to declare convergence of thermal solution (default is 0)');
+			fielddisplay(obj,'isenthalpy','use an enthalpy formulation to include temperate ice (default is 0)');
 
 		end % }}}
 		function marshall(obj,fid) % {{{
@@ -67,6 +76,7 @@
 			WriteData(fid,'object',obj,'fieldname','maxiter','format','Integer');
 			WriteData(fid,'object',obj,'fieldname','penalty_lock','format','Integer');
 			WriteData(fid,'object',obj,'fieldname','penalty_factor','format','Double');
+			WriteData(fid,'object',obj,'fieldname','isenthalpy','format','Boolean');
 		end % }}}
 	end
 end


Property changes on: issm/trunk/src/m/enum
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/enum/DiagnosticIsnewtonEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/DiagnosticIsnewtonEnum.m)
===================================================================
--- issm/trunk/src/m/enum/DiagnosticIsnewtonEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/DiagnosticIsnewtonEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=DiagnosticIsnewtonEnum()
+%DIAGNOSTICISNEWTONENUM - Enum of DiagnosticIsnewton
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=DiagnosticIsnewtonEnum()
+
+macro=StringToEnum('DiagnosticIsnewton');

Copied: issm/trunk/src/m/enum/InversionIncompleteAdjointEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/InversionIncompleteAdjointEnum.m)
===================================================================
--- issm/trunk/src/m/enum/InversionIncompleteAdjointEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/InversionIncompleteAdjointEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=InversionIncompleteAdjointEnum()
+%INVERSIONINCOMPLETEADJOINTENUM - Enum of InversionIncompleteAdjoint
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=InversionIncompleteAdjointEnum()
+
+macro=StringToEnum('InversionIncompleteAdjoint');

Copied: issm/trunk/src/m/enum/InversionTaoEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/InversionTaoEnum.m)
===================================================================
--- issm/trunk/src/m/enum/InversionTaoEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/InversionTaoEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=InversionTaoEnum()
+%INVERSIONTAOENUM - Enum of InversionTao
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=InversionTaoEnum()
+
+macro=StringToEnum('InversionTao');

Copied: issm/trunk/src/m/enum/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/enum/Makefile.am)
===================================================================
--- issm/trunk/src/m/enum/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/enum/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Copied: issm/trunk/src/m/enum/PentaP1ElementResultEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/PentaP1ElementResultEnum.m)
===================================================================
--- issm/trunk/src/m/enum/PentaP1ElementResultEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/PentaP1ElementResultEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=PentaP1ElementResultEnum()
+%PENTAP1ELEMENTRESULTENUM - Enum of PentaP1ElementResult
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=PentaP1ElementResultEnum()
+
+macro=StringToEnum('PentaP1ElementResult');

Copied: issm/trunk/src/m/enum/PentaP1InputEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/PentaP1InputEnum.m)
===================================================================
--- issm/trunk/src/m/enum/PentaP1InputEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/PentaP1InputEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=PentaP1InputEnum()
+%PENTAP1INPUTENUM - Enum of PentaP1Input
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=PentaP1InputEnum()
+
+macro=StringToEnum('PentaP1Input');

Deleted: issm/trunk/src/m/enum/PentaVertexElementResultEnum.m
===================================================================
--- issm/trunk/src/m/enum/PentaVertexElementResultEnum.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/enum/PentaVertexElementResultEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-function macro=PentaVertexElementResultEnum()
-%PENTAVERTEXELEMENTRESULTENUM - Enum of PentaVertexElementResult
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=PentaVertexElementResultEnum()
-
-macro=StringToEnum('PentaVertexElementResult');

Deleted: issm/trunk/src/m/enum/PentaVertexInputEnum.m
===================================================================
--- issm/trunk/src/m/enum/PentaVertexInputEnum.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/enum/PentaVertexInputEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-function macro=PentaVertexInputEnum()
-%PENTAVERTEXINPUTENUM - Enum of PentaVertexInput
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=PentaVertexInputEnum()
-
-macro=StringToEnum('PentaVertexInput');

Deleted: issm/trunk/src/m/enum/SurfaceforcingsAblationRateEnum.m
===================================================================
--- issm/trunk/src/m/enum/SurfaceforcingsAblationRateEnum.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/enum/SurfaceforcingsAblationRateEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-function macro=SurfaceforcingsAblationRateEnum()
-%SURFACEFORCINGSABLATIONRATEENUM - Enum of SurfaceforcingsAblationRate
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=SurfaceforcingsAblationRateEnum()
-
-macro=StringToEnum('SurfaceforcingsAblationRate');

Deleted: issm/trunk/src/m/enum/SurfaceforcingsAccumulationRateEnum.m
===================================================================
--- issm/trunk/src/m/enum/SurfaceforcingsAccumulationRateEnum.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/enum/SurfaceforcingsAccumulationRateEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-function macro=SurfaceforcingsAccumulationRateEnum()
-%SURFACEFORCINGSACCUMULATIONRATEENUM - Enum of SurfaceforcingsAccumulationRate
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=SurfaceforcingsAccumulationRateEnum()
-
-macro=StringToEnum('SurfaceforcingsAccumulationRate');

Copied: issm/trunk/src/m/enum/SurfaceforcingsPrecipitationEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/SurfaceforcingsPrecipitationEnum.m)
===================================================================
--- issm/trunk/src/m/enum/SurfaceforcingsPrecipitationEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/SurfaceforcingsPrecipitationEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=SurfaceforcingsPrecipitationEnum()
+%SURFACEFORCINGSPRECIPITATIONENUM - Enum of SurfaceforcingsPrecipitation
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=SurfaceforcingsPrecipitationEnum()
+
+macro=StringToEnum('SurfaceforcingsPrecipitation');

Copied: issm/trunk/src/m/enum/ThermalIsenthalpyEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/ThermalIsenthalpyEnum.m)
===================================================================
--- issm/trunk/src/m/enum/ThermalIsenthalpyEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/ThermalIsenthalpyEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=ThermalIsenthalpyEnum()
+%THERMALISENTHALPYENUM - Enum of ThermalIsenthalpy
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=ThermalIsenthalpyEnum()
+
+macro=StringToEnum('ThermalIsenthalpy');

Copied: issm/trunk/src/m/enum/TriaP1ElementResultEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/TriaP1ElementResultEnum.m)
===================================================================
--- issm/trunk/src/m/enum/TriaP1ElementResultEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/TriaP1ElementResultEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=TriaP1ElementResultEnum()
+%TRIAP1ELEMENTRESULTENUM - Enum of TriaP1ElementResult
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=TriaP1ElementResultEnum()
+
+macro=StringToEnum('TriaP1ElementResult');

Copied: issm/trunk/src/m/enum/TriaP1InputEnum.m (from rev 11526, issm/trunk-jpl/src/m/enum/TriaP1InputEnum.m)
===================================================================
--- issm/trunk/src/m/enum/TriaP1InputEnum.m	                        (rev 0)
+++ issm/trunk/src/m/enum/TriaP1InputEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,11 @@
+function macro=TriaP1InputEnum()
+%TRIAP1INPUTENUM - Enum of TriaP1Input
+%
+%   WARNING: DO NOT MODIFY THIS FILE
+%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
+%            Please read src/c/EnumDefinitions/README for more information
+%
+%   Usage:
+%      macro=TriaP1InputEnum()
+
+macro=StringToEnum('TriaP1Input');

Deleted: issm/trunk/src/m/enum/TriaVertexElementResultEnum.m
===================================================================
--- issm/trunk/src/m/enum/TriaVertexElementResultEnum.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/enum/TriaVertexElementResultEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-function macro=TriaVertexElementResultEnum()
-%TRIAVERTEXELEMENTRESULTENUM - Enum of TriaVertexElementResult
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=TriaVertexElementResultEnum()
-
-macro=StringToEnum('TriaVertexElementResult');

Deleted: issm/trunk/src/m/enum/TriaVertexInputEnum.m
===================================================================
--- issm/trunk/src/m/enum/TriaVertexInputEnum.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/enum/TriaVertexInputEnum.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +0,0 @@
-function macro=TriaVertexInputEnum()
-%TRIAVERTEXINPUTENUM - Enum of TriaVertexInput
-%
-%   WARNING: DO NOT MODIFY THIS FILE
-%            this file has been automatically generated by src/c/EnumDefinitions/Synchronize.sh
-%            Please read src/c/EnumDefinitions/README for more information
-%
-%   Usage:
-%      macro=TriaVertexInputEnum()
-
-macro=StringToEnum('TriaVertexInput');


Property changes on: issm/trunk/src/m/kml
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/kml/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/kml/Makefile.am)
===================================================================
--- issm/trunk/src/m/kml/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/kml/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/model
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,2 @@
+SUBDIRS = plot mesh display parameterization partition solvers
+bin_SCRIPTS=*.m  

Modified: issm/trunk/src/m/model/collapse.m
===================================================================
--- issm/trunk/src/m/model/collapse.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/collapse.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -28,6 +28,9 @@
 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.cost_functions_coefficients), md.inversion.cost_functions_coefficients=project2d(md,md.inversion.cost_functions_coefficients,md.mesh.numberoflayers); end;
+if ~isnan(md.inversion.min_parameters), md.inversion.min_parameters=project2d(md,md.inversion.min_parameters,md.mesh.numberoflayers); end;
+if ~isnan(md.inversion.max_parameters), md.inversion.max_parameters=project2d(md,md.inversion.max_parameters,md.mesh.numberoflayers); end;
 if ~isnan(md.surfaceforcings.mass_balance),
 	md.surfaceforcings.mass_balance=project2d(md,md.surfaceforcings.mass_balance,md.mesh.numberoflayers); 
 end;
@@ -48,18 +51,23 @@
 %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.bordermacayeal=project2d(md,md.flowequation.bordermacayeal,1);
+	md.flowequation.borderpattyn=project2d(md,md.flowequation.borderpattyn,1);
+	md.flowequation.borderstokes=project2d(md,md.flowequation.borderstokes,1);
 end	
 
 %boundary conditions
 md.diagnostic.spcvx=project2d(md,md.diagnostic.spcvx,md.mesh.numberoflayers);
 md.diagnostic.spcvy=project2d(md,md.diagnostic.spcvy,md.mesh.numberoflayers);
 md.diagnostic.spcvz=project2d(md,md.diagnostic.spcvz,md.mesh.numberoflayers);
+md.diagnostic.referential=project2d(md,md.diagnostic.referential,md.mesh.numberoflayers);
 md.prognostic.spcthickness=project2d(md,md.prognostic.spcthickness,md.mesh.numberoflayers);
 md.thermal.spctemperature=project2d(md,md.thermal.spctemperature,md.mesh.numberoflayers);
 
 %Extrusion of Neumann BC
 if ~isnan(md.diagnostic.icefront),
-	numberofneumann2d=size(md.diagnostic.icefront,1)/md.mesh.numberoflayers;
+	numberofneumann2d=size(md.diagnostic.icefront,1)/(md.mesh.numberoflayers-1);
 	md.diagnostic.icefront=[md.diagnostic.icefront(1:numberofneumann2d,1:2) md.diagnostic.icefront(1:numberofneumann2d,5:6)]; %Add two columns on the first layer 
 end
 
@@ -87,6 +95,8 @@
 md.mask.vertexonfloatingice=project2d(md,md.mask.vertexonfloatingice,1);
 md.mask.elementongroundedice=project2d(md,md.mask.elementongroundedice,1);
 md.mask.vertexongroundedice=project2d(md,md.mask.vertexongroundedice,1);
+md.mask.elementonwater=project2d(md,md.mask.elementonwater,1);
+md.mask.vertexonwater=project2d(md,md.mask.vertexonwater,1);
 
 %Initialize with the 2d mesh
 md.mesh.x=md.mesh.x2d;


Property changes on: issm/trunk/src/m/model/display
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/display/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/display/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/display/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/display/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/model/extrude.m
===================================================================
--- issm/trunk/src/m/model/extrude.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/extrude.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -136,8 +136,7 @@
 md.inversion.vy_obs=project3d(md,'vector',md.inversion.vy_obs,'type','node');
 md.inversion.vel_obs=project3d(md,'vector',md.inversion.vel_obs,'type','node');
 md.surfaceforcings.mass_balance=project3d(md,'vector',md.surfaceforcings.mass_balance,'type','node');
-md.surfaceforcings.accumulation_rate=project3d(md,'vector',md.surfaceforcings.accumulation_rate,'type','node');
-md.surfaceforcings.ablation_rate=project3d(md,'vector',md.surfaceforcings.ablation_rate,'type','node');
+md.surfaceforcings.precipitation=project3d(md,'vector',md.surfaceforcings.precipitation,'type','node');
 md.balancethickness.thickening_rate=project3d(md,'vector',md.balancethickness.thickening_rate,'type','node');
 
 %results
@@ -193,7 +192,7 @@
 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;
+		=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;
 
@@ -215,8 +214,9 @@
 md.mask.elementonwater=project3d(md,'vector',md.mask.elementonwater,'type','element');
 md.mask.vertexonwater=project3d(md,'vector',md.mask.vertexonwater,'type','node');
 if ~isnan(md.inversion.cost_functions_coefficients),md.inversion.cost_functions_coefficients=project3d(md,'vector',md.inversion.cost_functions_coefficients,'type','node');end;
+if ~isnan(md.qmu.partition),md.qmu.partition=project3d(md,'vector',md.qmu.partition','type','node');end
 
-%Put lithostatic pressure is there is an existing pressure
+%Put lithostatic pressure if there is an existing pressure
 if ~isnan(md.initialization.pressure),
 	md.initialization.pressure=md.constants.g*md.materials.rho_ice*(md.geometry.surface-md.mesh.z);
 end

Modified: issm/trunk/src/m/model/loadresultsfromcluster.m
===================================================================
--- issm/trunk/src/m/model/loadresultsfromcluster.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/loadresultsfromcluster.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -29,7 +29,9 @@
 	delete([md.miscellaneous.name '.outlog']);
 	delete([md.miscellaneous.name '.errlog']);
 	delete([md.miscellaneous.name '.outbin']);
-	delete([md.private.runtimename '.tar.gz']);
+	if ~ispc,
+		delete([md.private.runtimename '.tar.gz']);
+	end
 end
 
 %erase input file if run was carried out on same platform.
@@ -40,7 +42,11 @@
 		delete([['qmu' num2str(feature('GetPid')) '/'] md.miscellaneous.name '.queue']);
 	else
 		delete([md.miscellaneous.name '.bin']);
-		delete([md.miscellaneous.name '.queue']);
 		delete([md.miscellaneous.name '.petsc']);
+		if ~ispc,
+			delete([md.miscellaneous.name '.queue']);
+		else
+			delete([md.miscellaneous.name '.bat']);
+		end
 	end
 end

Modified: issm/trunk/src/m/model/loadresultsfromdisk.m
===================================================================
--- issm/trunk/src/m/model/loadresultsfromdisk.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/loadresultsfromdisk.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -12,6 +12,11 @@
 
 if ~md.qmu.isdakota,
 
+	%Check that file exists
+	if ~exist(filename,'file'),
+		error(['binary file ' filename ' not found.']);
+	end
+
 	%initialize md.results if not a structure yet
 	if ~isstruct(md.results),
 		md.results=struct();
@@ -19,6 +24,9 @@
 
 	%load results onto model
 	structure=parseresultsfromdisk(filename,~md.settings.io_gather);
+	if isempty(fieldnames(structure)),
+		error(['No result found in binary file ' filename '. Check for solution crash.']);
+	end
 	md.results.(structure(1).SolutionType)=structure;
 
 	%recover solution_type from results


Property changes on: issm/trunk/src/m/model/mesh
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/mesh/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/mesh/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/mesh/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/mesh/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/model/parameterization
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/parameterization/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/parameterization/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/parameterization/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/parameterization/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/model/partition
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/partition/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/partition/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/partition/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/partition/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/model/partition/partitioner.m
===================================================================
--- issm/trunk/src/m/model/partition/partitioner.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/partition/partitioner.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -98,6 +98,8 @@
 
 %extrude if we are in 3D:
 if md.mesh.dimension==3,
+	md3d.qmu.vertex_weight=md.qmu.vertex_weight;
+	md3d.qmu.adjacency=md.qmu.adjacency;
 	md=md3d;
 	part=project3d(md,'vector',part','type','node');
 end


Property changes on: issm/trunk/src/m/model/plot
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/plot/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/plot/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/plot/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/plot/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/model/plot/plot_BC.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_BC.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plot_BC.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,7 +1,7 @@
 function plot_BC(md,options,width,i,data);
 
 %plot neuman
-plot_pressureload(md,options,width,i,data)
+plot_icefront(md,options,width,i,data)
 
 hold on
 
@@ -34,3 +34,8 @@
 legend(plot_h,text_strings,'location','NorthEast')
 
 hold off
+
+%apply options
+options=addfielddefault(options,'title','Boundary conditions');
+options=addfielddefault(options,'colorbar',0);
+applyoptions(md,[],options);

Copied: issm/trunk/src/m/model/plot/plot_icefront.m (from rev 11526, issm/trunk-jpl/src/m/model/plot/plot_icefront.m)
===================================================================
--- issm/trunk/src/m/model/plot/plot_icefront.m	                        (rev 0)
+++ issm/trunk/src/m/model/plot/plot_icefront.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,106 @@
+function plot_icefront(md,options,width,i,data);
+%PLOT_ICEFRONT - plot segment on neumann BC
+%
+%   Usage:
+%      plot_icefront(md,options,width,i);
+%
+%   See also: PLOTMODEL
+
+%plot mesh boundaries
+subplot(width,width,i); 
+
+%process mesh and data
+[x y z elements is2d isplanet]=processmesh(md,[],options);
+icefront=md.diagnostic.icefront;
+
+if (md.mesh.dimension==2),
+
+	%plot mesh
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
+	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
+	hold on;
+
+	%highlight elements on neumann
+	pos=find(icefront(:,end)==1);
+	pos=icefront(pos,end-1);
+	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+	h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+	pos=find(icefront(:,end)==0);
+	pos=icefront(pos,end-1);
+	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+	h3=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+
+	pos=find(icefront(:,end)==2);
+	pos=icefront(pos,end-1);
+	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
+	h3bis=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+
+	%display arrows pointing outward
+	xstart=mean(x(icefront(:,1:end-2)),2);
+	ystart=mean(y(icefront(:,1:end-2)),2);
+	length=sqrt((x(icefront(:,1))-x(icefront(:,2))).^2 + (y(icefront(:,1))-y(icefront(:,2))).^2 );
+	normal(:,1)=cos(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+	normal(:,2)=sin(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+	xend=xstart+length.*normal(:,1);
+	yend=ystart+length.*normal(:,2);
+	q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
+	h4=plot(xstart,ystart,'r*');
+else
+
+	%plot mesh
+	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
+	h1=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;
+
+	%highlight elements on neumann
+	pos=find(icefront(:,end)==1);
+	pos=icefront(pos,end-1);
+	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+	h2=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
+	pos=find(icefront(:,end)==0);
+	pos=icefront(pos,end-1);
+	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+	h3=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
+	pos=find(icefront(:,end)==2);
+	pos=icefront(pos,end-1);
+	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
+	h3bis=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
+
+	%display arrows pointing outward
+	xstart=mean(x(icefront(:,1:end-2)),2);
+	ystart=mean(y(icefront(:,1:end-2)),2);
+	zstart=mean(z(icefront(:,1:end-2)),2);
+	length=sqrt((x(icefront(:,1))-x(icefront(:,2))).^2 + (y(icefront(:,1))-y(icefront(:,2))).^2 );
+	normal(:,1)=cos(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+	normal(:,2)=sin(atan2((x(icefront(:,1))-x(icefront(:,2))) , (y(icefront(:,2))-y(icefront(:,1)))));
+	xend=xstart+length.*normal(:,1);
+	yend=ystart+length.*normal(:,2);
+	q=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zeros(numel(xstart),1)); hold on;
+	h4=plot3(xstart,ystart,zstart,'r*');
+end
+
+%legend (disable warnings)
+warning off
+legend([h2,h3,h3bis,q],'element on ice front (Water)','element on ice front (Air)','element on ice front (Ice)','normal vectors')
+warning on
+
+%apply options
+options=addfielddefault(options,'title','Neumann boundary conditions');
+options=addfielddefault(options,'colorbar',0);
+applyoptions(md,[],options);

Modified: issm/trunk/src/m/model/plot/plot_manager.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_manager.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plot_manager.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -111,8 +111,8 @@
 		case 'sarpwr',
 			plot_sarpwr(md,options,subplotwidth,i)
 			return
-		case 'pressureload'
-			plot_pressureload(md,options,subplotwidth,i,data)
+		case 'icefront'
+			plot_icefront(md,options,subplotwidth,i,data)
 			return
 		case 'segments'
 			plot_segments(md,options,subplotwidth,i,data)

Deleted: issm/trunk/src/m/model/plot/plot_pressureload.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_pressureload.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plot_pressureload.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,106 +0,0 @@
-function plot_pressureload(md,options,width,i,data);
-%PLOT_PRESSURELOAD - plot segment on neumann BC
-%
-%   Usage:
-%      plot_pressureload(md,options,width,i);
-%
-%   See also: PLOTMODEL
-
-%plot mesh boundaries
-subplot(width,width,i); 
-
-%process mesh and data
-[x y z elements is2d isplanet]=processmesh(md,[],options);
-pressureload=md.diagnostic.icefront;
-
-if (md.mesh.dimension==2),
-
-	%plot mesh
-	A=elements(:,1); B=elements(:,2); C=elements(:,3); 
-	h1=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','none','EdgeColor','black');
-	hold on;
-
-	%highlight elements on neumann
-	pos=find(pressureload(:,end)==1);
-	pos=pressureload(pos,end-1);
-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
-	h2=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
-	pos=find(pressureload(:,end)==0);
-	pos=pressureload(pos,end-1);
-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
-	h3=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
-
-	pos=find(pressureload(:,end)==2);
-	pos=pressureload(pos,end-1);
-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); 
-	h3bis=patch( 'Faces', [A B C], 'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
-
-	%display arrows pointing outward
-	xstart=mean(x(pressureload(:,1:end-2)),2);
-	ystart=mean(y(pressureload(:,1:end-2)),2);
-	length=sqrt((x(pressureload(:,1))-x(pressureload(:,2))).^2 + (y(pressureload(:,1))-y(pressureload(:,2))).^2 );
-	normal(:,1)=cos(atan2((x(pressureload(:,1))-x(pressureload(:,2))) , (y(pressureload(:,2))-y(pressureload(:,1)))));
-	normal(:,2)=sin(atan2((x(pressureload(:,1))-x(pressureload(:,2))) , (y(pressureload(:,2))-y(pressureload(:,1)))));
-	xend=xstart+length.*normal(:,1);
-	yend=ystart+length.*normal(:,2);
-	q=quiver(xstart,ystart,xend-xstart,yend-ystart); hold on;
-	h4=plot(xstart,ystart,'r*');
-else
-
-	%plot mesh
-	A=elements(:,1); B=elements(:,2); C=elements(:,3); D=elements(:,4); E=elements(:,5); F=elements(:,6);
-	h1=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;
-
-	%highlight elements on neumann
-	pos=find(pressureload(:,end)==1);
-	pos=pressureload(pos,end-1);
-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
-	h2=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','blue','EdgeColor','black');
-	pos=find(pressureload(:,end)==0);
-	pos=pressureload(pos,end-1);
-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
-	h3=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','green','EdgeColor','black');
-	pos=find(pressureload(:,end)==2);
-	pos=pressureload(pos,end-1);
-	A=elements(pos,1); B=elements(pos,2); C=elements(pos,3); D=elements(pos,4); E=elements(pos,5); F=elements(pos,6);
-	h3bis=patch( 'Faces', [A B C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
-	patch( 'Faces', [D E F],  'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
-	patch( 'Faces', [A B E D],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
-	patch( 'Faces', [B E F C],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
-	patch( 'Faces', [C A D F],'Vertices', [x y z],'FaceVertexCData', [1 1 1],'FaceColor','cyan','EdgeColor','black');
-
-	%display arrows pointing outward
-	xstart=mean(x(pressureload(:,1:end-2)),2);
-	ystart=mean(y(pressureload(:,1:end-2)),2);
-	zstart=mean(z(pressureload(:,1:end-2)),2);
-	length=sqrt((x(pressureload(:,1))-x(pressureload(:,2))).^2 + (y(pressureload(:,1))-y(pressureload(:,2))).^2 );
-	normal(:,1)=cos(atan2((x(pressureload(:,1))-x(pressureload(:,2))) , (y(pressureload(:,2))-y(pressureload(:,1)))));
-	normal(:,2)=sin(atan2((x(pressureload(:,1))-x(pressureload(:,2))) , (y(pressureload(:,2))-y(pressureload(:,1)))));
-	xend=xstart+length.*normal(:,1);
-	yend=ystart+length.*normal(:,2);
-	q=quiver3(xstart,ystart,zstart,xend-xstart,yend-ystart,zeros(numel(xstart),1)); hold on;
-	h4=plot3(xstart,ystart,zstart,'r*');
-end
-
-%legend (disable warnings)
-warning off
-legend([h2,h3,h3bis,q],'element on ice front (Water)','element on ice front (Air)','element on ice front (Ice)','normal vectors')
-warning on
-
-%apply options
-options=addfielddefault(options,'title','Neumann boundary conditions');
-options=addfielddefault(options,'colorbar',0);
-applyoptions(md,[],options);

Modified: issm/trunk/src/m/model/plot/plot_riftrelvel.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_riftrelvel.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plot_riftrelvel.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -22,7 +22,7 @@
 %set as NaN all velocities not on rifts
 u=NaN*ones(md.mesh.numberofvertices,1);
 v=NaN*ones(md.mesh.numberofvertices,1);
-for i=1:md.rifts.numrifts,
+for i=1:size(md.rifts.riftstruct,1),
 	penaltypairs=md.rifts.riftstruct(i).penaltypairs(:,[1 2]);
 	u(md.rifts.riftstruct(i).penaltypairs(:,1))=vx(penaltypairs(:,1))-vx(penaltypairs(:,2));
 	v(md.rifts.riftstruct(i).penaltypairs(:,1))=vy(penaltypairs(:,1))-vy(penaltypairs(:,2));
@@ -61,7 +61,7 @@
 for i=1:size(md.mesh.segments,1),
 	h1=plot(x(md.mesh.segments(i,1:2)),y(md.mesh.segments(i,1:2)),'b-');
 end
-for i=1:md.rifts.numrifts,
+for i=1:size(md.rifts.riftstruct,1),
 	
 	%get nodes on rift
 	penaltypairs=md.rifts.riftstruct(i).penaltypairs;

Modified: issm/trunk/src/m/model/plot/plot_rifts.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_rifts.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plot_rifts.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -16,7 +16,7 @@
 offset=getfieldvalue(options,'offset',500);
 if isstruct(md.rifts.riftstruct),
 	
-	for i=1:md.rifts.numrifts,
+	for i=1:size(md.rifts.riftstruct,1),
 		penaltypairs=md.rifts.riftstruct(i).penaltypairs;
 
 		normal=zeros(2,1);

Modified: issm/trunk/src/m/model/plot/plot_riftvel.m
===================================================================
--- issm/trunk/src/m/model/plot/plot_riftvel.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plot_riftvel.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -18,7 +18,7 @@
 %set as NaN all velocities not on rifts
 u=NaN*ones(md.mesh.numberofvertices,1);
 v=NaN*ones(md.mesh.numberofvertices,1);
-for i=1:md.rifts.numrifts,
+for i=1:size(md.rifts.riftstruct,1),
 	penaltypairs=md.rifts.riftstruct(i).penaltypairs(:,[1 2]);
 	u(penaltypairs(:))=md.initialization.vx(penaltypairs(:));
 	v(penaltypairs(:))=md.initialization.vy(penaltypairs(:));

Modified: issm/trunk/src/m/model/plot/plotdoc.m
===================================================================
--- issm/trunk/src/m/model/plot/plotdoc.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/plot/plotdoc.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -14,6 +14,7 @@
 disp('                  - ''basal_drag'': plot the basal drag on the bed (in kPa)');
 disp('                  - ''basal_dragx'' or ''basal_dragy'' : plot a component of the basal drag on the bed (in kPa)');
 disp('                  - ''boundaries'': this will draw all the segment boundaries to the model, including rifts.');
+disp('                  - ''icefront'': this will show segments that are used to define the icefront of the model (Neumann boundary conditions).');
 disp('                  - ''BC'': this will draw all the boundary conditions (Dirichlet and Neumann).');
 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');

Modified: issm/trunk/src/m/model/radarpower.m
===================================================================
--- issm/trunk/src/m/model/radarpower.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/radarpower.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -10,7 +10,7 @@
 %      md=radarpower(md)
 
 %If gdal does not work, uncomment the following line
-setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
+%setenv('LD_LIBRARY_PATH','/proj/ice/larour/issm/trunk/externalpackages/gdal/install/lib/');
 %Parse inputs
 if nargin==1,
 	options=pairoptions;

Modified: issm/trunk/src/m/model/solveparallel.m
===================================================================
--- issm/trunk/src/m/model/solveparallel.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/solveparallel.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -13,7 +13,7 @@
 
 	%First, build a runtime name that is unique, that we will use to create 
 	%directories, name jobs, etc ...
-	c=clock; md.private.runtimename=sprintf('%s-%i-%i-%i-%i-%i-%i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
+	c=clock; md.private.runtimename=sprintf('%s-%02i-%02i-%04i-%02i-%02i-%02i-%i',md.miscellaneous.name,c(2),c(3),c(1),c(4),c(5),floor(c(6)),feature('GetPid'));
 
 	if verLessThan('matlab', '7.6')
 		BuildQueueScript(cluster,md);


Property changes on: issm/trunk/src/m/model/solvers
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/model/solvers/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/model/solvers/Makefile.am)
===================================================================
--- issm/trunk/src/m/model/solvers/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/model/solvers/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/model/tres.m
===================================================================
--- issm/trunk/src/m/model/tres.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/model/tres.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,29 +9,17 @@
 
 if strcmpi(string,'diagnostic'),
 	if md.mesh.dimension==2,
-		if isfield(md.results.DiagnosticSolution,'VxAverage'),
-			md.initialization.vx=PatchToVec(md.results.DiagnosticSolution.VxAverage);
-		else
-			md.initialization.vx=PatchToVec(md.results.DiagnosticSolution.Vx);
-		end
-		if isfield(md.results.DiagnosticSolution,'VyAverage'),
-			md.initialization.vy=PatchToVec(md.results.DiagnosticSolution.VyAverage);
-		else
-			md.initialization.vy=PatchToVec(md.results.DiagnosticSolution.Vy);
-		end
+		md.initialization.vx=md.results.DiagnosticSolution.Vx;
+		md.initialization.vy=md.results.DiagnosticSolution.Vy;
 	else 
-		md.initialization.vx=PatchToVec(md.results.DiagnosticSolution.Vx);
-		md.initialization.vy=PatchToVec(md.results.DiagnosticSolution.Vy);
-		if isfield(md.results.DiagnosticSolution,'Vz'),
-			md.initialization.vz=PatchToVec(md.results.DiagnosticSolution.Vz);
-		else
-			md.initialization.vz=zeros(md.mesh.numberofvertices,1);
-		end
+		md.initialization.vx=md.results.DiagnosticSolution.Vx;
+		md.initialization.vy=md.results.DiagnosticSolution.Vy;
+		md.initialization.vz=md.results.DiagnosticSolution.Vz;
 	end
-	md.initialization.vel=PatchToVec(md.results.DiagnosticSolution.Vel);
+	md.initialization.vel=md.results.DiagnosticSolution.Vel;
 
 	if isfield(md.results.DiagnosticSolution,'Pressure'),
-		md.initialization.pressure=PatchToVec(md.results.DiagnosticSolution.Pressure);
+		md.initialization.pressure=md.results.DiagnosticSolution.Pressure;
 	end
 	if md.rifts.numrifts,
 		if isfield(md.results.DiagnosticSolution,'riftproperties'),
@@ -41,7 +29,7 @@
 	if md.inversion.iscontrol==1,
 		for control_parameters=md.inversion.control_parameters
 			%Will need to be updated... good luck ;)
-			md.(EnumToModelField(control_parameters))=PatchToVec(md.results.DiagnosticSolution.(EnumToString(control_parameters)));
+			md.(EnumToModelField(control_parameters))=md.results.DiagnosticSolution.(EnumToString(control_parameters));
 		end
 	end
 
@@ -58,12 +46,12 @@
 	count=1;
 	for i=1:length(results),
 		if ~isempty(md.results.TransientSolution(i).Vel),
-			results2(count).Vel=PatchToVec(md.results.TransientSolution(i).Vel);
-			results2(count).Surface=PatchToVec(md.results.TransientSolution(i).Surface);
-			results2(count).Thickness=PatchToVec(md.results.TransientSolution(i).Thickness);
-			results2(count).Bed=PatchToVec(md.results.TransientSolution(i).Bed);
-			results2(count).Vx=PatchToVec(md.results.TransientSolution(i).Vx);
-			results2(count).Vy=PatchToVec(md.results.TransientSolution(i).Vy);
+			results2(count).Vel=md.results.TransientSolution(i).Vel;
+			results2(count).Surface=md.results.TransientSolution(i).Surface;
+			results2(count).Thickness=md.results.TransientSolution(i).Thickness;
+			results2(count).Bed=md.results.TransientSolution(i).Bed;
+			results2(count).Vx=md.results.TransientSolution(i).Vx;
+			results2(count).Vy=md.results.TransientSolution(i).Vy;
 			results2(count).time=md.results.TransientSolution(i).time;
 			results2(count).step=md.results.TransientSolution(i).step;
 			if ~strcmpi(md.groundingline.migration,'None'),
@@ -75,28 +63,28 @@
 	md.results.TransientSolution=results2;
 	clear results,results2;
 elseif strcmpi(string,'steadystate'),
-	md.initialization.vx=PatchToVec(md.results.SteadystateSolution.Vx);
-	md.initialization.vy=PatchToVec(md.results.SteadystateSolution.Vy);
+	md.initialization.vx=md.results.SteadystateSolution.Vx;
+	md.initialization.vy=md.results.SteadystateSolution.Vy;
 	if isfield(md.results.SteadystateSolution,'Vz'),
-		md.initialization.vz=PatchToVec(md.results.SteadystateSolution.Vz);
+		md.initialization.vz=md.results.SteadystateSolution.Vz;
 	end
 
-	md.initialization.vel=PatchToVec(md.results.SteadystateSolution.Vel);
-	md.initialization.pressure=PatchToVec(md.results.SteadystateSolution.Pressure);
-	md.initialization.temperature=PatchToVec(md.results.SteadystateSolution.Temperature);
-	md.basalforcings.melting_rate=PatchToVec(md.results.SteadystateSolution.BasalforcingsMeltingRate);
+	md.initialization.vel=md.results.SteadystateSolution.Vel;
+	md.initialization.pressure=md.results.SteadystateSolution.Pressure;
+	md.initialization.temperature=md.results.SteadystateSolution.Temperature;
+	md.basalforcings.melting_rate=md.results.SteadystateSolution.BasalforcingsMeltingRate;
 
 	if md.inversion.iscontrol==1,
 		for control_parameters=md.inversion.control_parameters
-			md.(EnumToModelField(control_parameters))=PatchToVec(md.results.SteadystateSolution.(EnumToString(control_parameters)));
+			md.(EnumToModelField(control_parameters))=md.results.SteadystateSolution.(EnumToString(control_parameters));
 		end
 	end
 
 elseif strcmpi(string,'thermal'),
-	md.initialization.temperature=PatchToVec(md.results.ThermalSolution.Temperature);
-	md.basalforcings.melting_rate=PatchToVec(md.results.ThermalSolution.BasalMeltingRate);
+	md.initialization.temperature=md.results.ThermalSolution.Temperature;
+	md.basalforcings.melting_rate=md.results.ThermalSolution.BasalMeltingRate;
 elseif strcmpi(string,'hydrology'),
-	md.initialization.watercolumn=PatchToVec(md.results.HydrologySolution.Watercolumn);
+	md.initialization.watercolumn=md.results.HydrologySolution.Watercolumn;
 
 else 
 	error(['tres error message: analysis ' string ' not supported yet!']);


Property changes on: issm/trunk/src/m/planet
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/planet/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/planet/Makefile.am)
===================================================================
--- issm/trunk/src/m/planet/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/planet/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/qmu
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/qmu/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/qmu/Makefile.am)
===================================================================
--- issm/trunk/src/m/qmu/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/qmu/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/qmu/expandresponses.m
===================================================================
--- issm/trunk/src/m/qmu/expandresponses.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/qmu/expandresponses.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +1,5 @@
 function dresp=expandresponses(md,responses)
+%EXPANDRESPONSES - expand responses
 
 fnames=fieldnames(responses);
 


Property changes on: issm/trunk/src/m/shared
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/shared/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/shared/Makefile.am)
===================================================================
--- issm/trunk/src/m/shared/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/shared/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/solutions
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Modified: issm/trunk/src/m/solutions/AnalysisConfiguration.m
===================================================================
--- issm/trunk/src/m/solutions/AnalysisConfiguration.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solutions/AnalysisConfiguration.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -41,8 +41,8 @@
 		analyses=[BedSlopeAnalysisEnum];
 
 	case TransientSolutionEnum,
-		numanalyses=8; 
-		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;PrognosticAnalysisEnum];
+		numanalyses=9; 
+		analyses=[DiagnosticHorizAnalysisEnum;DiagnosticVertAnalysisEnum;DiagnosticHutterAnalysisEnum;SurfaceSlopeAnalysisEnum;BedSlopeAnalysisEnum;ThermalAnalysisEnum;MeltingAnalysisEnum;EnthalpyAnalysisEnum;PrognosticAnalysisEnum];
 
 	case FlaimSolutionEnum,
 		numanalyses=1; 

Copied: issm/trunk/src/m/solutions/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/solutions/Makefile.am)
===================================================================
--- issm/trunk/src/m/solutions/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/solutions/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/solutions/control_core.m
===================================================================
--- issm/trunk/src/m/solutions/control_core.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solutions/control_core.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -24,7 +24,7 @@
 
 	%Initialize misfits with a vector of zeros
 	J=zeros(nsteps,1);
-	search_scalar=0;
+	search_scalar=1;
 
 	%Get core from solution type
 	solutioncore=CorePointerFromSolutionEnum(femmodel.parameters,solution_type);
@@ -41,7 +41,7 @@
 		issmprintf(VerboseControl(),['control method step ' num2str(n) '/' num2str(femmodel.parameters.InversionNsteps)]);
 		femmodel.parameters.StepResponses=responses(n,:);
 
-		%In case we are running a steady state control method, compute new temperature field using new parameter distribution: 
+		%In steady state inversion, compute new temperature field now
 		if (solution_type==SteadystateSolutionEnum)
 			femmodel=steadystate_core(femmodel);
 		end
@@ -49,7 +49,7 @@
 		issmprintf(VerboseControl,'   compute adjoint state');
 		eval(['femmodel=' adjointcore '(femmodel);']);
 
-		femmodel=gradient_core(femmodel,n,search_scalar);
+		femmodel=gradient_core(femmodel,n-1,search_scalar==0);
 
 		%Return gradient if asked
 		if gradient_only,
@@ -82,6 +82,5 @@
 		femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,control_type(i));
 	end
 	femmodel.results=AddExternalResult(femmodel.results,JEnum,J);
-	%femmodel.results=AddExternalResult(femmodel.results,InversionControlParametersEnum,control_type);
 
 end %end function

Modified: issm/trunk/src/m/solutions/diagnostic_core.m
===================================================================
--- issm/trunk/src/m/solutions/diagnostic_core.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solutions/diagnostic_core.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -14,6 +14,7 @@
 	ishutter=femmodel.parameters.FlowequationIshutter;
 	ismacayealpattyn=femmodel.parameters.FlowequationIsmacayealpattyn;
 	isstokes=femmodel.parameters.FlowequationIsstokes;
+	isnewton=femmodel.parameters.DiagnosticIsnewton;
 	dakota_analysis=femmodel.parameters.QmuIsdakota;
 	control_analysis=femmodel.parameters.InversionIscontrol;
 	solution_type=femmodel.parameters.SolutionType;
@@ -52,7 +53,11 @@
 
 		issmprintf(VerboseSolution,'\n%s',['   computing horizontal velocities']);
 		femmodel=SetCurrentConfiguration(femmodel,DiagnosticHorizAnalysisEnum);
-		femmodel=solver_nonlinear(femmodel,modify_loads); 
+		if isnewton,
+			femmodel=solver_newton(femmodel); 
+		else
+			femmodel=solver_nonlinear(femmodel,modify_loads); 
+		end
 	end
 	
 	if ismacayealpattyn & isstokes,

Modified: issm/trunk/src/m/solutions/enthalpy_core.m
===================================================================
--- issm/trunk/src/m/solutions/enthalpy_core.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solutions/enthalpy_core.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -4,7 +4,6 @@
 %   Usage:
 %      femmodel=enthalpy_core(femmodel)
 
-
 	%recover parameters common to all solutions
 	ndt=femmodel.parameters.TimesteppingFinalTime;
 	dt=femmodel.parameters.TimesteppingTimeStep;
@@ -24,15 +23,13 @@
 		issmprintf(VerboseSolution,'\n%s%i/%i\n','time step: ',i,nsteps);
 		time=(i+1)*dt;
 
-		issmprintf(VerboseSolution,'\n%s',['   computing enthalpy']);
-		femmodel=SetCurrentConfiguration(femmodel,EnthalpyAnalysisEnum);
-		femmodel=solver_linear(femmodel);
+		femmodel=enthalpy_core_step(femmodel,i,time); 
 
 		if (solution_type==EnthalpySolutionEnum & ~control_analysis),
 			issmprintf(VerboseSolution,'\n%s',['   saving results']);
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,EnthalpyEnum,i,time);
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum,i,time);
-			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,WaterFractionEnum,i,time);
+			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,WaterfractionEnum,i,time);
 		end
 	end
 

Copied: issm/trunk/src/m/solutions/enthalpy_core_step.m (from rev 11526, issm/trunk-jpl/src/m/solutions/enthalpy_core_step.m)
===================================================================
--- issm/trunk/src/m/solutions/enthalpy_core_step.m	                        (rev 0)
+++ issm/trunk/src/m/solutions/enthalpy_core_step.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,14 @@
+function femmodel=enthalpy_core_step(femmodel,step,time)
+%ENTHALPY_CORE_STEP - core of the enthalpy solution for one step 
+%
+%   Usage:
+%      femmodel=enthalpy_core_step(femmodel,step,time)
+
+	%some parameters
+	modify_loads=true;
+
+	issmprintf(VerboseSolution,'\n%s',['   computing enthalpy']);
+	femmodel=SetCurrentConfiguration(femmodel,EnthalpyAnalysisEnum);
+	femmodel=solver_nonlinear(femmodel,modify_loads);
+
+end %end function

Modified: issm/trunk/src/m/solutions/gradient_core.m
===================================================================
--- issm/trunk/src/m/solutions/gradient_core.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solutions/gradient_core.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -10,50 +10,33 @@
 
 if nargin==3,
 	step=varargin{1};
-	search_scalar=varargin{2};
+	orthogonalize=varargin{2};
 elseif nargin==1
 	step=0;
-	search_scalar=0;;
+	orthogonalize=false;
 else
 	help gradient_core
 	error('bad usage');
 end
 
-	%recover parameters common to all solutions
-	num_controls=femmodel.parameters.InversionNumControlParameters;
-	control_type=femmodel.parameters.InversionControlParameters;
-	control_steady=femmodel.parameters.ControlSteady;
-	gradient_scaling_list=femmodel.parameters.InversionGradientScaling;
+issmprintf(VerboseControl,['   compute cost function gradient']);
+[grad norm_list]=Gradj(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
 
-	for i=1:num_controls,
+if orthogonalize,
+	issmprintf(VerboseControl,'%s',['   orthogonalization']);
+	old_gradient=ControlInputGetGradient(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters);
+	new_gradient=Orth(grad,old_gradient);
+else
+	new_gradient=grad;
+end
 
-		issmprintf(VerboseControl,['   compute gradient of J with respect to %s'],EnumToString(control_type(i)));
-		grad=Gradj(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,control_type(i));
+%Check that gradient is clean
+norm_grad=norm(new_gradient,inf);
+if(norm_grad<=0),     error(['||∂J/∂α||∞ = 0   gradient norm is zero']); end
+if(isnan(norm_grad)), error(['||∂J/∂α||∞ = NaN gradient norm is NaN' ]); end
 
-		if control_steady,
-			femmodel=diagnostic_core(femmodel);
-		end
+%plug back into inputs:
+[femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=ControlInputSetGradient(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,  femmodel.parameters,new_gradient);
 
-		if (step>1 && search_scalar==0),
-			issmprintf(VerboseControl,'%s',['   orthogonalization']);
-			old_gradient=ControlInputGetGradient(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,femmodel.parameters,control_type(i));
-			new_gradient=Orth(grad,old_gradient);
-		else
-			issmprintf(VerboseControl,'%s',['   normalizing direction']);
-			new_gradient=Orth(grad,[]);
-		end
-
-		 %Get scaling factor of current control:
-		 norm_grad=norm(new_gradient,inf);
-		 if(norm_grad<=0),     error(['||∂J/∂α||∞ = 0   gradient norm of J with respect to ' EnumToString(control_type(i))  ' is zero']); end
-		 if(isnan(norm_grad)), error(['||∂J/∂α||∞ = NaN gradient norm of J with respect to ' EnumToString(control_type(i))  ' is NaN' ]); end
-		 if(i==1 | (gradient_scaling_list(step,i)/norm_grad)<gradient_scaling) gradient_scaling=gradient_scaling_list(step,i)/norm_grad; end
-
-		%plug back into inputs:
-		[femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=ControlInputSetGradient(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,  femmodel.parameters,control_type(i),new_gradient);
-	end
-
-	%Scale all gradients
-	for i=1:num_controls,
-		[femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=ControlInputScaleGradient(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,  femmodel.parameters,control_type(i),gradient_scaling);
-	end
+%Scale all gradients
+[femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters]=ControlInputScaleGradient(femmodel.elements,femmodel.nodes, femmodel.vertices,femmodel.loads, femmodel.materials,  femmodel.parameters,norm_list,step);

Modified: issm/trunk/src/m/solutions/transient_core.m
===================================================================
--- issm/trunk/src/m/solutions/transient_core.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solutions/transient_core.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -18,6 +18,7 @@
 	isprognostic=femmodel.parameters.TransientIsprognostic;
 	isthermal=femmodel.parameters.TransientIsthermal;
 	isgroundingline=femmodel.parameters.TransientIsgroundingline;
+	isenthalpy=femmodel.parameters.ThermalIsenthalpy;
 	groundinglinemigration=femmodel.parameters.GroundinglineMigration;
 
 	%Initialize
@@ -56,7 +57,11 @@
 
 		if (isthermal & dim==3)
 			issmprintf(VerboseSolution,'\n%s',['   computing temperature']);
-			femmodel=thermal_core_step(femmodel); 
+			if (isenthalpy==0),
+				femmodel=thermal_core_step(femmodel); 
+			else
+				femmodel=enthalpy_core_step(femmodel); 
+			end
 		end
 
 		if (isdiagnostic)
@@ -89,6 +94,8 @@
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,SurfaceEnum,step,time);
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BedEnum,step,time);
 			if (dim==3 & isthermal), femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,TemperatureEnum,step,time);end
+			if (dim==3 & isenthalpy), femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,WaterfractionEnum,step,time);end
+			if (dim==3 & isenthalpy), femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,EnthalpyEnum,step,time);end
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,BasalforcingsMeltingRateEnum,step,time);
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,SurfaceforcingsMassBalanceEnum,step,time);
 			femmodel.elements=InputToResult(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,MaskElementonfloatingiceEnum,step,time);


Property changes on: issm/trunk/src/m/solvers
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/solvers/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/solvers/Makefile.am)
===================================================================
--- issm/trunk/src/m/solvers/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/solvers/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Copied: issm/trunk/src/m/solvers/solver_newton.m (from rev 11526, issm/trunk-jpl/src/m/solvers/solver_newton.m)
===================================================================
--- issm/trunk/src/m/solvers/solver_newton.m	                        (rev 0)
+++ issm/trunk/src/m/solvers/solver_newton.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,60 @@
+function femmodel=solver_newton(femmodel)
+%SOLVER_NEWTON - core solver of diagnostic run
+%
+%   Usage:
+%      [femmodel]=solver_newton(femmodel)
+
+	%Branch on partitioning schema requested
+	maxiter=femmodel.parameters.DiagnosticMaxiter;
+	configuration_type=femmodel.parameters.ConfigurationType;
+	[femmodel.nodes]=UpdateConstraints(femmodel.nodes,femmodel.constraints,femmodel.parameters);
+
+	%initialize solution vector
+	converged=0; count=1;
+
+	%Start non-linear iteration using input velocity: 
+	ug=GetSolutionFromInputs(femmodel.elements, femmodel.nodes, femmodel.vertices, femmodel.loads, femmodel.materials, femmodel.parameters);
+	uf=Reducevectorgtof( ug, femmodel.nodes,femmodel.parameters);
+
+	%Update the solution to make sure that vx and vxold are similar
+	[femmodel.elements femmodel.loads]=InputUpdateFromConstant(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,double(converged),ConvergedEnum);
+	[femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ug);
+
+	while(~converged),
+
+		%save pointer to old velocity
+		old_ug=ug;
+		old_uf=uf;
+
+		%Solver forward model
+		[K_ff,K_fs,p_f,df,kmax]=SystemMatrices(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
+		ys=CreateNodalConstraints(femmodel.nodes,configuration_type);
+		p_f=Reduceload( p_f, K_fs, ys);
+		issmprintf(VerboseSolver(),'%s%g','      condition number of stiffness matrix: ',condest(K_ff));
+		uf=Solver(K_ff,p_f,old_uf,df,femmodel.parameters);
+		ug=Mergesolutionfromftog( uf, ys, femmodel.nodes,femmodel.parameters); 
+		[femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ug);
+
+		%Check convergence
+		converged=convergence(K_ff,p_f,uf,old_uf,femmodel.parameters);
+		if(converged==1) break; end
+		if(count>maxiter),
+			issmprintf(true,'%s%i%s','      maximum number of iterations ',maxiter,' exceeded');
+			break;
+		end
+
+		%Prepare next iteration using Newton's method
+		[K_ff,K_fs,p_f,df,kmax]=SystemMatrices(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters);
+		ys=CreateNodalConstraints(femmodel.nodes,configuration_type);
+		p_f=Reduceload( p_f, K_fs, ys);
+		pJf=p_f-K_ff*uf;
+		Jff=CreateJacobianMatrix(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,kmax);
+		duf=Solver(Jff,pJf,[],[],femmodel.parameters);
+		uf=uf+duf;
+		ug=Mergesolutionfromftog(uf,ys,femmodel.nodes,femmodel.parameters); 
+		[femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,ug);
+
+		%increase count
+		count=count+1;
+	end
+end

Modified: issm/trunk/src/m/solvers/solver_nonlinear.m
===================================================================
--- issm/trunk/src/m/solvers/solver_nonlinear.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/solvers/solver_nonlinear.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -21,6 +21,7 @@
 	uf=Reducevectorgtof( ug, femmodel.nodes,femmodel.parameters);
 
 	%Update the solution to make sure that vx and vxold are similar
+	[femmodel.elements loads]=InputUpdateFromConstant(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,double(converged),ConvergedEnum);
 	[femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,ug);
 
 	while(~converged),
@@ -37,17 +38,17 @@
 		uf=Solver(K_ff,p_f,old_uf,df,femmodel.parameters);
 		ug= Mergesolutionfromftog( uf, ys, femmodel.nodes,femmodel.parameters); 
 
-		[femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,ug);
-		[loads,constraints_converged,num_unstable_constraints] =ConstraintsState( femmodel.elements,femmodel.nodes,femmodel.vertices,loads, femmodel.materials,femmodel.parameters);
-
-		issmprintf(VerboseConvergence(),'%s%i','      number of unstable constraints: ',num_unstable_constraints);
-
 		%Figure out if convergence have been reached
 		converged=convergence(K_ff,p_f,uf,old_uf,femmodel.parameters);
 
 		%add convergence status into  status
 		[femmodel.elements loads]=InputUpdateFromConstant(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,double(converged),ConvergedEnum);
 
+		[femmodel.elements,femmodel.materials]=InputUpdateFromSolution(femmodel.elements,femmodel.nodes,femmodel.vertices,loads,femmodel.materials,femmodel.parameters,ug);
+		[loads,constraints_converged,num_unstable_constraints] =ConstraintsState( femmodel.elements,femmodel.nodes,femmodel.vertices,loads, femmodel.materials,femmodel.parameters);
+
+		issmprintf(VerboseConvergence(),'%s%i','      number of unstable constraints: ',num_unstable_constraints);
+
 		%rift convergence
 		if ~constraints_converged,
 			if converged,


Property changes on: issm/trunk/src/m/utils
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile



Property changes on: issm/trunk/src/m/utils/Analysis
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Analysis/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Analysis/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Analysis/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Analysis/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Array
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Array/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Array/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Array/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Array/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/BC
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/BC/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/BC/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/BC/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/BC/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/utils/BC/SetIceSheetBC.m
===================================================================
--- issm/trunk/src/m/utils/BC/SetIceSheetBC.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/BC/SetIceSheetBC.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -33,14 +33,10 @@
 end
 
 %Create zeros basal melting rate and surface mass balance if not specified
-if isnan(md.surfaceforcings.accumulation_rate),
-	md.surfaceforcings.accumulation_rate=zeros(md.mesh.numberofvertices,1);
-	disp('      no surfaceforcings.accumulation_rate specified: values set as zero');
+if isnan(md.surfaceforcings.precipitation),
+	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+	disp('      no surfaceforcings.precipitation specified: values set as zero');
 end
-if isnan(md.surfaceforcings.ablation_rate),
-	md.surfaceforcings.ablation_rate=zeros(md.mesh.numberofvertices,1);
-	disp('      no surfaceforcings.ablation_rate specified: values set as zero');
-end
 if isnan(md.surfaceforcings.mass_balance),
 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
 	disp('      no surfaceforcings.mass_balance specified: values set as zero');

Modified: issm/trunk/src/m/utils/BC/SetIceShelfBC.m
===================================================================
--- issm/trunk/src/m/utils/BC/SetIceShelfBC.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/BC/SetIceShelfBC.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -63,16 +63,11 @@
 %plug onto model
 md.diagnostic.icefront=pressureload;
 
-%Create zeros basalforcings.melting_rate, surfaceforcings.ablation_rate, surfaceforcings.accumulation_rate
-% and surfaceforcings.mass_balance if not specified
-if isnan(md.surfaceforcings.accumulation_rate),
-	md.surfaceforcings.accumulation_rate=zeros(md.mesh.numberofvertices,1);
-	disp('      no surfaceforcings.accumulation_rate specified: values set as zero');
+%Create zeros basalforcings and surfaceforcings
+if isnan(md.surfaceforcings.precipitation),
+	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+	disp('      no surfaceforcings.precipitation specified: values set as zero');
 end
-if isnan(md.surfaceforcings.ablation_rate),
-	md.surfaceforcings.ablation_rate=zeros(md.mesh.numberofvertices,1);
-	disp('      no surfaceforcings.ablation_rate specified: values set as zero');
-end
 if isnan(md.surfaceforcings.mass_balance),
 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
 	disp('      no surfaceforcings.mass_balance specified: values set as zero');

Modified: issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m
===================================================================
--- issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/BC/SetMarineIceSheetBC.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -74,16 +74,11 @@
 md.diagnostic.icefront=pressureload;
 
 
-%Create zeros basalforcings.melting_rate, surfaceforcings.ablation_rate, surfaceforcings.accumulation_rate
-% and surfaceforcings.mass_balance if not specified
-if isnan(md.surfaceforcings.accumulation_rate),
-	md.surfaceforcings.accumulation_rate=zeros(md.mesh.numberofvertices,1);
-	disp('      no surfaceforcings.accumulation_rate specified: values set as zero');
+%Create zeros basalforcings and surfaceforcings
+if isnan(md.surfaceforcings.precipitation),
+	md.surfaceforcings.precipitation=zeros(md.mesh.numberofvertices,1);
+	disp('      no surfaceforcings.precipitation specified: values set as zero');
 end
-if isnan(md.surfaceforcings.ablation_rate),
-	md.surfaceforcings.ablation_rate=zeros(md.mesh.numberofvertices,1);
-	disp('      no surfaceforcings.ablation_rate specified: values set as zero');
-end
 if isnan(md.surfaceforcings.mass_balance),
 	md.surfaceforcings.mass_balance=zeros(md.mesh.numberofvertices,1);
 	disp('      no surfaceforcings.mass_balance specified: values set as zero');


Property changes on: issm/trunk/src/m/utils/Basins
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Basins/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Basins/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Basins/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Basins/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Cluster
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Cluster/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Cluster/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Cluster/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Cluster/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/DataProcessing
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/DataProcessing/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/DataProcessing/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/DataProcessing/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/DataProcessing/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Ecco3
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Ecco3/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Ecco3/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Ecco3/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Ecco3/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Exp
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Exp/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Exp/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Exp/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Exp/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Geometry
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Geometry/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Geometry/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Geometry/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Geometry/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/ImageProcessing
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/ImageProcessing/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/ImageProcessing/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/ImageProcessing/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/ImageProcessing/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Interp
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Interp/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Interp/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Interp/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Interp/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Kml
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Kml/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Kml/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Kml/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Kml/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/LatLong
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/LatLong/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/LatLong/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/LatLong/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/LatLong/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Copied: issm/trunk/src/m/utils/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,2 @@
+SUBDIRS = Analysis Array BC Basins Cluster DataProcessing Ecco3 Exp Geometry ImageProcessing Interp Kml LatLong Math Meca Mesh Miscellaneous Model Numerics OS Plot Shell String consistency qmu
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Math
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Math/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Math/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Math/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Math/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Meca
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Meca/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Meca/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Meca/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Meca/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Deleted: issm/trunk/src/m/utils/Meca/effective_value.m
===================================================================
--- issm/trunk/src/m/utils/Meca/effective_value.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/Meca/effective_value.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,18 +0,0 @@
-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);

Deleted: issm/trunk/src/m/utils/Meca/glen_coefficients.m
===================================================================
--- issm/trunk/src/m/utils/Meca/glen_coefficients.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/Meca/glen_coefficients.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,26 +0,0 @@
-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);
-


Property changes on: issm/trunk/src/m/utils/Mesh
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Mesh/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Mesh/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Mesh/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Mesh/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Miscellaneous
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Miscellaneous/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Miscellaneous/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Miscellaneous/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Miscellaneous/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Copied: issm/trunk/src/m/utils/Miscellaneous/issmdoc.m (from rev 11526, issm/trunk-jpl/src/m/utils/Miscellaneous/issmdoc.m)
===================================================================
--- issm/trunk/src/m/utils/Miscellaneous/issmdoc.m	                        (rev 0)
+++ issm/trunk/src/m/utils/Miscellaneous/issmdoc.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,15 @@
+%Quick documentation for ISSM
+
+%First get ISSM tier: 
+ISSM_TIER=issmtier;
+
+disp(sprintf('\n%s','  A comprehensive documentation is available on http://issm.jpl.nasa.gov'));
+disp(sprintf('\n%s','  Example: how to create a square ice shelf'));
+disp(sprintf('%s','	   go to ',ISSM_TIER,'/examples/SquareIceshelf'));
+disp(sprintf('%s','	   md=model;                                %creates a new empty model structure'));
+disp(sprintf('%s','	   md=triangle(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,DiagnosticSolutionEnum);   %generate the velocity field'));
+disp(sprintf('%s','	   plotmodel(md,''data'',md.results.DiagnosticSolution.Vel);    %displays the velocity (type plotdoc for plotmodel help)'));


Property changes on: issm/trunk/src/m/utils/Model
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Model/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Model/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Model/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Model/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Numerics
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Numerics/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Numerics/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Numerics/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Numerics/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/OS
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/OS/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/OS/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/OS/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/OS/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Copied: issm/trunk/src/m/utils/OS/ismumps.m (from rev 11526, issm/trunk-jpl/src/m/utils/OS/ismumps.m)
===================================================================
--- issm/trunk/src/m/utils/OS/ismumps.m	                        (rev 0)
+++ issm/trunk/src/m/utils/OS/ismumps.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,33 @@
+function flag=ismumps()
+%ISMUMPS - figure out if MUMPS package was compiled with ISSM
+%
+%   Usage:
+%       flag=ismumps();
+
+
+configfile=[issmtier() '/config.h'];
+if ~exist(configfile,'file'),
+	error(['File ' configfile ' not found. ISSM has not been configured yet!']);
+end
+
+%go through the file, and recover the line we want
+flag=2;
+fid=fopen(configfile,'r');
+if(fid==-1), error(['could not open file: ' configfile]); end
+
+while(true),
+	tline=fgets(fid);
+	if ~ischar(tline), break, end
+	if strncmp(tline,'/* #undef _HAVE_MUMPS_ */',25),
+		flag=0;
+		break;
+	end
+	if  strncmp(tline,'#define _HAVE_MUMPS_',20),
+		flag=1;
+		break;
+	end
+end
+fclose(fid);
+if flag==2,
+	error('could not determine whether MUMPS was or was not compiled');
+end


Property changes on: issm/trunk/src/m/utils/Plot
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Plot/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Plot/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Plot/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Plot/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/Shell
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/Shell/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/Shell/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/Shell/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/Shell/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/utils/Shell/issmdir.m
===================================================================
--- issm/trunk/src/m/utils/Shell/issmdir.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/Shell/issmdir.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -4,7 +4,11 @@
 %   Usage:
 %      ISSM_DIR=issmdir()
 
-ISSM_DIR =getenv('ISSM_DIR');
+if ~ispc,
+	ISSM_DIR =getenv('ISSM_DIR');
+else
+	ISSM_DIR =getenv('ISSM_DIR_WIN');
+end
 
 if (isempty(ISSM_DIR)),
 	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');

Modified: issm/trunk/src/m/utils/Shell/issmtier.m
===================================================================
--- issm/trunk/src/m/utils/Shell/issmtier.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/Shell/issmtier.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -4,7 +4,12 @@
 %   Usage:
 %      ISSM_TIER=issmtier()
 
-ISSM_TIER =getenv('ISSM_TIER');
+if ~ispc, 
+	ISSM_TIER =getenv('ISSM_TIER');
+else
+	ISSM_TIER =getenv('ISSM_TIER_WIN');
+	ISSM_TIER = ISSM_TIER(1:end-1); %shave off the last '/'
+end
 
 if (isempty(ISSM_TIER)),
 	error('issmdir error message: ''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!');


Property changes on: issm/trunk/src/m/utils/String
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/String/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/String/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/String/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/String/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/m/utils/consistency
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/consistency/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/consistency/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/consistency/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/consistency/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 

Modified: issm/trunk/src/m/utils/consistency/checkfield.m
===================================================================
--- issm/trunk/src/m/utils/consistency/checkfield.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/m/utils/consistency/checkfield.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -9,6 +9,7 @@
 %      - >=: greater or equal to provided value
 %      - <:  smallerthan provided value
 %      - <=: smaller or equal to provided value
+%      - < vec:  smallerthan provided values on each vertex
 %      - forcing: 1 if check forcing consistency (size and time)
 %      - values: cell of strings or vector of acceptable values
 %      - numel: list of acceptable number of elements
@@ -152,7 +153,7 @@
 	field2=reshape(field,prod(size(field)),1);
 	if any(field2>upperbound),
 		checkmessage(getfieldvalue(options,'message',...
-			['field ''' fieldname ''' should have values above ' num2str(upperbound)]));
+			['field ''' fieldname ''' should have values below ' num2str(upperbound)]));
 	end
 end
 if exist(options,'<')
@@ -160,7 +161,7 @@
 	field2=reshape(field,prod(size(field)),1);
 	if any(field2>=upperbound),
 		checkmessage(getfieldvalue(options,'message',...
-			['field ''' fieldname ''' should have values above ' num2str(upperbound)]));
+			['field ''' fieldname ''' should have values below ' num2str(upperbound(1))]));
 	end
 end
 


Property changes on: issm/trunk/src/m/utils/qmu
___________________________________________________________________
Added: svn:ignore
   + Makefile.in
Makefile


Copied: issm/trunk/src/m/utils/qmu/Makefile.am (from rev 11526, issm/trunk-jpl/src/m/utils/qmu/Makefile.am)
===================================================================
--- issm/trunk/src/m/utils/qmu/Makefile.am	                        (rev 0)
+++ issm/trunk/src/m/utils/qmu/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1 @@
+bin_SCRIPTS=*.m 


Property changes on: issm/trunk/src/mex
___________________________________________________________________
Modified: svn:ignore
   - Makefile
.ignore.txt
Makefile.in
*.mexa64
.deps

   + Makefile
.ignore.txt
Makefile.in
*.mexa64
.deps
*.exe
*.exp
*.lib
*.obj
*.mexw64
*.mexw64.manifest
*.mexw64.map
*.mexw32
*.mexw32.manifest
*.mexw32.map
*.exe.manifest


Modified: issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.cpp
===================================================================
--- issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -13,7 +13,6 @@
 	Loads      *loads      = NULL;
 	Materials  *materials  = NULL;
 	Parameters *parameters = NULL;
-	int         control_type;
 	Vec         gradient   = NULL;
 
 	/* output datasets: elements and loads*/
@@ -31,7 +30,6 @@
 	FetchMatlabData((DataSet**)&loads,LOADSIN);
 	FetchMatlabData((DataSet**)&materials,MATERIALS);
 	FetchMatlabData(&parameters,PARAMETERS);
-	FetchMatlabData(&control_type,CONTROLTYPE);
 
 	/*configure: */
 	elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
@@ -40,7 +38,7 @@
 	materials-> Configure(elements, loads, nodes,vertices, materials,parameters);
 
 	/*!core code:*/
-	ControlInputGetGradientx(&gradient,elements, nodes,vertices,loads, materials,parameters,control_type);
+	ControlInputGetGradientx(&gradient,elements, nodes,vertices,loads, materials,parameters);
 
 	/*write output datasets: */
 	WriteMatlabData(GRADIENT,gradient);
@@ -60,6 +58,6 @@
 void ControlInputGetGradientUsage(void)
 {
 	_printf_(true,"\n");
-	_printf_(true,"   usage: [gradient] = %s(elements,nodes,vertices,loads, materials,parameters,control_type);\n",__FUNCT__);
+	_printf_(true,"   usage: [gradient] = %s(elements,nodes,vertices,loads, materials,parameters);\n",__FUNCT__);
 	_printf_(true,"\n");
 }

Modified: issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.h
===================================================================
--- issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/ControlInputGetGradient/ControlInputGetGradient.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -22,7 +22,6 @@
 #define LOADSIN (mxArray*)prhs[3]
 #define MATERIALS (mxArray*)prhs[4]
 #define PARAMETERS (mxArray*)prhs[5]
-#define CONTROLTYPE (mxArray*)prhs[6]
 
 /* serial output macros: */
 #define GRADIENT (mxArray**)&plhs[0]
@@ -31,6 +30,6 @@
 #undef NLHS
 #define NLHS  1
 #undef NRHS
-#define NRHS  7
+#define NRHS  6
 
 #endif

Modified: issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.cpp
===================================================================
--- issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,14 +7,14 @@
 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
 
 /*input datasets: */
+int       step;
 Elements   *elements   = NULL;
 Nodes      *nodes      = NULL;
 Vertices   *vertices   = NULL;
 Loads      *loads      = NULL;
 Materials  *materials  = NULL;
 Parameters *parameters = NULL;
-int         control_type;
-double      scaling_factor;
+double     *norm_list  = NULL;
 
 /*Boot module: */
 MODULEBOOT();
@@ -29,8 +29,8 @@
 FetchMatlabData((DataSet**)&loads,LOADSIN);
 FetchMatlabData((DataSet**)&materials,MATERIALSIN);
 FetchMatlabData(&parameters,PARAMETERSIN);
-FetchMatlabData(&control_type,CONTROLTYPE);
-FetchMatlabData(&scaling_factor,SCALE);
+FetchMatlabData(&norm_list,NULL,NULL,NORMLIST);
+FetchMatlabData(&step,STEP);
 
 /*configure: */
 elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
@@ -38,7 +38,7 @@
 loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
 
 /*call "x" code layer*/
-ControlInputScaleGradientx(elements,nodes,vertices,loads, materials,parameters,control_type,scaling_factor);
+ControlInputScaleGradientx(elements,nodes,vertices,loads, materials,parameters,norm_list,step);
 
 /*write output datasets: */
 WriteMatlabData(ELEMENTS,elements);
@@ -63,6 +63,6 @@
 void ControlInputScaleGradientUsage(void)
 {
 	_printf_(true,"\n");
-	_printf_(true,"   usage: [elements,nodes,vertices,loads,materials,parameters] = %s(elements,nodes,vertices,loads,materials,control_type,scaling_factor);\n",__FUNCT__);
+	_printf_(true,"   usage: [elements,nodes,vertices,loads,materials,parameters] = %s(elements,nodes,vertices,loads,materials,norm_list,step);\n",__FUNCT__);
 	_printf_(true,"\n");
 }

Modified: issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.h
===================================================================
--- issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/ControlInputScaleGradient/ControlInputScaleGradient.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,8 +23,8 @@
 #define LOADSIN (mxArray*)prhs[3]
 #define MATERIALSIN (mxArray*)prhs[4]
 #define PARAMETERSIN (mxArray*)prhs[5]
-#define CONTROLTYPE (mxArray*)prhs[6]
-#define SCALE (mxArray*)prhs[7]
+#define NORMLIST (mxArray*)prhs[6]
+#define STEP (mxArray*)prhs[7]
 
 /* serial output macros: */
 #define ELEMENTS (mxArray**)&plhs[0]

Modified: issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.cpp
===================================================================
--- issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -13,7 +13,6 @@
 Loads      *loads      = NULL;
 Materials  *materials  = NULL;
 Parameters *parameters = NULL;
-int         control_type;
 double     *gradient   = NULL;
 
 /*Boot module: */
@@ -29,7 +28,6 @@
 FetchMatlabData((DataSet**)&loads,LOADSIN);
 FetchMatlabData((DataSet**)&materials,MATERIALSIN);
 FetchMatlabData(&parameters,PARAMETERSIN);
-FetchMatlabData(&control_type,CONTROLTYPE);
 FetchMatlabData(&gradient,NULL,GRADIENT);
 
 /*configure: */
@@ -38,7 +36,7 @@
 loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
 
 /*call "x" code layer*/
-ControlInputSetGradientx(elements,nodes,vertices,loads, materials,parameters,control_type,gradient);
+ControlInputSetGradientx(elements,nodes,vertices,loads, materials,parameters,gradient);
 
 /*write output datasets: */
 WriteMatlabData(ELEMENTS,elements);
@@ -63,6 +61,6 @@
 void ControlInputSetGradientUsage(void)
 {
 	_printf_(true,"\n");
-	_printf_(true,"   usage: [elements,nodes,vertices,loads,materials,parameters] = %s(elements,nodes,vertices,loads,materials,control_type,gradient);\n",__FUNCT__);
+	_printf_(true,"   usage: [elements,nodes,vertices,loads,materials,parameters] = %s(elements,nodes,vertices,loads,materials,gradient);\n",__FUNCT__);
 	_printf_(true,"\n");
 }

Modified: issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.h
===================================================================
--- issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/ControlInputSetGradient/ControlInputSetGradient.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,8 +23,7 @@
 #define LOADSIN (mxArray*)prhs[3]
 #define MATERIALSIN (mxArray*)prhs[4]
 #define PARAMETERSIN (mxArray*)prhs[5]
-#define CONTROLTYPE (mxArray*)prhs[6]
-#define GRADIENT (mxArray*)prhs[7]
+#define GRADIENT (mxArray*)prhs[6]
 
 /* serial output macros: */
 #define ELEMENTS (mxArray**)&plhs[0]
@@ -38,6 +37,6 @@
 #undef NLHS
 #define NLHS  6
 #undef NRHS
-#define NRHS  8
+#define NRHS  7
 
 #endif

Deleted: issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp
===================================================================
--- issm/trunk-jpl/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,66 +0,0 @@
-/*\file CreateJacobianMatrix.c
- *\brief: build system matrices (stiffness matrix, loads vector)
- */
-
-#include "./CreateJacobianMatrix.h"
-
-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
-
-	/*input datasets: */
-	Elements   *elements   = NULL;
-	Nodes      *nodes      = NULL;
-	Vertices   *vertices   = NULL;
-	Loads      *loads      = NULL;
-	Materials  *materials  = NULL;
-	Parameters *parameters = NULL;
-	double kmax;
-	
-	/* output datasets: */
-	Mat    Jff  = NULL;
-
-	/*Boot module: */
-	MODULEBOOT();
-
-	/*checks on arguments on the matlab side: */
-	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&CreateJacobianMatrixUsage);
-
-	/*Input datasets: */
-	FetchMatlabData((DataSet**)&elements,ELEMENTS);
-	FetchMatlabData((DataSet**)&nodes,NODES);
-	FetchMatlabData((DataSet**)&vertices,VERTICES);
-	FetchMatlabData((DataSet**)&loads,LOADS);
-	FetchMatlabData((DataSet**)&materials,MATERIALS);
-	FetchMatlabData(&parameters,PARAMETERS);
-	FetchMatlabData(&kmax,KMAX);
-
-	/*configure: */
-	elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
-	nodes->     Configure(elements,loads, nodes,vertices, materials,parameters);
-	loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
-	materials-> Configure(elements, loads, nodes,vertices, materials,parameters);
-
-	/*!Generate internal degree of freedom numbers: */
-	CreateJacobianMatrixx(&Jff,elements,nodes,vertices,loads,materials,parameters,kmax);
-
-	/*write output datasets: */
-	WriteMatlabData(JFF,Jff);
-	
-	/*Free ressources: */
-	delete elements;
-	delete nodes;
-	delete vertices;
-	delete loads;
-	delete materials;
-	delete parameters;
-	MatFree(&Jff);
-
-	/*end module: */
-	MODULEEND();
-}
-
-void CreateJacobianMatrixUsage(void)
-{
-	_printf_(true,"\n");
-	_printf_(true,"   usage: [Jff] = %s(elements,nodes,vertices,loads,materials,parameters,kmax);\n",__FUNCT__);
-	_printf_(true,"\n");
-}

Copied: issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp (from rev 11526, issm/trunk-jpl/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp)
===================================================================
--- issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp	                        (rev 0)
+++ issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,66 @@
+/*\file CreateJacobianMatrix.c
+ *\brief: build system matrices (stiffness matrix, loads vector)
+ */
+
+#include "./CreateJacobianMatrix.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*input datasets: */
+	Elements   *elements   = NULL;
+	Nodes      *nodes      = NULL;
+	Vertices   *vertices   = NULL;
+	Loads      *loads      = NULL;
+	Materials  *materials  = NULL;
+	Parameters *parameters = NULL;
+	double kmax;
+	
+	/* output datasets: */
+	Mat    Jff  = NULL;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&CreateJacobianMatrixUsage);
+
+	/*Input datasets: */
+	FetchMatlabData((DataSet**)&elements,ELEMENTS);
+	FetchMatlabData((DataSet**)&nodes,NODES);
+	FetchMatlabData((DataSet**)&vertices,VERTICES);
+	FetchMatlabData((DataSet**)&loads,LOADS);
+	FetchMatlabData((DataSet**)&materials,MATERIALS);
+	FetchMatlabData(&parameters,PARAMETERS);
+	FetchMatlabData(&kmax,KMAX);
+
+	/*configure: */
+	elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
+	nodes->     Configure(elements,loads, nodes,vertices, materials,parameters);
+	loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
+	materials-> Configure(elements, loads, nodes,vertices, materials,parameters);
+
+	/*!Generate internal degree of freedom numbers: */
+	CreateJacobianMatrixx(&Jff,elements,nodes,vertices,loads,materials,parameters,kmax);
+
+	/*write output datasets: */
+	WriteMatlabData(JFF,Jff);
+	
+	/*Free ressources: */
+	delete elements;
+	delete nodes;
+	delete vertices;
+	delete loads;
+	delete materials;
+	delete parameters;
+	MatFree(&Jff);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void CreateJacobianMatrixUsage(void)
+{
+	_printf_(true,"\n");
+	_printf_(true,"   usage: [Jff] = %s(elements,nodes,vertices,loads,materials,parameters,kmax);\n",__FUNCT__);
+	_printf_(true,"\n");
+}

Deleted: issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h
===================================================================
--- issm/trunk-jpl/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,37 +0,0 @@
-/*
-	CreateJacobianMatrix.h
-*/
-
-#ifndef _CREATEJACOBIANMATRIX_H
-#define _CREATEJACOBIANMATRIX_H
-
-/* local prototypes: */
-void CreateJacobianMatrixUsage(void);
-
-#include "../../c/modules/modules.h"
-#include "../../c/Container/Container.h"
-#include "../../c/shared/shared.h"
-#include "../../c/EnumDefinitions/EnumDefinitions.h"
-
-#undef __FUNCT__ 
-#define __FUNCT__  "CreateJacobianMatrix"
-
-/* serial input macros: */
-#define ELEMENTS     (mxArray *)prhs[0]
-#define NODES        (mxArray *)prhs[1]
-#define VERTICES     (mxArray *)prhs[2]
-#define LOADS        (mxArray *)prhs[3]
-#define MATERIALS    (mxArray *)prhs[4]
-#define PARAMETERS   (mxArray *)prhs[5]
-#define KMAX         (mxArray *)prhs[6]
-
-/* serial output macros: */
-#define JFF  (mxArray**)&plhs[0]
-
-/* serial arg counts: */
-#undef NLHS
-#define NLHS  1
-#undef NRHS
-#define NRHS  7
-
-#endif  /* _CREATEJACOBIANMATRIX_H*/

Copied: issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h (from rev 11526, issm/trunk-jpl/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h)
===================================================================
--- issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h	                        (rev 0)
+++ issm/trunk/src/mex/CreateJacobianMatrix/CreateJacobianMatrix.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,37 @@
+/*
+	CreateJacobianMatrix.h
+*/
+
+#ifndef _CREATEJACOBIANMATRIX_H
+#define _CREATEJACOBIANMATRIX_H
+
+/* local prototypes: */
+void CreateJacobianMatrixUsage(void);
+
+#include "../../c/modules/modules.h"
+#include "../../c/Container/Container.h"
+#include "../../c/shared/shared.h"
+#include "../../c/EnumDefinitions/EnumDefinitions.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "CreateJacobianMatrix"
+
+/* serial input macros: */
+#define ELEMENTS     (mxArray *)prhs[0]
+#define NODES        (mxArray *)prhs[1]
+#define VERTICES     (mxArray *)prhs[2]
+#define LOADS        (mxArray *)prhs[3]
+#define MATERIALS    (mxArray *)prhs[4]
+#define PARAMETERS   (mxArray *)prhs[5]
+#define KMAX         (mxArray *)prhs[6]
+
+/* serial output macros: */
+#define JFF  (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  7
+
+#endif  /* _CREATEJACOBIANMATRIX_H*/

Modified: issm/trunk/src/mex/Gradj/Gradj.cpp
===================================================================
--- issm/trunk/src/mex/Gradj/Gradj.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/Gradj/Gradj.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,7 +7,8 @@
 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
 
 	/*input datasets: */
-	int         control_type;
+	int         control_index,num_controls;
+	double     *norm_list    = NULL;
 	Elements   *elements     = NULL;
 	Nodes      *nodes        = NULL;
 	Vertices   *vertices     = NULL;
@@ -31,7 +32,7 @@
 	FetchMatlabData((DataSet**)&loads,LOADS);
 	FetchMatlabData((DataSet**)&materials,MATERIALS);
 	FetchMatlabData(&parameters,PARAMETERS);
-	FetchMatlabData(&control_type,CONTROLTYPE);
+	parameters->FindParam(&num_controls,InversionNumControlParametersEnum); 
 
 	/*configure: */
 	elements->  Configure(elements,loads, nodes,vertices, materials,parameters);
@@ -39,9 +40,10 @@
 	loads->     Configure(elements, loads, nodes,vertices, materials,parameters);
 
 	/*!Call core code: */
-	Gradjx(&gradient, elements,nodes, vertices,loads, materials,parameters, control_type);
+	Gradjx(&gradient,&norm_list,elements,nodes, vertices,loads, materials,parameters);
 
 	/*write output : */
+	WriteMatlabData(NORMLIST,norm_list,num_controls,1);
 	WriteMatlabData(GRADG,gradient);
 
 	/*Free ressources: */

Modified: issm/trunk/src/mex/Gradj/Gradj.h
===================================================================
--- issm/trunk/src/mex/Gradj/Gradj.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/Gradj/Gradj.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,15 +23,15 @@
 #define LOADS (mxArray*)prhs[3]
 #define MATERIALS (mxArray*)prhs[4]
 #define PARAMETERS (mxArray*)prhs[5]
-#define CONTROLTYPE (mxArray*)prhs[6]
 
 /* serial output macros: */
 #define GRADG (mxArray**)&plhs[0]
+#define NORMLIST (mxArray**)&plhs[1]
 
 /* serial arg counts: */
 #undef NLHS
-#define NLHS  1
+#define NLHS  2
 #undef NRHS
-#define NRHS  7
+#define NRHS  6
 
 #endif  /* _GRADJ_H */

Deleted: issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp
===================================================================
--- issm/trunk-jpl/src/mex/KMLFileRead/KMLFileRead.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,151 +0,0 @@
-/*\file KMLFileRead.c
- *\brief: KML file reader module.
- */
-#include "./KMLFileRead.h"
-
-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
-
-	int i,j,nnodes=0,verbose=1;
-	KML_Object* kobj;
-
-	/*input: */
-	char*   name=NULL;
-
-	char*   notes=NULL;
-	const mxArray* notesi;
-	mwIndex        nindex;
-
-	int*    elem=NULL;
-	int     melem=0,nelem=0;
-
-	int*    nodecon=NULL;
-	int     mncon=0,nncon=0;
-
-	double* lat=NULL;
-	int     mlat=0,nlat=0,llat=0;
-
-	double* lng=NULL;
-	int     mlng=0,nlng=0,llng=0;
-
-	int     nparts=0;
-
-	int*    part=NULL;
-	int     mprt=0,nprt=0,lprt=0;
-
-	double* data=NULL;
-	int     mdata=0,ndata=0;
-
-	double* cmap=NULL;
-	int     mcmap=0,ncmap=0;
-
-	char*   filnam=NULL;
-
-	FILE*   fidi=NULL;
-	FILE*   fido=NULL;
-
-	Options* options=NULL;
-	char*    echo    =NULL;
-	char*    deepecho=NULL;
-	char*    write   =NULL;
-
-	/* output: */
-	int     ierror=0;
-
-	/*Boot module: */
-	MODULEBOOT();
-
-	/*checks on arguments on the matlab side: */
-	if (nlhs > NLHS) {
-		KMLFileReadUsage();
-		_error_("KMLFileRead usage error");
-	}
-	if (nrhs < NRHS) {
-		KMLFileReadUsage();
-		_error_("KMLFileRead usage error");
-	}
-
-	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
-	FetchMatlabData(&filnam,FILENAME);
-	if (verbose) printf("  filnam =\"%s\"\n",filnam);
-
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
-	options->Get(&echo    ,"echo"    ,"off");
-	options->Get(&deepecho,"deepecho","off");
-	options->Get(&write   ,"write"   ,"off");
-
-	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
-	if (!strlen(filnam))
-		strcpy(filnam,"stdout");
-
-	if (verbose) printf("Opening file \"%s\".\n",filnam);
-	fidi=fopen(filnam,"r");
-
-	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
-	kobj=KMLFileReadx(fidi);
-
-	if (verbose) printf("Closing file \"%s\".\n",filnam);
-	fclose(fidi);
-
-	if (kobj) {
-		if (!strncmp(echo    ,"on",2) || !strncmp(echo    ,"y",1))
-			kobj->Echo();
-		if (!strncmp(deepecho,"on",2) || !strncmp(deepecho,"y",1))
-			kobj->DeepEcho();
-		if (strncmp(write,"off",3) && strncmp(write,"no",2)) {
-			if (!strncmp(write,"on",2) || !strncmp(write,"yes",3) || !strncmp(write,"stdout",6)) {
-				kobj->Write(stdout,"");
-			}
-			else {
-				if (verbose) printf("Opening file \"%s\".\n",write);
-				fido=fopen(write,"w");
-				kobj->Write(fido,"");
-				if (verbose) printf("Closing file \"%s\".\n",write);
-				ierror=fclose(fido);
-			}
-		}
-
-		delete kobj;
-	}
-
-	/*Write data: */
-	WriteMatlabData(ERRORFLAG,ierror);
-
-	/*Clean-up*/
-	xfree((void**)&write);
-	xfree((void**)&deepecho);
-	xfree((void**)&echo);
-	delete options;
-
-	/*end module: */
-	MODULEEND();
-}
-
-void KMLFileReadUsage(void)
-{
-	_printf_(true,"KMLFileRead - KML file reader module:\n");
-	_printf_(true,"\n");
-	_printf_(true,"   This module reads a KML file.\n");
-	_printf_(true,"\n");
-	_printf_(true,"   Usage:\n");
-	_printf_(true,"      [ierror]=KMLFileRead(kmlfile,'param name',param,...);\n");
-	_printf_(true,"\n");
-	_printf_(true,"      kmlfile      file name of kml file to be read (char)\n");
-	_printf_(true,"\n");
-	_printf_(true,"      echo         echo command (char, optional, 'off'/'on')\n");
-	_printf_(true,"      deepecho     deep echo command (char, optional, 'off'/'on')\n");
-	_printf_(true,"      write        write command (char, optional, 'off'/'stdout'/kmlfile)\n");
-	_printf_(true,"\n");
-	_printf_(true,"      ierror       return code (non-zero for error)\n");
-	_printf_(true,"\n");
-	_printf_(true,"   Examples:\n");
-	_printf_(true,"      [ierror]=KMLFileRead('file.kml','deepecho','on');\n");
-	_printf_(true,"      [ierror]=KMLFileRead('filin.kml','echo','on','write','filout.kml');\n");
-	_printf_(true,"\n");
-}
-

Copied: issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp (from rev 11526, issm/trunk-jpl/src/mex/KMLFileRead/KMLFileRead.cpp)
===================================================================
--- issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp	                        (rev 0)
+++ issm/trunk/src/mex/KMLFileRead/KMLFileRead.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,151 @@
+/*\file KMLFileRead.c
+ *\brief: KML file reader module.
+ */
+#include "./KMLFileRead.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	int i,j,nnodes=0,verbose=1;
+	KML_Object* kobj;
+
+	/*input: */
+	char*   name=NULL;
+
+	char*   notes=NULL;
+	const mxArray* notesi;
+	mwIndex        nindex;
+
+	int*    elem=NULL;
+	int     melem=0,nelem=0;
+
+	int*    nodecon=NULL;
+	int     mncon=0,nncon=0;
+
+	double* lat=NULL;
+	int     mlat=0,nlat=0,llat=0;
+
+	double* lng=NULL;
+	int     mlng=0,nlng=0,llng=0;
+
+	int     nparts=0;
+
+	int*    part=NULL;
+	int     mprt=0,nprt=0,lprt=0;
+
+	double* data=NULL;
+	int     mdata=0,ndata=0;
+
+	double* cmap=NULL;
+	int     mcmap=0,ncmap=0;
+
+	char*   filnam=NULL;
+
+	FILE*   fidi=NULL;
+	FILE*   fido=NULL;
+
+	Options* options=NULL;
+	char*    echo    =NULL;
+	char*    deepecho=NULL;
+	char*    write   =NULL;
+
+	/* output: */
+	int     ierror=0;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	if (nlhs > NLHS) {
+		KMLFileReadUsage();
+		_error_("KMLFileRead usage error");
+	}
+	if (nrhs < NRHS) {
+		KMLFileReadUsage();
+		_error_("KMLFileRead usage error");
+	}
+
+	/*Input datasets: */
+	if (verbose) printf("Fetching inputs:\n");
+	FetchMatlabData(&filnam,FILENAME);
+	if (verbose) printf("  filnam =\"%s\"\n",filnam);
+
+	if (verbose) printf("Parsing options:\n");
+	options=new Options(NRHS,nrhs,prhs);
+	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
+	options->Get(&echo    ,"echo"    ,"off");
+	options->Get(&deepecho,"deepecho","off");
+	options->Get(&write   ,"write"   ,"off");
+
+	/*some checks*/
+	if (verbose) printf("Checking inputs:\n");
+
+	if (!strlen(filnam))
+		strcpy(filnam,"stdout");
+
+	if (verbose) printf("Opening file \"%s\".\n",filnam);
+	fidi=fopen(filnam,"r");
+
+	/* Run core computations: */
+	if (verbose) printf("Calling core:\n");
+	kobj=KMLFileReadx(fidi);
+
+	if (verbose) printf("Closing file \"%s\".\n",filnam);
+	fclose(fidi);
+
+	if (kobj) {
+		if (!strncmp(echo    ,"on",2) || !strncmp(echo    ,"y",1))
+			kobj->Echo();
+		if (!strncmp(deepecho,"on",2) || !strncmp(deepecho,"y",1))
+			kobj->DeepEcho();
+		if (strncmp(write,"off",3) && strncmp(write,"no",2)) {
+			if (!strncmp(write,"on",2) || !strncmp(write,"yes",3) || !strncmp(write,"stdout",6)) {
+				kobj->Write(stdout,"");
+			}
+			else {
+				if (verbose) printf("Opening file \"%s\".\n",write);
+				fido=fopen(write,"w");
+				kobj->Write(fido,"");
+				if (verbose) printf("Closing file \"%s\".\n",write);
+				ierror=fclose(fido);
+			}
+		}
+
+		delete kobj;
+	}
+
+	/*Write data: */
+	WriteMatlabData(ERRORFLAG,ierror);
+
+	/*Clean-up*/
+	xfree((void**)&write);
+	xfree((void**)&deepecho);
+	xfree((void**)&echo);
+	delete options;
+
+	/*end module: */
+	MODULEEND();
+}
+
+void KMLFileReadUsage(void)
+{
+	_printf_(true,"KMLFileRead - KML file reader module:\n");
+	_printf_(true,"\n");
+	_printf_(true,"   This module reads a KML file.\n");
+	_printf_(true,"\n");
+	_printf_(true,"   Usage:\n");
+	_printf_(true,"      [ierror]=KMLFileRead(kmlfile,'param name',param,...);\n");
+	_printf_(true,"\n");
+	_printf_(true,"      kmlfile      file name of kml file to be read (char)\n");
+	_printf_(true,"\n");
+	_printf_(true,"      echo         echo command (char, optional, 'off'/'on')\n");
+	_printf_(true,"      deepecho     deep echo command (char, optional, 'off'/'on')\n");
+	_printf_(true,"      write        write command (char, optional, 'off'/'stdout'/kmlfile)\n");
+	_printf_(true,"\n");
+	_printf_(true,"      ierror       return code (non-zero for error)\n");
+	_printf_(true,"\n");
+	_printf_(true,"   Examples:\n");
+	_printf_(true,"      [ierror]=KMLFileRead('file.kml','deepecho','on');\n");
+	_printf_(true,"      [ierror]=KMLFileRead('filin.kml','echo','on','write','filout.kml');\n");
+	_printf_(true,"\n");
+}
+

Deleted: issm/trunk/src/mex/KMLFileRead/KMLFileRead.h
===================================================================
--- issm/trunk-jpl/src/mex/KMLFileRead/KMLFileRead.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/KMLFileRead/KMLFileRead.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,31 +0,0 @@
-/*!\file KMLFileRead.h
- * \brief: prototype for KML file reader mex module.
- */
-
-#ifndef _KMLFILEREAD_H
-#define _KMLFILEREAD_H
-
-/* local prototypes: */
-void KMLFileReadUsage(void);
-
-#include "../../c/modules/modules.h"
-#include "../../c/Container/Container.h"
-#include "../../c/shared/shared.h"
-
-#undef __FUNCT__ 
-#define __FUNCT__  "KMLFileRead"
-
-
-/* serial input macros: */
-#define FILENAME      prhs[0]
-
-/* serial output macros: */
-#define ERRORFLAG (mxArray**)&plhs[0]
-
-/* serial arg counts: */
-#undef NRHS
-#define NRHS  1
-#undef NLHS
-#define NLHS  1
-
-#endif

Copied: issm/trunk/src/mex/KMLFileRead/KMLFileRead.h (from rev 11526, issm/trunk-jpl/src/mex/KMLFileRead/KMLFileRead.h)
===================================================================
--- issm/trunk/src/mex/KMLFileRead/KMLFileRead.h	                        (rev 0)
+++ issm/trunk/src/mex/KMLFileRead/KMLFileRead.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,31 @@
+/*!\file KMLFileRead.h
+ * \brief: prototype for KML file reader mex module.
+ */
+
+#ifndef _KMLFILEREAD_H
+#define _KMLFILEREAD_H
+
+/* local prototypes: */
+void KMLFileReadUsage(void);
+
+#include "../../c/modules/modules.h"
+#include "../../c/Container/Container.h"
+#include "../../c/shared/shared.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "KMLFileRead"
+
+
+/* serial input macros: */
+#define FILENAME      prhs[0]
+
+/* serial output macros: */
+#define ERRORFLAG (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NRHS
+#define NRHS  1
+#undef NLHS
+#define NLHS  1
+
+#endif

Deleted: issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.cpp
===================================================================
--- issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,151 +0,0 @@
-/*\file KMLFileRead.c
- *\brief: KML file reader module.
- */
-#include "./KMLFileRead.h"
-
-void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
-
-	int i,j,nnodes=0,verbose=1;
-	KML_Object* kobj;
-
-	/*input: */
-	char*   name=NULL;
-
-	char*   notes=NULL;
-	const mxArray* notesi;
-	mwIndex        nindex;
-
-	int*    elem=NULL;
-	int     melem=0,nelem=0;
-
-	int*    nodecon=NULL;
-	int     mncon=0,nncon=0;
-
-	double* lat=NULL;
-	int     mlat=0,nlat=0,llat=0;
-
-	double* lng=NULL;
-	int     mlng=0,nlng=0,llng=0;
-
-	int     nparts=0;
-
-	int*    part=NULL;
-	int     mprt=0,nprt=0,lprt=0;
-
-	double* data=NULL;
-	int     mdata=0,ndata=0;
-
-	double* cmap=NULL;
-	int     mcmap=0,ncmap=0;
-
-	char*   filnam=NULL;
-
-	FILE*   fidi=NULL;
-	FILE*   fido=NULL;
-
-	Options* options=NULL;
-	char*    echo    =NULL;
-	char*    deepecho=NULL;
-	char*    write   =NULL;
-
-	/* output: */
-	int     ierror=0;
-
-	/*Boot module: */
-	MODULEBOOT();
-
-	/*checks on arguments on the matlab side: */
-	if (nlhs > NLHS) {
-		KMLFileReadUsage();
-		_error_("KMLFileRead usage error");
-	}
-	if (nrhs < NRHS) {
-		KMLFileReadUsage();
-		_error_("KMLFileRead usage error");
-	}
-
-	/*Input datasets: */
-	if (verbose) printf("Fetching inputs:\n");
-	FetchMatlabData(&filnam,FILENAME);
-	if (verbose) printf("  filnam =\"%s\"\n",filnam);
-
-	if (verbose) printf("Parsing options:\n");
-	options=new Options(NRHS,nrhs,prhs);
-	if (options->Size()) for(i=0;i<options->Size();i++) ((Option*)options->GetObjectByOffset(i))->DeepEcho();
-	options->Get(&echo    ,"echo"    ,"off");
-	options->Get(&deepecho,"deepecho","off");
-	options->Get(&write   ,"write"   ,"off");
-
-	/*some checks*/
-	if (verbose) printf("Checking inputs:\n");
-
-	if (!strlen(filnam))
-		strcpy(filnam,"stdout");
-
-	if (verbose) printf("Opening file \"%s\".\n",filnam);
-	fidi=fopen(filnam,"r");
-
-	/* Run core computations: */
-	if (verbose) printf("Calling core:\n");
-	kobj=KMLFileReadx(fidi);
-
-	if (verbose) printf("Closing file \"%s\".\n",filnam);
-	fclose(fidi);
-
-	if (kobj) {
-		if (!strncmp(echo    ,"on",2) || !strncmp(echo    ,"y",1))
-			kobj->Echo();
-		if (!strncmp(deepecho,"on",2) || !strncmp(deepecho,"y",1))
-			kobj->DeepEcho();
-		if (strncmp(write,"off",3) && strncmp(write,"no",2)) {
-			if (!strncmp(write,"on",2) || !strncmp(write,"yes",3) || !strncmp(write,"stdout",6)) {
-				kobj->Write(stdout,"");
-			}
-			else {
-				if (verbose) printf("Opening file \"%s\".\n",write);
-				fido=fopen(write,"w");
-				kobj->Write(fido,"");
-				if (verbose) printf("Closing file \"%s\".\n",write);
-				ierror=fclose(fido);
-			}
-		}
-
-		delete kobj;
-	}
-
-	/*Write data: */
-	WriteMatlabData(ERRORFLAG,ierror);
-
-	/*Clean-up*/
-	xfree((void**)&write);
-	xfree((void**)&deepecho);
-	xfree((void**)&echo);
-	delete options;
-
-	/*end module: */
-	MODULEEND();
-}
-
-void KMLFileReadUsage(void)
-{
-	_printf_(true,"KMLFileRead - KML file reader module:\n");
-	_printf_(true,"\n");
-	_printf_(true,"   This module reads a KML file.\n");
-	_printf_(true,"\n");
-	_printf_(true,"   Usage:\n");
-	_printf_(true,"      [ierror]=KMLFileRead(kmlfile,'param name',param,...);\n");
-	_printf_(true,"\n");
-	_printf_(true,"      kmlfile      file name of kml file to be read (char)\n");
-	_printf_(true,"\n");
-	_printf_(true,"      echo         echo command (char, optional, 'off'/'on')\n");
-	_printf_(true,"      deepecho     deep echo command (char, optional, 'off'/'on')\n");
-	_printf_(true,"      write        write command (char, optional, 'off'/'stdout'/kmlfile)\n");
-	_printf_(true,"\n");
-	_printf_(true,"      ierror       return code (non-zero for error)\n");
-	_printf_(true,"\n");
-	_printf_(true,"   Examples:\n");
-	_printf_(true,"      [ierror]=KMLFileRead('file.kml','deepecho','on');\n");
-	_printf_(true,"      [ierror]=KMLFileRead('filin.kml','echo','on','write','filout.kml');\n");
-	_printf_(true,"\n");
-}
-

Deleted: issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.h
===================================================================
--- issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.h	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/KMLMeshWrite/KMLFileRead.h	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,31 +0,0 @@
-/*!\file KMLFileRead.h
- * \brief: prototype for KML file reader mex module.
- */
-
-#ifndef _KMLFILEREAD_H
-#define _KMLFILEREAD_H
-
-/* local prototypes: */
-void KMLFileReadUsage(void);
-
-#include "../../c/modules/modules.h"
-#include "../../c/Container/Container.h"
-#include "../../c/shared/shared.h"
-
-#undef __FUNCT__ 
-#define __FUNCT__  "KMLFileRead"
-
-
-/* serial input macros: */
-#define FILENAME      prhs[0]
-
-/* serial output macros: */
-#define ERRORFLAG (mxArray**)&plhs[0]
-
-/* serial arg counts: */
-#undef NRHS
-#define NRHS  1
-#undef NLHS
-#define NLHS  1
-
-#endif

Modified: issm/trunk/src/mex/Makefile.am
===================================================================
--- issm/trunk/src/mex/Makefile.am	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/Makefile.am	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,4 +1,4 @@
-INCLUDES = @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@
+INCLUDES = @MATLABINCL@ @PETSCINCL@ @MPIINCL@ @METISINCL@ @TRIANGLEINCL@ @CHACOINCL@ @SCOTCHINCL@ @SHAPELIBINCL@ 
 EXEEXT=$(MEXEXT)
 
 #Bin programs {{{1
@@ -21,6 +21,7 @@
 				ContourToNodes \
 				CostFunction \
 				CreateNodalConstraints\
+				CreateJacobianMatrix\
 				Echo\
 				ElementConnectivity\
 				EnumToString\
@@ -94,13 +95,17 @@
 if NOSERIAL
 bin_PROGRAMS += 
 else
+if DAKOTA
 bin_PROGRAMS += DakotaResponses\
 				Dakota\
 				InputUpdateFromDakota
+else
+bin_PROGRAMS += 
+endif
 endif 
 #}}}
 #Flags and libraries {{{1
-LDADD =   $(TRIANGLELIB) ../c/libISSM.a $(PETSCLIB) $(FLIBS)  $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB)  $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB)
+LDADD =   $(TRIANGLELIB) ../c/libISSM.a $(PETSCLIB) $(FLIBS)  $(PLAPACKLIB)  $(MUMPSLIB) $(SCALAPACKLIB)  $(BLACSLIB)  $(HYPRELIB) $(MLLIB) $(DAKOTALIB) $(METISLIB) $(CHACOLIB) $(SCOTCHLIB) $(BLASLAPACKLIB)  $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB) $(MULTITHREADINGLIB) $(SHAPELIBLIB) $(MEXLIB)
 
 AM_LDFLAGS = $(MEXLINK)
 
@@ -233,8 +238,8 @@
 InterpFromMesh2d_SOURCES = InterpFromMesh2d/InterpFromMesh2d.cpp\
 									InterpFromMesh2d/InterpFromMesh2d.h
 
-KMLFileRead_SOURCES = KMLMeshWrite/KMLFileRead.cpp\
-			  KMLMeshWrite/KMLFileRead.h
+KMLFileRead_SOURCES = KMLFileRead/KMLFileRead.cpp\
+			  KMLFileRead/KMLFileRead.h
 
 KMLMeshWrite_SOURCES = KMLMeshWrite/KMLMeshWrite.cpp\
 			  KMLMeshWrite/KMLMeshWrite.h
@@ -326,6 +331,10 @@
 SystemMatrices_SOURCES = SystemMatrices/SystemMatrices.cpp\
 			  SystemMatrices/SystemMatrices.h
 
+
+CreateJacobianMatrix_SOURCES = CreateJacobianMatrix/CreateJacobianMatrix.cpp\
+								 CreateJacobianMatrix/CreateJacobianMatrix.h
+
 SurfaceArea_SOURCES = SurfaceArea/SurfaceArea.cpp\
 								 SurfaceArea/SurfaceArea.h
 

Modified: issm/trunk/src/mex/MeshProfileIntersection/MeshProfileIntersection.cpp
===================================================================
--- issm/trunk/src/mex/MeshProfileIntersection/MeshProfileIntersection.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/MeshProfileIntersection/MeshProfileIntersection.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -53,11 +53,11 @@
 	/*Fetch inputs: */
 	//index
 	FetchMatlabData(&double_index,&nel,&dummy,INDEX);
-	if(dummy!=3)_error_(" element triangulation should be of 3 column width!");
+	if(dummy!=3 && dummy!=6)_error_(" element triangulation should be of 3 or 6 column width!");
 	index=(int*)xmalloc(nel*3*sizeof(int));
 	for(i=0;i<nel;i++){
 		for(j=0;j<3;j++){
-			*(index+3*i+j)=(int)*(double_index+3*i+j)-1; //"C" style indexing
+			*(index+3*i+j)=(int)*(double_index+dummy*i+j)-1; //"C" style indexing
 		}
 	}
 	//x and y

Modified: issm/trunk/src/mex/Solver/Solver.cpp
===================================================================
--- issm/trunk/src/mex/Solver/Solver.cpp	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/src/mex/Solver/Solver.cpp	2012-02-24 16:12:47 UTC (rev 11527)
@@ -32,7 +32,7 @@
 	/*parameters: */
 	FetchMatlabData(&parameters,PARAMETERS);
 
-	/*In serial mode, we have no set any petsc options, do it now: */
+	/*In serial mode, we have not set any petsc options, do it now: */
 	#ifdef _SERIAL_
 	parameters->FindParam(&analysis_type,AnalysisTypeEnum);
 	PetscOptionsFromAnalysis(parameters,analysis_type);

Modified: issm/trunk/startup.m
===================================================================
--- issm/trunk/startup.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/startup.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -10,8 +10,12 @@
 % clear the last warning to focus on the warnings of the ISSM path
 lastwarn(''); 
 
-%Recover ISSM_TIER 
-ISSM_TIER=getenv('ISSM_TIER');
+%Recover ISSM_TIER , or if on a Windows machine, ISSM_TIER_WIN
+if ~ispc,
+	ISSM_TIER=getenv('ISSM_TIER');
+else
+	ISSM_TIER=getenv('ISSM_TIER_WIN');
+end
 if (isempty(ISSM_TIER)),
 	error('issmdir error message: ''ISSM_TIER'' environment variable is empty! You should define ISSM_TIER in your .cshrc or .bashrc!');
 end
@@ -21,15 +25,35 @@
 %the variable ISSM_TIER in this file, in case it is not correctly setup. 
 
 %ISSM path
-addpath([ISSM_TIER '/src/m/utils/']); %loads recursivepath
-addpath([ISSM_TIER '/doc']);
-addpath([ISSM_TIER '/bin']);
-addpath(recursivepath([ISSM_TIER '/src/m']));
-addpath(recursivepath([ISSM_TIER '/externalpackages/scotch']));
-addpath(recursivepath([ISSM_TIER '/externalpackages/canos']));
-addpath(recursivepath([ISSM_TIER '/externalpackages/kml']));
-addpath(recursivepath([ISSM_TIER '/externalpackages/googleearthtoolbox/']));
-addpath(recursivepath([ISSM_TIER '/externalpackages/export_fig']));
+addpath(pwd); %add current path first
+
+if exist([ISSM_TIER '/src/m/utils/'],'dir'),
+	addpath([ISSM_TIER '/src/m/utils/']); %loads recursivepath
+end
+if exist([ISSM_TIER '/doc'],'dir'),
+	addpath([ISSM_TIER '/doc']);
+end
+if exist([ISSM_TIER '/bin'],'dir'),
+	addpath([ISSM_TIER '/bin']);
+end
+if exist([ISSM_TIER '/src/m'],'dir'),
+	addpath(recursivepath([ISSM_TIER '/src/m']));
+end
+if exist([ISSM_TIER '/externalpackages/scotch'],'dir'),
+	addpath(recursivepath([ISSM_TIER '/externalpackages/scotch']));
+end
+if exist([ISSM_TIER '/externalpackages/canos'],'dir'),
+	addpath(recursivepath([ISSM_TIER '/externalpackages/canos']));
+end
+if exist([ISSM_TIER '/externalpackages/kml'],'dir'),
+	addpath(recursivepath([ISSM_TIER '/externalpackages/kml']));
+end
+if exist([ISSM_TIER '/externalpackages/googleearthtoolbox/'],'dir'),
+	addpath(recursivepath([ISSM_TIER '/externalpackages/googleearthtoolbox/']));
+end
+if exist([ISSM_TIER '/externalpackages/export_fig'],'dir'),
+	addpath(recursivepath([ISSM_TIER '/externalpackages/export_fig']));
+end
 clear ISSM_TIER;
 
 %Check on any warning messages that might indicate that the paths were not correct. 
@@ -42,20 +66,31 @@
 
 %  deal with Matlab bug (on Linux, not WinXP) -- unless
 %  the class has been called, "empty" method can not be found
-normal_uncertain;
-continuous_design;
-continuous_state;
-linear_inequality_constraint;
-linear_equality_constraint;
-response_function;
-objective_function;
-least_squares_term;
-nonlinear_inequality_constraint;
-nonlinear_equality_constraint;
-clear ans;
+if ~ispc,
+	normal_uncertain;
+	continuous_design;
+	continuous_state;
+	linear_inequality_constraint;
+	linear_equality_constraint;
+	response_function;
+	objective_function;
+	least_squares_term;
+	nonlinear_inequality_constraint;
+	nonlinear_equality_constraint;
+	clear ans;
+end
 
 %disable matlab bell!
 beep off;
 
 % no warning if we try to plot while in nojvm (will not be supported in future releases)
 warning off MATLAB:HandleGraphics:noJVM
+
+%at the end, get to tests directory if ISSM_TESTS exists: 
+if ispc, 
+	addpath([pwd '\bin']);
+	ISSM_TESTS=getenv('ISSM_TESTS');
+	if ~isempty(ISSM_TESTS),
+		cd(ISSM_TESTS);
+	end
+end

Modified: issm/trunk/test/Archives/Archive101.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive1109.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive1208.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive121.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive122.mat
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive139.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive139.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive140.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive140.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive141.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive141.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive142.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive142.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive143.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive143.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive144.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive144.mat)
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive1501.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive1502.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive217.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive218.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive219.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive220.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive221.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive222.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive224.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive226.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive228.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive247.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive248.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive249.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive250.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive253.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive254.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive265.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive266.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive329.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive330.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive333.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive334.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive338.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive339.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive340.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive344.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive347.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive348.mat
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive349.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive349.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive350.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive350.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive351.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive351.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive352.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive352.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive353.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive353.mat)
===================================================================
(Binary files differ)

Copied: issm/trunk/test/Archives/Archive354.mat (from rev 11526, issm/trunk-jpl/test/Archives/Archive354.mat)
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive417.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive418.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive429.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive430.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive431.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive432.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive451.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive452.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive453.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive454.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive509.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive510.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive511.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive512.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive513.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive514.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive523.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive524.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive525.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/Archives/Archive526.mat
===================================================================
(Binary files differ)

Modified: issm/trunk/test/NightlyRun/IdToName.m
===================================================================
--- issm/trunk/test/NightlyRun/IdToName.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/IdToName.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -43,6 +43,12 @@
 	case 135, name='SquareShelfConstrainedBalThic2dDGSerial';
 	case 136, name='SquareShelfConstrainedBalThic2dDGParallel';
 	case 137, name='SquareBamgMesh';
+	case 139, name='SquareShelfConstrainedEnthalpySteaSerial';
+	case 140, name='SquareShelfConstrainedEnthalpySteaParallel';
+	case 141, name='SquareShelfConstrainedEnthalpyTranSerial';
+	case 142, name='SquareShelfConstrainedEnthalpyTranParallel';
+	case 143, name='SquareShelfConstrainedTransP3dEnthSerial';
+	case 144, name='SquareShelfConstrainedTransP3dEnthParallel';
 	case 201, name='SquareShelfDiagM2dSerial';
 	case 202, name='SquareShelfDiagM2dParallel';
 	case 203, name='SquareShelfDiagM3dSerial';
@@ -159,6 +165,12 @@
 	case 346, name='SquareSheetConstrainedTranCflM2dParallel';
 	case 347, name='SquareSheetConstrainedTranCflH3dSerial';
 	case 348, name='SquareSheetConstrainedTranCflH3dParallel';
+	case 349, name='SquareSheetConstrainedEnthalpySteaSerial';
+	case 350, name='SquareSheetConstrainedEnthalpySteaParallel';
+	case 351, name='SquareSheetConstrainedEnthalpyTranSerial';
+	case 352, name='SquareSheetConstrainedEnthalpyTranParallel';
+	case 353, name='SquareSheetConstrainedTransP3dEnthSerial';
+	case 354, name='SquareSheetConstrainedTransP3dEnthParallel';
 	case 401, name='SquareSheetShelfDiagM2dSerial';
 	case 402, name='SquareSheetShelfDiagM2dParallel';
 	case 403, name='SquareSheetShelfDiagM3dSerial';

Modified: issm/trunk/test/NightlyRun/Makefile
===================================================================
--- issm/trunk/test/NightlyRun/Makefile	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/Makefile	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,2 +1,2 @@
 clean: 
-	rm -rf *.tar.gz *.bin *.errlog *.outlog  *.outbin *.petsc *.queue *.run valgrind.log*
+	rm -rf *.tar.gz *.bin *.errlog *.outlog  *.outbin *.petsc *.queue *.run valgrind.log* *.bat *.lock

Modified: issm/trunk/test/NightlyRun/runme.m
===================================================================
--- issm/trunk/test/NightlyRun/runme.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/runme.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -47,7 +47,7 @@
 %GET benchmark {{{1
 benchmark=getfieldvalue(options,'benchmark','nightly');
 if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing'})
-	disp('runme warnig: benchmark not supported, defaulting to test ''nightly''')
+	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
 	benchmark='nighlty';
 end
 % }}}

Modified: issm/trunk/test/NightlyRun/test1104.m
===================================================================
--- issm/trunk/test/NightlyRun/test1104.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test1104.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -68,7 +68,7 @@
 	1e-08,1e-08,1e-08,...
 	1e-08,1e-08,1e-08,...
 	1e-08,1e-08,1e-08,...
-	1e-08,1e-07,1e-07,...
+	1e-07,1e-07,1e-07,...
 };
 field_values={};
 for i=1:6,

Modified: issm/trunk/test/NightlyRun/test1106.m
===================================================================
--- issm/trunk/test/NightlyRun/test1106.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test1106.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -61,11 +61,11 @@
 	'Vx160km','Vy160km','Vz160km'
 };
 field_tolerances={...
+	1e-12,1e-12,1e-11,...
 	1e-12,1e-12,1e-12,...
 	1e-12,1e-12,1e-12,...
 	1e-12,1e-12,1e-12,...
 	1e-12,1e-12,1e-12,...
-	1e-12,1e-12,1e-12,...
 	1e-12,1e-11,1e-12,...
 };
 field_values={};

Modified: issm/trunk/test/NightlyRun/test1107.m
===================================================================
--- issm/trunk/test/NightlyRun/test1107.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test1107.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -135,7 +135,7 @@
 	1e-08,1e-08,1e-07,...
 	1e-08,1e-08,1e-07,...
 	1e-08,1e-08,1e-07,...
-	1e-07,1e-08,1e-07,...
+	1e-07,1e-08,1e-06,...
 };
 field_values={};
 for i=1:6,

Modified: issm/trunk/test/NightlyRun/test1108.m
===================================================================
--- issm/trunk/test/NightlyRun/test1108.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test1108.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -75,7 +75,7 @@
 	1e-08,1e-08,1e-08,...
 	1e-08,1e-07,1e-08,...
 	1e-08,1e-08,1e-08,...
-	1e-08,1e-08,1e-08,...
+	1e-08,1e-07,1e-07,...
 	1e-07,1e-06,1e-07,...
 };
 field_values={};

Modified: issm/trunk/test/NightlyRun/test1109.m
===================================================================
--- issm/trunk/test/NightlyRun/test1109.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test1109.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -87,15 +87,15 @@
 end
 %Fields and tolerances to track changes
 field_names     ={ ...
-	'VxPattynSliding','VyPattynSliding','VzPattynSliding',...
+	'VyPattynSliding','VzPattynSliding',...
 	'VxStokesSliding','VyStokesSliding','VzStokesSliding',...
-	'VxPattynFrozen','VyPattynFrozen','VzPattynFrozen',...
+	'VyPattynFrozen','VzPattynFrozen',...
 	'VxStokesFrozen','VyStokesFrozen','VzStokesFrozen'
 };
 field_tolerances={...
-	1e-06,1e-05,1e-05,...
+	1e-05,1e-05,...
 	1e-06,1e-06,1e-06,...
-	1e-06,1e-05,1e-05,...
+	1e-05,1e-04,...
 	1e-06,1e-06,1e-06,...
 };
 field_values={};

Modified: issm/trunk/test/NightlyRun/test122.m
===================================================================
--- issm/trunk/test/NightlyRun/test122.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test122.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -7,10 +7,14 @@
 md=solve(md,TransientSolutionEnum);
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
-field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
+field_names={...
+	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
+field_tolerances={...
+	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05,...
+	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-05};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
 	(md.results.TransientSolution(1).Vy),...

Copied: issm/trunk/test/NightlyRun/test139.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test139.m)
===================================================================
--- issm/trunk/test/NightlyRun/test139.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test139.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,18 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.timestepping.time_step=0;
+md.cluster=none;
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy','Waterfraction','Temperature'};
+field_tolerances={1e-13,1e-10,1e-13};
+field_values={...
+	(md.results.EnthalpySolution.Enthalpy),...
+	(md.results.EnthalpySolution.Waterfraction),...
+	(md.results.EnthalpySolution.Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test140.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test140.m)
===================================================================
--- issm/trunk/test/NightlyRun/test140.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test140.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,19 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.timestepping.time_step=0;
+md.cluster=generic('name',oshostname(),'np',3);
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+%md=solve(md,ThermalSolutionEnum);
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy','Waterfraction','Temperature'};
+field_tolerances={1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.EnthalpySolution.Enthalpy),...
+	(md.results.EnthalpySolution.Waterfraction),...
+	(md.results.EnthalpySolution.Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test141.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test141.m)
===================================================================
--- issm/trunk/test/NightlyRun/test141.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test141.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,25 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.cluster=none;
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
+	'Enthalpy2','Waterfraction2','Temperature2',...
+	'Enthalpy3','Waterfraction3','Temperature3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.EnthalpySolution(1).Enthalpy),...
+	(md.results.EnthalpySolution(1).Waterfraction),...
+	(md.results.EnthalpySolution(1).Temperature),...
+	(md.results.EnthalpySolution(2).Enthalpy),...
+	(md.results.EnthalpySolution(2).Waterfraction),...
+	(md.results.EnthalpySolution(2).Temperature),...
+	(md.results.EnthalpySolution(3).Enthalpy),...
+	(md.results.EnthalpySolution(3).Waterfraction),...
+	(md.results.EnthalpySolution(3).Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test142.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test142.m)
===================================================================
--- issm/trunk/test/NightlyRun/test142.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test142.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,26 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+%md=solve(md,ThermalSolutionEnum);
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
+	'Enthalpy2','Waterfraction2','Temperature2',...
+	'Enthalpy3','Waterfraction3','Temperature3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-10,1e-13};
+field_values={...
+	(md.results.EnthalpySolution(1).Enthalpy),...
+	(md.results.EnthalpySolution(1).Waterfraction),...
+	(md.results.EnthalpySolution(1).Temperature),...
+	(md.results.EnthalpySolution(2).Enthalpy),...
+	(md.results.EnthalpySolution(2).Waterfraction),...
+	(md.results.EnthalpySolution(2).Temperature),...
+	(md.results.EnthalpySolution(3).Enthalpy),...
+	(md.results.EnthalpySolution(3).Waterfraction),...
+	(md.results.EnthalpySolution(3).Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test143.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test143.m)
===================================================================
--- issm/trunk/test/NightlyRun/test143.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test143.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,53 @@
+md=triangle(model,'../Exp/Square.exp',200000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'pattyn','all');
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.thermal.isenthalpy=1;
+md.thermal.stabilization=2;
+md.cluster=none;
+md=solve(md,TransientSolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
+				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
+					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+						1e-09,5e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vz),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Bed),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).Enthalpy),...
+	(md.results.TransientSolution(1).Waterfraction),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vz),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Bed),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).Temperature),...
+	(md.results.TransientSolution(2).Enthalpy),...
+	(md.results.TransientSolution(2).Waterfraction),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vz),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Bed),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).Enthalpy),...
+	(md.results.TransientSolution(3).Waterfraction),...
+	};

Copied: issm/trunk/test/NightlyRun/test144.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test144.m)
===================================================================
--- issm/trunk/test/NightlyRun/test144.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test144.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,54 @@
+md=triangle(model,'../Exp/Square.exp',200000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelfConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'pattyn','all');
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.thermal.isenthalpy=1;
+md.thermal.stabilization=2;
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,TransientSolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
+				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
+					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+field_tolerances={...
+	1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,...
+	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,...
+	1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vz),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Bed),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).Enthalpy),...
+	(md.results.TransientSolution(1).Waterfraction),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vz),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Bed),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).Temperature),...
+	(md.results.TransientSolution(2).Enthalpy),...
+	(md.results.TransientSolution(2).Waterfraction),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vz),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Bed),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).Enthalpy),...
+	(md.results.TransientSolution(3).Waterfraction),...
+	};

Modified: issm/trunk/test/NightlyRun/test1502.m
===================================================================
--- issm/trunk/test/NightlyRun/test1502.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test1502.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -1,11 +1,11 @@
 printingflag = false;
 
-md=triangle(model,'../Exp/Square.exp',700000);
+md=triangle(model,'../Exp/Square.exp',450000);
 md=setmask(md,'all','');
 md=parameterize(md,'../Par/SquareShelf.par');
 md=setflowequation(md,'macayeal','all');
 md=extrude(md,3,1);
-md.cluster=generic('name',oshostname(),'np',3);
+md.cluster=generic('name',oshostname(),'np',2);
 md.transient.isthermal=0;
 
 md.timestepping.time_step=1;

Modified: issm/trunk/test/NightlyRun/test218.m
===================================================================
--- issm/trunk/test/NightlyRun/test218.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test218.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -10,7 +10,10 @@
 field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
 				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
 					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
-field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_tolerances={...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
+	1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-8,...
+	1e-13,1e-13,1e-08,1e-13,1e-13,1e-10,1e-10,1e-10,1e-13,1e-8};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
 	(md.results.TransientSolution(1).Vy),...

Modified: issm/trunk/test/NightlyRun/test222.m
===================================================================
--- issm/trunk/test/NightlyRun/test222.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test222.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -8,13 +8,14 @@
 md=solve(md,TransientSolutionEnum);
 
 %Fields and tolerances to track changes
-field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
-				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
-					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
+field_names={...
+	'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','BasalforcingsMeltingRate1', ...
+	'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','BasalforcingsMeltingRate2', ...
+	'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3'};
 field_tolerances={...
 	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,...
-	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-07,...
-	1e-07,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
+	1e-08,1e-08,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06,...
+	1e-07,1e-07,1e-06,1e-08,1e-08,1e-08,1e-08,1e-08,1e-08,1e-06};
 field_values={...
 	(md.results.TransientSolution(1).Vx),...
 	(md.results.TransientSolution(1).Vy),...

Modified: issm/trunk/test/NightlyRun/test223.m
===================================================================
--- issm/trunk/test/NightlyRun/test223.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test223.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -17,7 +17,6 @@
 md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
 
 md.cluster=none;
-md.verbose=verbose('all');
 md=solve(md,DiagnosticSolutionEnum);
 
 %Fields and tolerances to track changes

Modified: issm/trunk/test/NightlyRun/test266.m
===================================================================
--- issm/trunk/test/NightlyRun/test266.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test266.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -15,7 +15,7 @@
 					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','BasalforcingsMeltingRate3', ...
 					   'Vx4','Vy4','Vz4','Vel4','Pressure4','Bed4','Surface4','Thickness4','Temperature4','BasalforcingsMeltingRate4'};
 field_tolerances={1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09, ...
-						1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09, ...
+						1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-07, ...
 						1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06, ...
 						1e-09,1e-09,1e-08,1e-09,1e-09,1e-09,1e-09,1e-09,1e-09,1e-06};
 field_values={...

Modified: issm/trunk/test/NightlyRun/test314.m
===================================================================
--- issm/trunk/test/NightlyRun/test314.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test314.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -8,7 +8,7 @@
 
 %Fields and tolerances to track changes
 field_names     ={'Vx','Vy','Vz','Vel','Pressure'};
-field_tolerances={1e-09,1e-09,1e-10,1e-10,1e-10};
+field_tolerances={1e-09,1e-09,1e-10,2e-10,1e-10};
 field_values={...
 	(md.results.DiagnosticSolution.Vx),...
 	(md.results.DiagnosticSolution.Vy),...

Copied: issm/trunk/test/NightlyRun/test349.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test349.m)
===================================================================
--- issm/trunk/test/NightlyRun/test349.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test349.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,18 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.timestepping.time_step=0;
+md.cluster=none;
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy','Waterfraction','Temperature'};
+field_tolerances={1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.EnthalpySolution.Enthalpy),...
+	(md.results.EnthalpySolution.Waterfraction),...
+	(md.results.EnthalpySolution.Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test350.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test350.m)
===================================================================
--- issm/trunk/test/NightlyRun/test350.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test350.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,18 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.timestepping.time_step=0;
+md.cluster=generic('name',oshostname(),'np',3);
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy','Waterfraction','Temperature'};
+field_tolerances={1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.EnthalpySolution.Enthalpy),...
+	(md.results.EnthalpySolution.Waterfraction),...
+	(md.results.EnthalpySolution.Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test351.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test351.m)
===================================================================
--- issm/trunk/test/NightlyRun/test351.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test351.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,25 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.cluster=none;
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
+	'Enthalpy2','Waterfraction2','Temperature2',...
+	'Enthalpy3','Waterfraction3','Temperature3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.EnthalpySolution(1).Enthalpy),...
+	(md.results.EnthalpySolution(1).Waterfraction),...
+	(md.results.EnthalpySolution(1).Temperature),...
+	(md.results.EnthalpySolution(2).Enthalpy),...
+	(md.results.EnthalpySolution(2).Waterfraction),...
+	(md.results.EnthalpySolution(2).Temperature),...
+	(md.results.EnthalpySolution(3).Enthalpy),...
+	(md.results.EnthalpySolution(3).Waterfraction),...
+	(md.results.EnthalpySolution(3).Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test352.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test352.m)
===================================================================
--- issm/trunk/test/NightlyRun/test352.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test352.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,26 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'macayeal','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+%md=solve(md,ThermalSolutionEnum);
+md=solve(md,EnthalpySolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Enthalpy1','Waterfraction1','Temperature1',...
+	'Enthalpy2','Waterfraction2','Temperature2',...
+	'Enthalpy3','Waterfraction3','Temperature3'};
+field_tolerances={1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13,1e-13};
+field_values={...
+	(md.results.EnthalpySolution(1).Enthalpy),...
+	(md.results.EnthalpySolution(1).Waterfraction),...
+	(md.results.EnthalpySolution(1).Temperature),...
+	(md.results.EnthalpySolution(2).Enthalpy),...
+	(md.results.EnthalpySolution(2).Waterfraction),...
+	(md.results.EnthalpySolution(2).Temperature),...
+	(md.results.EnthalpySolution(3).Enthalpy),...
+	(md.results.EnthalpySolution(3).Waterfraction),...
+	(md.results.EnthalpySolution(3).Temperature),...
+	};

Copied: issm/trunk/test/NightlyRun/test353.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test353.m)
===================================================================
--- issm/trunk/test/NightlyRun/test353.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test353.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,55 @@
+md=triangle(model,'../Exp/Square.exp',200000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'pattyn','all');
+md.cluster=none;
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.initialization.temperature(:)=272;
+md.thermal.spctemperature(find(md.mesh.vertexonsurface))=272;
+md.thermal.isenthalpy=1;
+md.basalforcings.geothermalflux(:)=5;
+md=solve(md,TransientSolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
+				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
+					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+						1e-09,5e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vz),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Bed),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).Enthalpy),...
+	(md.results.TransientSolution(1).Waterfraction),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vz),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Bed),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).Temperature),...
+	(md.results.TransientSolution(2).Enthalpy),...
+	(md.results.TransientSolution(2).Waterfraction),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vz),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Bed),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).Enthalpy),...
+	(md.results.TransientSolution(3).Waterfraction),...
+	};

Copied: issm/trunk/test/NightlyRun/test354.m (from rev 11526, issm/trunk-jpl/test/NightlyRun/test354.m)
===================================================================
--- issm/trunk/test/NightlyRun/test354.m	                        (rev 0)
+++ issm/trunk/test/NightlyRun/test354.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -0,0 +1,55 @@
+md=triangle(model,'../Exp/Square.exp',200000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'pattyn','all');
+md.cluster=generic('name',oshostname(),'np',3);
+md.initialization.waterfraction=zeros(md.mesh.numberofvertices,1);
+md.initialization.temperature(:)=272;
+md.thermal.spctemperature(find(md.mesh.vertexonsurface))=272;
+md.thermal.isenthalpy=1;
+md.basalforcings.geothermalflux(:)=5;
+md=solve(md,TransientSolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vz1','Vel1','Pressure1','Bed1','Surface1','Thickness1','Temperature1','Enthalpy1','Waterfraction1', ...
+				      'Vx2','Vy2','Vz2','Vel2','Pressure2','Bed2','Surface2','Thickness2','Temperature2','Enthalpy2','Waterfraction2', ...
+					   'Vx3','Vy3','Vz3','Vel3','Pressure3','Bed3','Surface3','Thickness3','Temperature3','Enthalpy3','Waterfraction3'};
+field_tolerances={1e-09,1e-09,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+						1e-09,1e-09,1e-10,1e-09,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,...
+						1e-09,5e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10,1e-10};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vz),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Pressure),...
+	(md.results.TransientSolution(1).Bed),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).Enthalpy),...
+	(md.results.TransientSolution(1).Waterfraction),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vz),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Pressure),...
+	(md.results.TransientSolution(2).Bed),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).Temperature),...
+	(md.results.TransientSolution(2).Enthalpy),...
+	(md.results.TransientSolution(2).Waterfraction),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vz),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Pressure),...
+	(md.results.TransientSolution(3).Bed),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).Enthalpy),...
+	(md.results.TransientSolution(3).Waterfraction),...
+	};

Modified: issm/trunk/test/NightlyRun/test430.m
===================================================================
--- issm/trunk/test/NightlyRun/test430.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test430.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -23,7 +23,7 @@
 
 %Fields and tolerances to track changes
 field_names     ={'Gradient' 'Misfits' 'FrictionCoefficient' 'Pressure' 'Vel' 'Vx' 'Vy' 'Vz' 'Temperature' 'BasalforcingsMeltingRate'};
-field_tolerances={1e-10,1e-10,1e-11,1e-13,1e-10,1e-09,1e-10,1e-8,1e-10,1e-6};
+field_tolerances={1e-10,1e-10,1e-11,1e-13,1e-10,1e-09,1e-10,1e-8,1e-09,1e-6};
 field_values={...
 	(md.results.SteadystateSolution.Gradient1),...
 	md.results.SteadystateSolution.J,...

Modified: issm/trunk/test/NightlyRun/test525.m
===================================================================
--- issm/trunk/test/NightlyRun/test525.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test525.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -18,6 +18,7 @@
 md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
 md.timestepping.time_step=0;
 
+md.thermal.penalty_lock=5;
 md.cluster=none;
 md=solve(md,SteadystateSolutionEnum);
 

Modified: issm/trunk/test/NightlyRun/test526.m
===================================================================
--- issm/trunk/test/NightlyRun/test526.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test526.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -18,6 +18,7 @@
 md.inversion.vx_obs=md.initialization.vx; md.inversion.vy_obs=md.initialization.vy;
 md.timestepping.time_step=0;
 
+md.thermal.penalty_lock=5;
 md.cluster=generic('name',oshostname(),'np',3);
 md=solve(md,SteadystateSolutionEnum);
 

Modified: issm/trunk/test/NightlyRun/test626.m
===================================================================
--- issm/trunk/test/NightlyRun/test626.m	2012-02-24 16:02:48 UTC (rev 11526)
+++ issm/trunk/test/NightlyRun/test626.m	2012-02-24 16:12:47 UTC (rev 11527)
@@ -24,6 +24,7 @@
 md.inversion.maxiter_per_step=4*ones(md.inversion.nsteps,1);
 md.inversion.step_threshold=0.99*ones(md.inversion.nsteps,1);
 
+md.verbose.control=1;
 md.cluster=generic('name',oshostname(),'np',3);
 md=solve(md,BalancethicknessSolutionEnum);
 



More information about the issm-svn mailing list