Index: /issm/trunk/configs/config-arm-linux.sh
===================================================================
--- /issm/trunk/configs/config-arm-linux.sh	(revision 12706)
+++ /issm/trunk/configs/config-arm-linux.sh	(revision 12707)
@@ -3,11 +3,8 @@
 ./configure \
 	--prefix=$ISSM_DIR \
-    --host="arm-linux" \
+    --build="i386-apple-darwin10.8.0" \
+    --host="arm-linux-androideabi" \
+    --without-fortran \
 	--without-modules \
-    CC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-gcc \
-    GCC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-gcc \
-    CXX=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-g++ \
-	--with-vendor=arm-linux \
-	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
-	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install\
-    --without-fortran-lib
+	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install 
Index: /issm/trunk/configs/config-discover.sh
===================================================================
--- /issm/trunk/configs/config-discover.sh	(revision 12706)
+++ /issm/trunk/configs/config-discover.sh	(revision 12707)
@@ -2,23 +2,26 @@
 
 #PETSc 3.2
-#MPI /usr/local/intel/mpi/3.2.2.006/lib64/
+#MPI /usr/local/intel/mpi/4.0.3.008/lib64/
 
 ./configure \
  --prefix=$ISSM_DIR \
- --with-modules=no \
+ --with-matlab-dir=$MATLAB_DIR \
+ --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
  --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
  --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
  --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
- --with-mpi-include="/usr/local/intel/mpi/3.2.2.006/include64/" \
- --with-mpi-lib="-L/usr/local/intel/mpi/3.2.2.006/lib64/ -lmpi -lmpi_ilp64 -lmpiif" \
+ --with-mkl-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
+ --with-mpi-include="/usr/local/intel/mpi/4.0.3.008/include64/" \
+ --with-mpi-lib="-L/usr/local/intel/mpi/4.0.3.008/lib64/ -lmpi -lmpiif" \
  --with-petsc-arch=$ISSM_ARCH \
  --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
- --with-mkl-dir=/usr/local/intel/mkl/10.1.2.024/ \
+ --with-scalapack-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
+ --with-blacs-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
  --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
  --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+ --with-blas-lapack-dir="/usr/local/intel/mkl/10.1.2.024/lib/64/" \
  --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
- --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
- --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
  --with-graphics-lib=/usr/lib64/libX11.so \
  --with-cxxoptflags="-O3 -xS" \
- --with-vendor=intel-linux
+ --with-vendor=intel-discover
+
Index: /issm/trunk/configs/config-greenplanet.sh
===================================================================
--- /issm/trunk/configs/config-greenplanet.sh	(revision 12706)
+++ /issm/trunk/configs/config-greenplanet.sh	(revision 12707)
@@ -10,4 +10,5 @@
  --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
  --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+ --with-tao-dir=$ISSM_DIR/externalpackages/tao/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" \
Index: /issm/trunk/configs/config-linux64-ad.sh
===================================================================
--- /issm/trunk/configs/config-linux64-ad.sh	(revision 12706)
+++ /issm/trunk/configs/config-linux64-ad.sh	(revision 12707)
@@ -16,3 +16,5 @@
 	--without-transient \
 	--without-3d \
-	--without-groundingline
+	--without-groundingline \
+	--without-kriging  \
+	--with-adolc-dir=$ADOLC_DIR 
Index: /issm/trunk/configs/config-linux64-astrid-petscdev.sh
===================================================================
--- /issm/trunk/configs/config-linux64-astrid-petscdev.sh	(revision 12707)
+++ /issm/trunk/configs/config-linux64-astrid-petscdev.sh	(revision 12707)
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+#External packages versions:
+#petsc Dev: FH trying out
+#mpich 1.4
+
+./configure \
+ --prefix=$ISSM_DIR \
+ --with-matlab-dir=$MATLAB_DIR \
+ --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ --with-metis-dir=$ISSM_DIR/externalpackages/petsc/src/externalpackages/metis-5.0.2-p3 \
+ --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+ --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+ --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include \
+ --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich -lmpl " \
+ --with-petsc-arch=$ISSM_ARCH \
+ --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+ --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+ --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+ --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-spai-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-hypre-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-prometheus-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-superlu-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-spooles-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-pastix-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
+ --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+ --with-shapelib-dir="$ISSM_DIR/externalpackages/shapelib/install" \
+ --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
+ --with-graphics-lib=/usr/lib64/libX11.so \
+ --with-cxxoptflags="-march=opteron -O2" \
+ --with-numthreads=32 \
+ --enable-debugging
Index: /issm/trunk/configs/config-linux64-astrid-python.sh
===================================================================
--- /issm/trunk/configs/config-linux64-astrid-python.sh	(revision 12707)
+++ /issm/trunk/configs/config-linux64-astrid-python.sh	(revision 12707)
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+#External packages versions:
+#petsc 3.1 or 3.2
+#mpich 1.4
+
+./configure \
+ --prefix=$ISSM_DIR \
+ --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ --with-python-dir=$ISSM_DIR/externalpackages/python/install\
+ --with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/lib/python2.7/site-packages/numpy/core/include/numpy\
+ --with-python-version=2.7\
+ --with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+ --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+ --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+ --with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+ --with-mpi-lib="-L$ISSM_DIR/externalpackages/mpich2/install/lib/ -lmpich " \
+ --with-petsc-arch=$ISSM_ARCH \
+ --with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install \
+ --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+ --with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+ --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+ --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/externalpackages/PLAPACKR32-hg/INCLUDE" \
+ --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
+ --with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+ --with-shapelib-dir="$ISSM_DIR/externalpackages/shapelib/install" \
+ --with-fortran-lib="-L/usr/lib/gcc/x86_64-redhat-linux/4.1.1/ -lgfortran" \
+ --with-graphics-lib=/usr/lib64/libX11.so \
+ --with-cxxoptflags="-march=opteron -O2 -lutil" \
+ --with-numthreads=32 \
+ --enable-debugging
Index: /issm/trunk/configs/config-macosx-snowleopard-bothapis.sh
===================================================================
--- /issm/trunk/configs/config-macosx-snowleopard-bothapis.sh	(revision 12707)
+++ /issm/trunk/configs/config-macosx-snowleopard-bothapis.sh	(revision 12707)
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+#petsc 3.2
+#mpich 1.4
+
+#export FCFLAGS=" -m32"
+#export FFLAGS=" -m32"
+#export CFLAGS=" -arch i386"
+#export CXXFLAGS=" -arch i386"
+
+pythonversion=2.7
+
+./configure \
+	--prefix=$ISSM_DIR \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+	--with-matlab-dir=$MATLAB_DIR \
+	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
+	--with-python-version=$pythonversion \
+	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/Python.framework/Versions/$pythonversion/lib/python$pythonversion/site-packages/numpy/core/include/numpy\
+	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
+	--with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/libgfortran.a" \
+	--with-math-lib="/usr/lib/libm.dylib" \
+	--with-graphics-lib="/usr/X11/lib/libX11.dylib" \
+	--with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch i386 -DMX_COMPAT_32 -O3 -DNDEBUG -w "\
+	--with-numthreads=8 \
+	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
+	--with-petsc-arch=$ISSM_ARCH \
+	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ 
Index: /issm/trunk/configs/config-macosx-snowleopard-python.sh
===================================================================
--- /issm/trunk/configs/config-macosx-snowleopard-python.sh	(revision 12707)
+++ /issm/trunk/configs/config-macosx-snowleopard-python.sh	(revision 12707)
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+#petsc 3.2
+#mpich 1.4
+
+pythonversion=2.7
+
+./configure \
+	--prefix=$ISSM_DIR \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+	--with-python-dir=$ISSM_DIR/externalpackages/python/install\
+	--with-python-version=$pythonversion \
+	--with-python-numpy-dir=$ISSM_DIR/externalpackages/python/install/Library/Frameworks/Python.framework/Versions/$pythonversion/lib/python$pythonversion/site-packages/numpy/core/include/numpy\
+	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
+	--with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/libgfortran.a" \
+	--with-math-lib="/usr/lib/libm.dylib" \
+	--with-graphics-lib="/usr/X11/lib/libX11.dylib" \
+	--with-cxxoptflags=" -fno-common -fexceptions -O3 -DNDEBUG -w "\
+	--with-numthreads=8 \
+	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
+	--with-petsc-arch=$ISSM_ARCH \
+	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
Index: /issm/trunk/configs/config-macosx64-chris.sh
===================================================================
--- /issm/trunk/configs/config-macosx64-chris.sh	(revision 12707)
+++ /issm/trunk/configs/config-macosx64-chris.sh	(revision 12707)
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+#petsc 3.2
+#mpich 1.4
+
+./configure \
+	--prefix=$ISSM_DIR \
+	--with-matlab-dir=$MATLAB_DIR \
+	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
+	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
+	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
+	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
+	--with-petsc-arch=$ISSM_ARCH \
+	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install -lPLAPACK" \
+	--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
+	--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
+	--with-scotch-dir="$ISSM_DIR/externalpackages/scotch/install" \
+	--with-chaco-dir="$ISSM_DIR/externalpackages/chaco/install" \
+	--with-fortran-lib="/usr/local/gfortran/lib/gcc/x86_64-apple-darwin10/4.6.2/libgfortran.a" \
+	--with-math-lib="/usr/lib/libm.dylib" \
+	--with-graphics-lib="/usr/X11/lib/libX11.dylib" \
+	--with-cxxoptflags=" -fno-common -fexceptions -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
+	--with-numthreads=8
Index: /issm/trunk/configs/config-macosx64-larour-ad.sh
===================================================================
--- /issm/trunk/configs/config-macosx64-larour-ad.sh	(revision 12706)
+++ /issm/trunk/configs/config-macosx64-larour-ad.sh	(revision 12707)
@@ -1,23 +1,7 @@
 #!/bin/sh
 
-#petsc 3.2
-#mpich 1.4
-
 ./configure \
-	--with-serial=no\
 	--prefix=$ISSM_DIR \
-	--with-metis-dir=$ISSM_DIR/externalpackages/metis/install \
-	--with-mpi-include=$ISSM_DIR/externalpackages/mpich2/install/include  \
-	--with-mpi-lib=" $ISSM_DIR/externalpackages/mpich2/install/lib/libpmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpich.a $ISSM_DIR/externalpackages/mpich2/install/lib/libmpl.a " \
-	--without-blas-lapack-dir \
-	--with-chaco-dir=$ISSM_DIR/externalpackages/chaco/install \
-	--with-fortran-lib="/usr/local/gfortran/lib/libgfortran.a" \
-	--with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
-	--with-math-lib="/usr/lib/libm.dylib" \
-	--with-graphics-lib="/usr/X11/lib/libX11.dylib" \
-	--with-cxxoptflags=" -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -mmacosx-version-min=10.5  -O3 -DNDEBUG -w "\
-	--with-adic2-dir=$ISSM_DIR/externalpackages/adic/install/ \
-	--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install/ \
-	--with-numthreads=8 \
+	--without-modules\
 	--without-thermal \
 	--without-control \
@@ -31,13 +15,6 @@
 	--without-transient \
 	--without-3d \
-	--without-groundingline
- 
-#--without-prognostic \
-#--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
-#--with-petsc-arch=$ISSM_ARCH \
-#--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
-#--with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
-#--with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/install/include/ " \
-#--with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
-#--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
-#--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+	--without-groundingline \
+	--without-kriging  \
+	--with-gsl-dir=$ISSM_DIR/externalpackages/gsl/install
+	#--with-adolc-dir=$ISSM_DIR/externalpackages/adolc/install\
Index: /issm/trunk/configs/config-pleiades-petscdev.sh
===================================================================
--- /issm/trunk/configs/config-pleiades-petscdev.sh	(revision 12707)
+++ /issm/trunk/configs/config-pleiades-petscdev.sh	(revision 12707)
@@ -0,0 +1,28 @@
+#!/bin/csh
+
+./configure \
+ --prefix=$ISSM_DIR \
+ --with-modules=no \
+ --with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
+ --with-metis-dir=$ISSM_DIR/externalpackages/petsc/src/externalpackages/metis-5.0.2-p3 \
+ --with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install \
+ --with-tao-dir=$ISSM_DIR/externalpackages/tao/install \
+ --with-mpi-include=/nasa/sgi/mpt/2.04/include \
+ --with-mpi-lib="-L/nasa/sgi/mpt/2.04/lib/ -lmpi -lpthread -lgfortran" \
+ --with-petsc-arch=$ISSM_ARCH \
+ --with-dakota-dir=$ISSM_DIR/externalpackages/dakota/install \
+ --with-mkl-dir=/nasa/intel/mkl/10.0.011/lib/64/ \
+ --with-plapack-lib="-L$ISSM_DIR/externalpackages/petsc/install/ -lPLAPACK" \
+ --with-plapack-include="-I$ISSM_DIR/externalpackages/petsc/src/externalpackages/PLAPACKR32-hg/INCLUDE" \
+ --with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-blacs-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-spai-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-hypre-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-prometheus-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-superlu-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-spooles-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-pastix-dir=$ISSM_DIR/externalpackages/petsc/install/ \
+ --with-graphics-lib=/usr/lib64/libX11.so \
+ --with-cxxoptflags="-O3 -xS" \
+ --with-vendor=intel-pleiades
Index: /issm/trunk/configure.ac
===================================================================
--- /issm/trunk/configure.ac	(revision 12706)
+++ /issm/trunk/configure.ac	(revision 12707)
@@ -2,5 +2,5 @@
 
 #AUTOCONF
-AC_INIT([ISSM],[4.2],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
+AC_INIT([ISSM],[4.2.1],[issm@jpl.nasa.gov],[issm],[http://issm.jpl.nasa.gov]) #Initializing configure
 AC_CONFIG_AUX_DIR([./aux-config])         #Put config files in aux-config
 AC_CONFIG_MACRO_DIR([m4])                 #m4 macros are located in m4
Index: /issm/trunk/etc/environment.csh
===================================================================
--- /issm/trunk/etc/environment.csh	(revision 12706)
+++ /issm/trunk/etc/environment.csh	(revision 12707)
@@ -127,2 +127,14 @@
 setenv VALGRIND_DIR {$VALGRIND_DIR}
 setenv PATH {$PATH}:{$VALGRIND_DIR}
+
+#MERCURIAL
+#setenv PYTHONPATH {$PYTHONPATH}:{$MERCURIAL_DIR}/mercurial/pure/
+setenv PYTHONPATH {$MERCURIAL_DIR}/mercurial/pure/
+setenv PATH {$PATH}:{$MERCURIAL_DIR}
+
+#GSL
+setenv GSL_DIR {$GSL_DIR}
+setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:{$GSL_DIR}/lib
+
+#CMAKE
+setenv PATH {$PATH}:{$CMAKE_DIR}/bin
Index: /issm/trunk/etc/environment.sh
===================================================================
--- /issm/trunk/etc/environment.sh	(revision 12706)
+++ /issm/trunk/etc/environment.sh	(revision 12707)
@@ -262,5 +262,5 @@
 export PATH="$PYTHON_DIR/bin:$PATH"
 export PYTHONPATH="$PYTHONPATH:$ISSM_DIR/src/modules/python"
-export LD_LIBRARY_PATH=$ISSM_DIR/src/modules/python:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=$ISSM_DIR/src/modules/python:$ISSM_DIR/externalpackages/python/install/lib:$LD_LIBRARY_PATH
 export PYTHONSTARTUP
 
@@ -270,2 +270,26 @@
 #GIT
 export PATH="$PATH:$GIT_DIR/install/bin"
+
+#NCVIEW
+export PATH="$PATH:$NCVIEW_DIR/install"
+
+#TCLX
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TCLX_DIR"
+export LD_RUN_PATH="$LD_RUN_PATH:$TCLX_DIR"
+
+
+#ASPELL
+export PATH="$ASPELL_DIR/install/bin:$PATH"
+
+
+#ESMF
+export ESMF_DIR=$ISSM_DIR/externalpackages/esmf/esmf
+export ESMF_COMPILER=gfortran
+export ESMF_COMM=mpich2
+
+#HDF5
+export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$HDF5_DIR/lib"
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HDF5_DIR/lib"
+export LIBRARY_PATH="$LIBRARY_PATH:$HDF5_DIR/lib"
+export C_INCLUDE_PATH="$C_INCLUDE_PATH:$HDF5_DIR/include"
+
Index: /issm/trunk/etc/environment_variables.csh
===================================================================
--- /issm/trunk/etc/environment_variables.csh	(revision 12706)
+++ /issm/trunk/etc/environment_variables.csh	(revision 12707)
@@ -81,4 +81,13 @@
 set SSH_DIR={$ISSM_DIR}/externalpackages/ssh
 
+#mercurial
+set MERCURIAL_DIR={$ISSM_DIR}/externalpackages/mercurial/install
+
 #valgrind
 set VALGRIND_DIR={$ISSM_DIR}/externalpackages/valgrind/install/bin
+
+#gsl
+set GSL_DIR={$ISSM_DIR}/externalpackages/gsl/install
+
+#cmake
+set CMAKE_DIR={$ISSM_DIR}/externalpackages/cmake/install
Index: /issm/trunk/etc/environment_variables.sh
===================================================================
--- /issm/trunk/etc/environment_variables.sh	(revision 12706)
+++ /issm/trunk/etc/environment_variables.sh	(revision 12707)
@@ -201,2 +201,14 @@
 #GIT
 GIT_DIR="$ISSM_DIR/externalpackages/git"
+
+#NCVIEW
+NCVIEW_DIR="$ISSM_DIR/externalpackages/ncview"
+
+#TCLX
+TCLX_DIR="$ISSM_DIR/externalpackages/tclx/install/lib/tclx8.4"
+
+#ASPELL
+ASPELL_DIR="$ISSM_DIR/externalpackages/aspell/"
+
+#HDF5
+export HDF5_DIR=$ISSM_DIR/externalpackages/hdf5/install
Index: /issm/trunk/externalpackages/adolc/install-macosx64.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install-macosx64.sh	(revision 12707)
+++ /issm/trunk/externalpackages/adolc/install-macosx64.sh	(revision 12707)
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+#some issues on macosx64 with ISSM's autoconf. you might want to run native to mac on this.
+
+#Some cleanup
+rm -rf install ADOL-C-2.2.0 src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/ADOL-C-2.2.0.tar.gz' 'ADOL-C-2.2.0.tar.gz'
+
+#Create install directories
+mkdir install src
+
+#Untar 
+tar -zxvf  ADOL-C-2.2.0.tar.gz
+
+#Move ADOL-C into install directory
+mv ADOL-C-2.2.0/* src
+rm -rf ADOL-C-2.2.0
+
+#Compile ADOL-C
+cd src 
+
+#export CC=gcc
+#export CXX=g++
+#export CFLAGS="-arch x86_64"
+#export CXXFLAGS="-arch x86_64"
+
+./configure \
+	--prefix=$ISSM_DIR/externalpackages/adolc/install \
+	--enable-sparse \
+	--enable-docexa \
+	--enable-addexa \
+	--disable-shave
+
+if [ -z $1 ]; then
+	make
+else
+	make -j $1
+fi
+make install
+
+
+#Ok, bug with libtool: replace all LIBTOOL= by LIBTOOL=libtool 
+#in all Makefiles
+for i in `find ./ -name Makefile `
+do
+	echo $i
+	cat $i | sed 's/LIBTOOL =/LIBTOOL = libtool/g' > $i.bak 
+	mv $i.bak $i
+done
+
+#remake: 
+if [ -z $1 ]; then
+	make
+else
+	make -j $1
+fi
+make install
+
+
Index: /issm/trunk/externalpackages/adolc/install.sh
===================================================================
--- /issm/trunk/externalpackages/adolc/install.sh	(revision 12706)
+++ /issm/trunk/externalpackages/adolc/install.sh	(revision 12707)
@@ -22,4 +22,9 @@
 cd src 
 
+export CC=gcc
+export CXX=g++
+export CFLAGS="-arch x86_64"
+export CXXFLAGS="-arch x86_64"
+
 ./configure \
 	--prefix=$ISSM_DIR/externalpackages/adolc/install \
Index: /issm/trunk/externalpackages/android/android-ndk/install.sh
===================================================================
--- /issm/trunk/externalpackages/android/android-ndk/install.sh	(revision 12706)
+++ /issm/trunk/externalpackages/android/android-ndk/install.sh	(revision 12707)
@@ -3,22 +3,25 @@
 #native architecture of the Android device.
 
-#The android-ndk-r7b-darwin-x86.tar.bz2 dummy.tar.bz2 file was downloaded 
+#The android-ndk-r8-darwin-x86.tar.bz2 ndk.tar.bz2 file was downloaded 
 #from the android developer website: 
+source $ANDROID_DIR/android_variables.sh
 
 #Cleanup the install
 rm -rf install
-rm -rf $ANDROID_DIR/arm-linux-android-4.0
+rm -rf $ANDROID_DIR/arm-linux-android-${default_droid}
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-ndk-r7b-darwin-x86.tar.bz2' 'dummy.tar.bz2'
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-ndk-r'${ndk_rev}'-darwin-x86.tar.bz2' 'ndk.tar.bz2'
 
 # Install Android SDK and NDK.
-bunzip2 dummy.tar.bz2
-tar -xvf dummy.tar
-rm -rf dummy.tar dummy.tar.bz2
+bunzip2 ndk.tar.bz2
+tar -xvf ndk.tar
+rm -rf ndk.tar ndk.tar.bz2
 
 #Move to install
-mv android-ndk-r7b install
+mv android-ndk-r${ndk_rev} install
 
 #Create Standalone Development Directory
-$ANDROID_NDK_DIR/build/tools/make-standalone-toolchain.sh --platform=android-5 --install-dir=$ANDROID_DIR/arm-linux-android-4.0
+#Note: API-14 corresponds to Android 4.0 although we are
+#calling our toolchain 4.1 to agree with our device.
+$ANDROID_NDK_DIR/build/tools/make-standalone-toolchain.sh --platform=android-14 --install-dir=$ANDROID_DIR/arm-linux-android-4.0
Index: /issm/trunk/externalpackages/android/android-sdk/install.sh
===================================================================
--- /issm/trunk/externalpackages/android/android-sdk/install.sh	(revision 12706)
+++ /issm/trunk/externalpackages/android/android-sdk/install.sh	(revision 12707)
@@ -1,6 +1,7 @@
 #This installs the Android SDK (Software Development Kit)
 #which is needed for the compilation of the Java project. 
+source $ANDROID_DIR/android_variables.sh
 
-step=3;
+step=1;
 
 #Different steps here. 
@@ -11,23 +12,27 @@
 
 present_dir=`pwd`;
-default_droid="Android-4.0"
 sd_card="issm-sdcard"
+
+((tmp=$1 )) 
+
+if [[ $tmp -ge "1" && $tmp -le "4" ]]; then
+    step=$1
+else
+    echo "Using default step: " $step
+fi
 
 if [[ $step == "1" ]]; then
 
 	#Cleanup the install
-	rm -rf install-sdk install-ant
+	rm -rf install-sdk
 
 	#Download from ISSM server
-	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-sdk-r16-macosx.zip' 'android-sdk-r16-macosx.zip'
-	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/apache-ant-1.8.2-bin.zip' 'apache-ant-1.8.2-bin.zip'
+	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/android-sdk_r'$sdk_rev'-macosx.zip' 'android-sdk_r'${sdk_rev}'-macosx.zip'
 
 	# Install Android SDK and NDK.
-	unzip -o android-sdk-r16-macosx.zip
-	unzip -o apache-ant-1.8.2-bin.zip
+	unzip -o android-sdk_r${sdk_rev}-macosx.zip
 
 	#Move to install
-	mv android-sdk-macosx install-sdk
-	mv apache-ant-1.8.2 install-ant
+	mv -f android-sdk-macosx install-sdk
 
 	#Post_install configuration: 
@@ -37,8 +42,8 @@
 	#For now, we need to install:  
 	#android sdk platform tools  
-	#and a specific android api: API 15
-	#Note: API 15 corresponds to Android 4.0.3
+	#and a specific android api: API 16, API 15 and API 14
+	#Note: API 16, API 15 and 14 correspond to Android 4.1, 4.0.3 and 4.0 respectively. 
 
-	cd install-sdk/tools/ && source ./android update sdk -t platform-tools,android-15,android-14,system-image --no-ui
+	cd install-sdk/tools/ && source ./android update sdk -t platform-tool,${api_levels},system-image --no-ui
 
 fi
@@ -76,12 +81,13 @@
 
     cd ../platform-tools
-    ./adb wait-for-device shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
+    ./adb wait-for-device shell
+    #./adb wait-for-device shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
     #./adb wait-for-device shell
-    ./adb push $ISSM_TIER/src/c/issm.exe /data/issm.exe
-    ./adb shell chmod 777 /data/issm.exe
-    ./adb shell /data/issm.exe
+    #./adb push $ISSM_TIER/src/c/issm.exe /data/issm.exe
+    #./adb shell chmod 777 /data/issm.exe
+    #./adb shell /data/issm.exe
 fi
 
 if [[ $step == "4" ]]; then
-	rm -rf install-sdk install-ant
+	rm -rf install-sdk
 fi
Index: /issm/trunk/externalpackages/android/android_variables.sh
===================================================================
--- /issm/trunk/externalpackages/android/android_variables.sh	(revision 12707)
+++ /issm/trunk/externalpackages/android/android_variables.sh	(revision 12707)
@@ -0,0 +1,5 @@
+sdk_rev=20
+ndk_rev=8
+api_levels="android-14,android-15,android-16"
+host_triplet="arm-linux-androideabi"
+default_droid="android-4.1"
Index: /issm/trunk/externalpackages/aspell/install.sh
===================================================================
--- /issm/trunk/externalpackages/aspell/install.sh	(revision 12707)
+++ /issm/trunk/externalpackages/aspell/install.sh	(revision 12707)
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+#0: cleanup
+#1:  install aspell
+#2:  install en dictionary
+step=0
+
+
+#Some cleanup
+if  [[ $step  == "0" ]]; then
+	rm -rf src install dicts
+	rm -rf aspell-0.50.5
+	rm -rf aspell5-en-6.0.0
+fi
+
+#install aspell
+if  [[ $step  == "1" ]]; then
+
+	mkdir src install dicts
+
+	#Download from ISSM server
+	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/aspell-0.50.5.tar.gz' 'aspell-0.50.5.tar.gz'
+
+	#Untar 
+	tar -zxvf  aspell-0.50.5.tar.gz
+
+	#Move aspell into src directory
+	mv aspell-0.50.5/* src
+	rm -rf aspell-0.50.5
+
+	#Configure aspell
+	cd src
+	./configure \
+		--prefix="$ISSM_DIR/externalpackages/aspell/install" \
+
+	#Compile and install aspell
+	if [ -z $1 ]; then
+		make
+	else
+		make -j $1
+	fi
+	make install
+fi
+
+#languages
+if  [[ $step  == "2" ]]; then
+
+	#Download from ISSM server
+	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/aspell5-en-6.0.0.tar.gz' 'aspell5-en-6.0.0.tar.gz'
+
+	#Untar 
+	tar -zxvf  aspell5-en-6.0.0.tar.gz
+
+	#Move aspell into src directory
+	mv aspell5-en-6.0.0 dicts
+
+	#install
+	cd dicts/aspell5-en-6.0.0
+	./configure
+	make install
+fi
Index: /issm/trunk/externalpackages/dakota/install-discover.sh
===================================================================
--- /issm/trunk/externalpackages/dakota/install-discover.sh	(revision 12706)
+++ /issm/trunk/externalpackages/dakota/install-discover.sh	(revision 12707)
@@ -36,6 +36,6 @@
 --with-pic \
 --disable-mpi \
---with-blas="-L/usr/local/intel/mkl/10.1.2.024/lib/64/ -lmkl -lmkl_lapack -liomp5 -lpthread" \
---with-lapack="-L/usr/local/intel/mkl/10.1.2.024/lib/64/ -lmkl -lmkl_lapack -liomp5 -lpthread"
+--with-blas="-L/usr/local/intel/mkl/10.1.2.024/lib/64 -lmkl_lapack -lmkl -lguide -lpthread" \
+--with-lapack="-L/usr/local/intel/mkl/10.1.2.024/lib/64 -lmkl_lapack -lmkl -lguide -lpthread"
 cd ..
 
Index: /issm/trunk/externalpackages/esmf/install.sh
===================================================================
--- /issm/trunk/externalpackages/esmf/install.sh	(revision 12707)
+++ /issm/trunk/externalpackages/esmf/install.sh	(revision 12707)
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+#0: cleanup
+#1: install
+#2: test
+
+install=2
+
+export ESMF_DIR=$ISSM_DIR/externalpackages/esmf/esmf
+export ESMF_COMPILER=gfortran
+export ESMF_COMM=mpich2
+
+if [[ $install == "0" ]]; then
+	#Some cleanup
+	rm -rf esmf_5_2_0rp2
+	rm -rf esmf
+fi
+
+if [[ $install == "1" ]]; then
+
+	#Download from ISSM server
+	$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/esmf_5_2_0rp2_src.tar.gz' 'esmf_5_2_0rp2_src.tar.gz'
+
+	#Untar 
+	tar -zxvf  esmf_5_2_0rp2_src.tar.gz
+
+
+	#Configure esmf
+	cd esmf
+
+
+
+	#Compile and install esmf
+	if [ -z $1 ]; then
+		make
+		make install
+	else
+		make -j $1
+		make -j $1 install
+	fi
+fi
+
+if [[ $install == "2" ]]; then
+	cd esmf
+	if [ -z $1 ]; then
+		make all_tests
+	else
+		make -j $1 all_tests
+	fi
+fi
Index: /issm/trunk/externalpackages/export_fig/export_fig.m
===================================================================
--- /issm/trunk/externalpackages/export_fig/export_fig.m	(revision 12706)
+++ /issm/trunk/externalpackages/export_fig/export_fig.m	(revision 12707)
@@ -16,4 +16,5 @@
 %   export_fig ... -<colorspace>
 %   export_fig ... -append
+%   export_fig ... -bookmark
 %   export_fig(..., handle)
 %
@@ -120,4 +121,6 @@
 %             exists, the figure is to be appended as a new page, instead
 %             of being overwritten (default).
+%   -bookmark - option to indicate that a bookmark with the name of the
+%               figure is to be created in the output file (pdf only).
 %   handle - The handle of the figure or axes (can be an array of handles
 %            of several axes, but these must be in the same figure) to be
@@ -159,4 +162,8 @@
 % 14/03/12: Fix bug in fixing the axes limits (thanks to Tobias Lamour for
 %           reporting it).
+% 02/05/12: Incorporate patch of Petr Nechaev (many thanks), enabling
+%           bookmarking of figures in pdf files.
+% 09/05/12: Incorporate patch of Arcelia Arrieta (many thanks), to keep
+%           tick marks fixed.
 
 function [im alpha] = export_fig(varargin)
@@ -194,11 +201,14 @@
 Hlims = findall(fig, 'Type', 'axes');
 if ~cls
-    % Record the old axes limit modes
+    % Record the old axes limit and tick modes
     Xlims = make_cell(get(Hlims, 'XLimMode'));
     Ylims = make_cell(get(Hlims, 'YLimMode'));
     Zlims = make_cell(get(Hlims, 'ZLimMode'));
-end
-% Set all axes limit modes to manual, so the limits can't change
-set(Hlims, 'XLimMode', 'manual', 'YLimMode', 'manual', 'ZLimMode', 'manual');
+    Xtick = make_cell(get(Hlims, 'XTickMode'));
+    Ytick = make_cell(get(Hlims, 'YTickMode'));
+    Ztick = make_cell(get(Hlims, 'ZTickMode'));
+end
+% Set all axes limit and tick modes to manual, so the limits and ticks can't change
+set(Hlims, 'XLimMode', 'manual', 'YLimMode', 'manual', 'ZLimMode', 'manual', 'XTickMode', 'manual', 'YTickMode', 'manual', 'ZTickMode', 'manual');
 % Set to print exactly what is there
 set(fig, 'InvertHardcopy', 'off');
@@ -403,4 +413,12 @@
             eps_remove_background(tmp_nam);
         end
+        % Add a bookmark to the PDF if desired
+        if options.bookmark
+            fig_nam = get(fig, 'Name');
+            if isempty(fig_nam)
+                warning('export_fig:EmptyBookmark', 'Bookmark requested for figure with no name. Bookmark will be empty.');
+            end
+            add_bookmark(tmp_nam, fig_nam);
+        end
         % Generate a pdf
         eps2pdf(tmp_nam, pdf_nam, 1, options.append, options.colourspace==2, options.quality);
@@ -435,7 +453,7 @@
     % Reset the hardcopy mode
     set(fig, 'InvertHardcopy', old_mode);
-    % Reset the axes limit modes
+    % Reset the axes limit and tick modes
     for a = 1:numel(Hlims)
-        set(Hlims(a), 'XLimMode', Xlims{a}, 'YLimMode', Ylims{a}, 'ZLimMode', Zlims{a});
+        set(Hlims(a), 'XLimMode', Xlims{a}, 'YLimMode', Ylims{a}, 'ZLimMode', Zlims{a}, 'XTickMode', Xtick{a}, 'YTickMode', Ytick{a}, 'ZTickMode', Ztick{a});
     end
 end
@@ -462,4 +480,5 @@
                  'aa_factor', 3, ...
                  'magnify', 1, ...
+                 'bookmark', false, ...
                  'quality', []);
 native = false; % Set resolution to native of an image
@@ -504,4 +523,6 @@
                 case 'append'
                     options.append = true;
+                case 'bookmark'
+                    options.bookmark = true;
                 case 'native'
                     native = true;
@@ -743,6 +764,40 @@
 % Helper function
 function A = make_cell(A)
- if ~iscell(A)
-     A = {A};
- end
- 
+if ~iscell(A)
+    A = {A};
+end
+return
+
+function add_bookmark(fname, bookmark_text)
+% Adds a bookmark to the temporary EPS file after %%EndPageSetup
+% Read in the file
+fh = fopen(fname, 'r');
+if fh == -1
+    error('File %s not found.', fname);
+end
+try
+    fstrm = fread(fh, '*char')';
+catch ex
+    fclose(fh);
+    rethrow(ex);
+end
+fclose(fh);
+
+% Include standard pdfmark prolog to maximize compatibility
+fstrm = strrep(fstrm, '%%BeginProlog', sprintf('%%%%BeginProlog\n/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse'));
+% Add page bookmark
+fstrm = strrep(fstrm, '%%EndPageSetup', sprintf('%%%%EndPageSetup\n[ /Title (%s) /OUT pdfmark',bookmark_text));
+
+% Write out the updated file
+fh = fopen(fname, 'w');
+if fh == -1
+    error('Unable to open %s for writing.', fname);
+end
+try
+    fwrite(fh, fstrm, 'char*1');
+catch ex
+    fclose(fh);
+    rethrow(ex);
+end
+fclose(fh);
+return
Index: /issm/trunk/externalpackages/export_fig/print2array.m
===================================================================
--- /issm/trunk/externalpackages/export_fig/print2array.m	(revision 12706)
+++ /issm/trunk/externalpackages/export_fig/print2array.m	(revision 12707)
@@ -41,4 +41,7 @@
 % 27/1/2012 Bug fix affecting painters rendering tall figures. Thanks to
 % Ken Campbell for reporting it.
+
+% 3/4/2012 Bug fix to median input. Thanks to Andy Matthews for reporting
+% it.
 
 function [A bcol] = print2array(fig, res, renderer)
@@ -119,5 +122,5 @@
             end
         end
-        bcol = median([reshape(A(:,[l r],:), [], size(A, 3)); reshape(A([t b],:,:), [], size(A, 3))], 1);
+        bcol = uint8(median(single([reshape(A(:,[l r],:), [], size(A, 3)); reshape(A([t b],:,:), [], size(A, 3))]), 1));
         for c = 1:size(A, 3)
             A(:,[1:l-1, r+1:end],c) = bcol(c);
Index: /issm/trunk/externalpackages/export_fig/print2eps.m
===================================================================
--- /issm/trunk/externalpackages/export_fig/print2eps.m	(revision 12706)
+++ /issm/trunk/externalpackages/export_fig/print2eps.m	(revision 12707)
@@ -45,4 +45,6 @@
 % alias can lead to another font being swapped in.
 
+% 10/4/2012 Make the font swapping case insensitive.
+
 function print2eps(name, fig, varargin)
 options = {'-depsc2'};
@@ -57,33 +59,42 @@
 end
 % Find all the used fonts in the figure
-fonts = get(findall(fig, '-property', 'FontName'), 'FontName');
+font_handles = findall(fig, '-property', 'FontName');
+fonts = get(font_handles, 'FontName');
 if ~iscell(fonts)
     fonts = {fonts};
 end
-fonts = unique(fonts);
 % Map supported font aliases onto the correct name
+fontsl = lower(fonts);
 for a = 1:numel(fonts)
-    f = lower(fonts{a});
+    f = fontsl{a};
     f(f==' ') = [];
     switch f
         case {'times', 'timesnewroman', 'times-roman'}
-            fonts{a} = 'Times-Roman';
+            fontsl{a} = 'times-roman';
         case {'arial', 'helvetica'}
-            fonts{a} = 'Helvetica';
+            fontsl{a} = 'helvetica';
         case {'newcenturyschoolbook', 'newcenturyschlbk'}
-            fonts{a} = 'NewCenturySchlbk';
+            fontsl{a} = 'newcenturyschlbk';
         otherwise
     end
 end
+fontslu = unique(fontsl);
 % Determine the font swap table
 matlab_fonts = {'Helvetica', 'Times-Roman', 'Palatino', 'Bookman', 'Helvetica-Narrow', 'Symbol', ...
                 'AvantGarde', 'NewCenturySchlbk', 'Courier', 'ZapfChancery', 'ZapfDingbats'};
-require_swap = find(~ismember(fonts, matlab_fonts));
-unused_fonts = find(~ismember(matlab_fonts, fonts));
-font_swap = min(numel(require_swap), numel(unused_fonts));
-font_swap = [reshape(matlab_fonts(unused_fonts(1:font_swap)), 1, font_swap); reshape(fonts(require_swap(1:font_swap)), 1, font_swap)];
+matlab_fontsl = lower(matlab_fonts);
+require_swap = find(~ismember(fontslu, matlab_fontsl));
+unused_fonts = find(~ismember(matlab_fontsl, fontslu));
+font_swap = cell(3, 0);
+for a = 1:min(numel(require_swap), numel(unused_fonts))
+    ind = find(strcmp(fontslu{require_swap(a)}, fontsl));
+    n = numel(ind);
+    font_swap(1,end+1:end+n) = reshape(mat2cell(font_handles(ind), ones(n, 1)), 1, []);
+    font_swap(2,end-n+1:end) = matlab_fonts(unused_fonts(a));
+    font_swap(3,end-n+1:end) = reshape(fonts(ind), 1, []);
+end
 % Swap the fonts
 for a = 1:size(font_swap, 2)
-    set(findall(fig, 'FontName', font_swap{2,a}), 'FontName', font_swap{1,a});
+    set(font_swap{1,a}, 'FontName', font_swap{2,a});
 end
 % Set paper size
@@ -114,7 +125,8 @@
     % Reset the font names in the figure
     for a = 1:size(font_swap, 2)
-        set(findall(fig, 'FontName', font_swap{1,a}), 'FontName', font_swap{2,a});
+        set(font_swap{1,a}, 'FontName', font_swap{3,a});
     end
     % Replace the font names in the eps file
+    font_swap = font_swap(2:3,:);
     try
         swap_fonts(name, font_swap{:});
Index: sm/trunk/externalpackages/gsl/install-android-4.0.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-android-4.0.sh	(revision 12706)
+++ 	(revision )
@@ -1,38 +1,0 @@
-#!/bin/bash
-
-#Some cleanup
-rm -rf src install gsl-1.15
-mkdir src install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
-
-#Untar 
-tar -zxvf  gsl-1.15.tar.gz
-
-#Move gsl into src directory
-mv gsl-1.15/* src
-rm -rf gsl-1.15
-
-#Configure gsl
-cd src
-
-./configure \
-    CC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-gcc\
-    LD=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-ld\
-    AR=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-ar\
-    RANLIB=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-ranlib\
-    NM=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-nm\
-    OBJ_EXT=o\
-    LIB_EXT=a\
-    --host="arm-linux"\
-	--prefix="$ISSM_DIR/externalpackages/gsl/install" 
-
-#Compile gsl
-if [ -z $1 ]; then
-	make
-else
-	make -j $1
-fi
-
-make install
Index: /issm/trunk/externalpackages/gsl/install-android.sh
===================================================================
--- /issm/trunk/externalpackages/gsl/install-android.sh	(revision 12707)
+++ /issm/trunk/externalpackages/gsl/install-android.sh	(revision 12707)
@@ -0,0 +1,33 @@
+#!/bin/bash
+source $ANDROID_DIR/android_variables.sh
+
+#Some cleanup
+rm -rf src install gsl-1.15
+mkdir src install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/gsl-1.15.tar.gz' 'gsl-1.15.tar.gz'
+
+#Untar 
+tar -zxvf  gsl-1.15.tar.gz
+
+#Move gsl into src directory
+mv gsl-1.15/* src
+rm -rf gsl-1.15
+
+#Configure gsl
+cd src
+
+./configure \
+    --build="i386-apple-darwin10.8.0" \
+    --host=$host_triplet\
+	--prefix="$ISSM_DIR/externalpackages/gsl/install" 
+
+#Compile gsl
+if [ -z $1 ]; then
+	make
+else
+	make -j $1
+fi
+
+make install
Index: /issm/trunk/externalpackages/h5py/install.sh
===================================================================
--- /issm/trunk/externalpackages/h5py/install.sh	(revision 12707)
+++ /issm/trunk/externalpackages/h5py/install.sh	(revision 12707)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+#needed further along
+export HDF5_DIR=$ISSM_DIR/externalpackages/hdf5/install
+
+#Some cleanup
+rm -rf install h5py-2.0.1
+mkdir install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/h5py-2.0.1.tar.gz' 'h5py-2.0.1.tar.gz'
+
+#Untar 
+tar -zxvf  h5py-2.0.1.tar.gz
+
+#Move h5py to install directory
+rm -rf install/*
+mv h5py-2.0.1/* install/
+rm -rf h5py-2.0.1
+
+#Configure and compile
+cd install
+python setup.py build –hdf5=$ISSM_DIR/externalpackages/hdf5/install
+python setup.py install
Index: /issm/trunk/externalpackages/hdf5/install.sh
===================================================================
--- /issm/trunk/externalpackages/hdf5/install.sh	(revision 12707)
+++ /issm/trunk/externalpackages/hdf5/install.sh	(revision 12707)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf src install hdf5-1.8.9
+mkdir src install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/hdf5-1.8.9.tar.gz' 'hdf5-1.8.9.tar.gz'
+
+#Untar 
+tar -zxvf  hdf5-1.8.9.tar.gz
+
+#Move hdf5 to src directory
+rm -rf src/*
+mv hdf5-1.8.9/* src/
+rm -rf hdf5-1.8.9
+
+#Configure and compile
+cd src
+./configure  --prefix="$ISSM_DIR/externalpackages/hdf5/install" 
+if [ -z $1 ]; then
+	make
+else
+	make -j $1
+fi
+make install
Index: /issm/trunk/externalpackages/matlab/install.sh
===================================================================
--- /issm/trunk/externalpackages/matlab/install.sh	(revision 12706)
+++ /issm/trunk/externalpackages/matlab/install.sh	(revision 12707)
@@ -6,4 +6,5 @@
 #Select or create a new simlink
 ln -s /usr/local/pkgs/matlab-7.6/ install
+#ln -s /discover/vis/mathworks/matlab_r2011b/ install
 #ln -s /usr/local/matlab704/ install
 #ln -s /usr/local/matlab711/ install
Index: /issm/trunk/externalpackages/modules/install.sh
===================================================================
--- /issm/trunk/externalpackages/modules/install.sh	(revision 12707)
+++ /issm/trunk/externalpackages/modules/install.sh	(revision 12707)
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py http://issm.jpl.nasa.gov/files/externalpackages/modules-3.2.9c.tar.gz modules-3.2.9c.tar.gz
+
+#Untar and move python into install directory
+tar -zxvf  modules-3.2.9c.tar.gz
+mv modules-3.2.9 install
+
+#Configure doxygen
+cd install
+./configure \
+  --prefix "$ISSM_DIR/externalpackages/modules/install" \
+  --without-x
+
+#compile and install
+make
+make install
Index: /issm/trunk/externalpackages/ncview/install.sh
===================================================================
--- /issm/trunk/externalpackages/ncview/install.sh	(revision 12706)
+++ /issm/trunk/externalpackages/ncview/install.sh	(revision 12707)
@@ -18,5 +18,5 @@
 cd install
 ./configure \
-	--prefix "$ISSM_DIR/externalpackages/ncview/install" \
+	--prefix="$ISSM_DIR/externalpackages/ncview/install" \
 	--x-libraries=/usr/X11/lib/ \
 	--x-includes=/usr/X11/include/ \
Index: /issm/trunk/externalpackages/netcdf-python/install.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf-python/install.sh	(revision 12707)
+++ /issm/trunk/externalpackages/netcdf-python/install.sh	(revision 12707)
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+#Some cleanup
+rm -rf install netCDF4-1.0
+mkdir install 
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/netCDF4-1.0.tar.gz" "netCDF4-1.0.tar.gz"
+
+#Untar 
+tar -zxvf  netCDF4-1.0.tar.gz
+
+#for later: 
+rm -rf ISSMDIR
+echo $ISSM_DIR | sed 's/\//\\\//g' > ISSMDIR
+ISSMDIR=`cat ISSMDIR` && rm -rf ISSMDIR
+
+#Move netCDF4 to install directory
+rm -rf install/*
+mv netCDF4-1.0/* install/
+rm -rf netCDF4-1.0
+
+#Configur and compile
+cd install
+#edit setup.cfg to point to hdf5 and netcdf
+cat setup.cfg.template  | sed "s/\#netCDF4_dir = \/usr\/local/netCDF4_dir = $ISSMDIR\/externalpackages\/netcdf\/install/g"  | sed "s/\#HDF5_dir = \/usr\/local/HDF5_DIR = $ISSMDIR\/externalpackages\/hdf5\/install/g" > setup.cfg
+
+python setup.py build 
+python setup.py install
Index: /issm/trunk/externalpackages/netcdf/install.sh
===================================================================
--- /issm/trunk/externalpackages/netcdf/install.sh	(revision 12706)
+++ /issm/trunk/externalpackages/netcdf/install.sh	(revision 12707)
@@ -1,22 +1,31 @@
 #!/bin/bash
 
+version=4.0.1
+#version=4.2
+
+#for versions 4.2, you need hdf5 compiled, as well as doxygen for the 
+#documentation!
+
 #Some cleanup
-rm -rf install netcdf-4.0.1
-mkdir install
+rm -rf src install netcdf-$version
+mkdir install src
 
 #Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/netcdf-4.0.1.tar.gz' 'netcdf-4.0.1.tar.gz'
+$ISSM_DIR/scripts/DownloadExternalPackage.py "http://issm.jpl.nasa.gov/files/externalpackages/netcdf-$version.tar.gz" "netcdf-$version.tar.gz"
 
 #Untar 
-tar -zxvf  netcdf-4.0.1.tar.gz
+tar -zxvf  netcdf-$version.tar.gz
 
 #Move netcdf to install directory
-rm -rf install/*
-mv netcdf-4.0.1/* install/
-rm -rf netcdf-4.0.1
+rm -rf src/*
+mv netcdf-$version/* src/
+rm -rf netcdf-$version
 
 #Configure and compile
-cd install
-./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install" 
+cd src
+
+#version dependent: 
+./configure  --prefix="$ISSM_DIR/externalpackages/netcdf/install"  
+
 if [ -z $1 ]; then
 	make
Index: /issm/trunk/externalpackages/petsc/install-3.2-discover.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-3.2-discover.sh	(revision 12706)
+++ /issm/trunk/externalpackages/petsc/install-3.2-discover.sh	(revision 12707)
@@ -23,9 +23,13 @@
 	--with-shared-libraries=0 \
 	--known-mpi-shared-libraries=1 \
-	--with-mpi-dir=/usr/local/intel/mpi/3.2.2.006/lib64 \
+	--with-mpi-dir=/usr/local/intel/mpi/4.0.3.008/lib64/ \
 	--with-blas-lapack-dir=/usr/local/intel/mkl/10.1.2.024/lib/64/ \
+	--with-scalapack-lib=/usr/local/intel/mkl/10.1.2.024/lib/64/libmkl_scalapack_lp64.a \
+	--with-scalapack-include=/usr/local/intel/mkl/10.1.2.024/include/ \
+	--with-blacs-lib=/usr/local/intel/mkl/10.1.2.024/lib/64/libmkl_blacs_intelmpi_lp64.a \
+	--with-blacs-include=/usr/local/intel/mkl/10.1.2.024/include/ \
 	--download-mumps=yes \
-	--download-scalapack=yes \
-	--download-blacs=yes \
+	--download-scalapack=no \
+	--download-blacs=no \
 	--download-plapack=yes \
 	--download-parmetis=yes \
Index: /issm/trunk/externalpackages/petsc/install-dev-pleiades.sh
===================================================================
--- /issm/trunk/externalpackages/petsc/install-dev-pleiades.sh	(revision 12707)
+++ /issm/trunk/externalpackages/petsc/install-dev-pleiades.sh	(revision 12707)
@@ -0,0 +1,123 @@
+#!/bin/bash
+#Step 0: download
+#Step 1: install before plapack crasehs
+#Step 2: After Plapack implodes
+STEP=0
+
+if [ $STEP -eq 0 ]; then
+	# Adapted from petsc 3.2. 
+	# Used Mercurial to get code
+	rm -rf src
+	hg clone http://petsc.cs.iit.edu/petsc/petsc-dev src
+	cd src
+	hg clone http://petsc.cs.iit.edu/petsc/BuildSystem config/BuildSystem
+fi
+
+# To update (via Mercurial):
+#      cd petsc-dev
+#      hg pull -u
+#      cd config/BuildSystem
+#      hg pull -u
+
+
+# configure script
+# Note: using metis from externalpackages did not work...
+# for now downloading new metis
+#   -then rename metis in externalpackages to metis2
+if [ $STEP -eq 1 ]; then
+
+	mkdir install
+
+	#configure
+	cd src
+	./config/configure.py \
+		--prefix="$ISSM_DIR/externalpackages/petsc/install" \
+		--with-batch=1  \
+		--PETSC_ARCH="$ISSM_ARCH" \
+		--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+		--with-debugging=0 \
+		--with-shared-libraries=0 \
+		--with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+		--known-mpi-shared-libraries=1 \
+		--with-mpi-lib=/nasa/sgi/mpt/2.04/lib/libmpi.so \
+		--with-mpi-include=/nasa/sgi/mpt/2.04/include  \
+		--download-mumps=yes \
+		--download-plapack=yes \
+		--download-scalapack=yes \
+		--download-blacs=yes  \
+		--download-blas=yes \
+		--download-f-blas-lapack=yes \
+		--download-parmetis=yes \
+		--download-metis=yes \
+		--download-trilinos=yes \
+		--download-euclid=yes \
+		--download-pastix=yes \
+		--download-ptscotch=yes \
+		--download-spooles=yes \
+		--download-spai=yes \
+		--download-superlu=http://crd.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz \
+		--FFLAGS=-I/usr/include \
+		--with-cc=icc \
+		--with-fc=ifort \
+		--COPTFLAGS=" -O3 -xS" \
+		--FOPTFLAGS=" -O3 -xS" \
+		--CXXOPTFLAGS=" -O3 -xS" \
+		--with-pic=1
+	echo "== Fix Plapack compilation manually (http://issm.jpl.nasa.gov/documentation/faq/petsc32/) =="
+	echo "== Then run STEP=2 =="
+fi
+if [ $STEP -eq 2 ]; then
+	cd src
+	./config/configure.py \
+	 --prefix="$ISSM_DIR/externalpackages/petsc/install" \
+	 --with-batch=1  \
+	 --PETSC_ARCH="$ISSM_ARCH" \
+	 --PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	 --with-debugging=0 \
+	 --with-shared-libraries=0 \
+	 --with-blas-lapack-dir=/nasa/intel/mkl/10.0.011/ \
+	 --with-mpi-lib=/nasa/sgi/mpt/2.04/lib/libmpi.so \
+	 --with-mpi-include=/nasa/sgi/mpt/2.04/include  \
+	 --known-mpi-shared-libraries=1 \
+	 --download-mumps=yes \
+	 --download-scalapack=yes \
+	 --download-blacs=yes  \
+	 --download-blas=yes \
+	 --with-f-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
+	 --download-parmetis=yes \
+	 --download-metis=yes \
+	 --with-cxx=icpc \
+	 --download-hypre=yes \
+	 --download-trilinos=yes \
+	 --download-prometheus=yes \
+	 --download-euclid=yes \
+	 --download-pastix=yes \
+	 --download-ptscotch=yes \
+	 --download-spooles=yes \
+	 --download-superlu=http://crd.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz \
+	 --with-spai-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
+	 --with-plapack-dir=$ISSM_DIR/externalpackages/petsc/src/$ISSM_ARCH \
+	 --FFLAGS=-I/usr/include \
+	 --with-cc=icc \
+	 --with-fc=ifort \
+	 --COPTFLAGS=" -O3 -xS" \
+	 --FOPTFLAGS=" -O3 -xS" \
+	 --CXXOPTFLAGS=" -O3 -xS" \
+	 --with-pic=1
+	 cat > script.queue << EOF
+#PBS -S /bin/bash
+#PBS -q debug 
+#PBS -l select=1:ncpus=1:model=har 
+#PBS -l walltime=200 
+#PBS -W group_list=s1010 
+#PBS -m e 
+. /usr/share/modules/init/bash 
+module load comp-intel/11.1.046 
+module load mpi-sgi/mpt.2.04  #DEFINES MPI_Type_create_indexed_block
+module load math/intel_mkl_64_10.0.011 
+export PATH="$PATH:." 
+export MPI_GROUP_MAX=64 
+mpiexec -np 1 ./conftest-linux-gnu-ia64-intel.py
+EOF
+	echo "== Follow PETSc's instructions"
+fi
Index: /issm/trunk/externalpackages/python/install-linux64-astrid.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-linux64-astrid.sh	(revision 12706)
+++ /issm/trunk/externalpackages/python/install-linux64-astrid.sh	(revision 12707)
@@ -21,7 +21,7 @@
 rm -rf Python-$version
 
-#Configure doxygen
+#Configure python
 cd src 
-./configure --prefix="$ISSM_DIR/externalpackages/python/install" 
+./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-shared
 
 if [ -z $1 ]; then
@@ -34,10 +34,15 @@
 #Some modifications to be done in case version is 3.2: 
 if [[ $version == "3.2.2" ]]; then 
-	cd install/bin
+	cd ../install/bin
 	ln -s python3.2 python 
 	cd ../
 	ln -s Python.framework/Versions/3.2/include/python3.2m include
 	ln -s Python.framework/Versions/3.2/lib/ lib
-
-
 fi
+if [[ $version == "2.7.2" ]]; then 
+	cd ../install/include
+	cp python2.7/* ./
+	cd ../lib
+	ln -s  libpython2.7.so.1.0 libpython.so
+	
+fi
Index: /issm/trunk/externalpackages/python/install-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/python/install-macosx-snowleopard.sh	(revision 12706)
+++ /issm/trunk/externalpackages/python/install-macosx-snowleopard.sh	(revision 12707)
@@ -24,5 +24,7 @@
 #Configure doxygen
 cd src 
-./configure --prefix="$ISSM_DIR/externalpackages/python/install" --enable-framework="$ISSM_DIR/externalpackages/python/install" --enable-universalsdk --with-universal-archs="32-bit"
+# --enable-framework needs to have the form "$SOME_PATH/Library/Frameworks" to avoid installing components in /Applications directory
+# --prefix is recognized as $SOME_PATH as long as this form is taken, so it's not necessary to include
+./configure --enable-framework="$ISSM_DIR/externalpackages/python/install/Library/Frameworks" 
 if [ -z $1 ]; then
 	make
@@ -40,2 +42,9 @@
 	ln -s Python.framework/Versions/3.2/lib/ lib
 fi
+
+#Some modifications to be done in case version is 2.7
+if [[ $version == "2.7.2" ]]; then 
+	cd ../install
+	ln -s Library/Frameworks/Python.framework/Headers include
+	ln -s Library/Frameworks/Python.framework/Versions/2.7/lib lib
+fi
Index: /issm/trunk/externalpackages/scipy/README
===================================================================
--- /issm/trunk/externalpackages/scipy/README	(revision 12706)
+++ /issm/trunk/externalpackages/scipy/README	(revision 12707)
@@ -1,2 +1,9 @@
-You will find instructions on scipy at: 
+For OSX 10.7 (Lion), the instructions here can be followed:  
 http://www.scipy.org/Installing_SciPy/Mac_OS_X
+
+For OSX 10.6 (Snow Leopard), the scipy folks recommend gcc and g++ version 4.0.
+However, ISSM needs the gfortran version recommended in $ISSM_DIR/externalpackages/gfortran.
+On the webpage listed above, make sure the "export CC" and "export CXX" commands point to the 
+binaries associated with this gfortran version (likely in /usr/local/gfortran/bin by default).
+Once this gfortran is installed, the install script in this directory for Snow Leopard should
+work.
Index: /issm/trunk/externalpackages/scipy/install-macosx-snowleopard.sh
===================================================================
--- /issm/trunk/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 12706)
+++ /issm/trunk/externalpackages/scipy/install-macosx-snowleopard.sh	(revision 12707)
@@ -8,6 +8,8 @@
 install=2
 
-export CC=/usr/bin/gcc-4.0
-export CXX=/usr/bin/g++-4.0
+# gfortran 4.6 (see ISSM_DIR/externalpackages/gfortran) is necessary for ISSM compilation.
+# On OSX 10.6, this recommended version gets installed in /usr/local/gfortran 
+export CC=/usr/local/gfortran/bin/gcc
+export CXX=/usr/local/gfortran/bin/g++
 
 if [[ $install == "1" ]];then 
@@ -22,4 +24,5 @@
 	cd ..
 	${PYTHON} -c "import numpy; print 'Installed NumPy', numpy.__version__"
+	${PYTHON} -c "import numpy; numpy.test()"
 	
 elif [[ $install == "2" ]];then 
@@ -34,4 +37,5 @@
 	cd ..
 	${PYTHON} -c "import scipy; print 'Installed SciPy', scipy.__version__"
+	${PYTHON} -c "import scipy; scipy.test()"
 
 elif [[ $install == "3" ]];then 
Index: /issm/trunk/externalpackages/triangle/configs/android/configure.make
===================================================================
--- /issm/trunk/externalpackages/triangle/configs/android/configure.make	(revision 12707)
+++ /issm/trunk/externalpackages/triangle/configs/android/configure.make	(revision 12707)
@@ -0,0 +1,17 @@
+# This makefile configures build process to cross-compile to the android platform.
+# The binary tools referenced below are specifically configuered to target armeabi-v7a.
+# Furthermore, the compilers (which are simply wrappers around GNU GCC) are set to
+# produce binaries that are EABI complient.
+#
+# Note that the AAPCS standard defines 'EABI' as a moniker used to specify
+# a _family_ of similar but distinct ABIs. Android follows the little-endian
+# ARM GNU/Linux ABI as documented in the following document:
+#
+# http://www.codesourcery.com/gnu_toolchains/arm/arm_gnu_linux_abi.pdf
+CC=${toolchain_path}-gcc
+AR=${toolchain_path}-ar
+RANLIB=${toolchain_path}-ranlib
+CSWITCHES = $(CFLAGS)
+TRILIBDEFS = -DTRILIBRARY
+OBJ_EXT=o
+LIB_EXT=a
Index: sm/trunk/externalpackages/triangle/install-android-4.0.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-android-4.0.sh	(revision 12706)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#!/bin/bash
-
-#use matlab? 
-matlab=0
-
-#Some cleanup 
-rm -rf install triangle
-mkdir install
-
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
-
-#Untar 
-cd install
-cp ../triangle.zip ./
-unzip triangle.zip
-
-#copy new makefile
-cp ../configs/android/android-4.0/configure.make ./
-cp ../makefile ./
-
-#Patch triangle.c 
-if [[ $matlab == "1" ]];then
-	patch triangle.c ../triangle.c.patch.matlab
-else
-	patch triangle.c ../triangle.c.patch.python
-fi
-
-#Compile triangle
-make
-
-#Patch triangle.h
-patch triangle.h ../triangle.h.patch
Index: /issm/trunk/externalpackages/triangle/install-android.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-android.sh	(revision 12707)
+++ /issm/trunk/externalpackages/triangle/install-android.sh	(revision 12707)
@@ -0,0 +1,35 @@
+#!/bin/bash
+source $ANDROID_DIR/android_variables.sh
+export toolchain_path
+
+#use matlab? 
+matlab=0
+
+#Some cleanup 
+rm -rf install triangle
+mkdir install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+
+#Untar 
+cd install
+cp ../triangle.zip ./
+unzip triangle.zip
+
+#copy new makefile
+cp ../configs//android/configure.make ./
+cp ../makefile ./
+
+#Patch triangle.c 
+if [[ $matlab == "1" ]];then
+	patch triangle.c ../triangle.c.patch.matlab
+else
+	patch triangle.c ../triangle.c.patch.python
+fi
+
+#Compile triangle
+make
+
+#Patch triangle.h
+patch triangle.h ../triangle.h.patch
Index: /issm/trunk/externalpackages/triangle/install-discover.sh
===================================================================
--- /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 12707)
+++ /issm/trunk/externalpackages/triangle/install-discover.sh	(revision 12707)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+#Some cleanup 
+rm -rf install triangle
+mkdir install
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.py 'http://issm.jpl.nasa.gov/files/externalpackages/triangle.zip' 'triangle.zip'
+
+#Untar 
+cd install
+cp ../triangle.zip ./
+unzip triangle.zip
+
+#copy new makefile
+cp ../configs/pleiades/configure.make ./
+cp ../makefile ./
+
+#Patch triangle.c 
+patch triangle.c ../triangle.c.patch
+
+#Compile triangle
+make
+
+#Patch triangle.h
+patch triangle.h ../triangle.h.patch
Index: /issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim
===================================================================
--- /issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12706)
+++ /issm/trunk/externalpackages/vim/addons/vim/syntax/c.vim	(revision 12707)
@@ -404,9 +404,9 @@
 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 "ISSM containers:
-syn keyword	cType		Constraints DataSet Elements Inputs Loads Materials Nodes Parameters Results Vertices
+syn keyword	cType		Constraints DataSet Elements Inputs Loads Materials Nodes Parameters Results Vertices Options
 "Petsc
-syn keyword	cType		Vec Mat
+syn keyword	cType		Vec Mat SeqVec SeqMat
 "other ISSM's syntax
-syn keyword	cType		mxArray ErrorException
+syn keyword	cType		mxArray ErrorException QuadtreeBox IssmDouble IssmPDouble
 
 "ISSM's objects begin
@@ -710,10 +710,10 @@
 syn keyword cConstant SurfaceforcingsMonthlytemperaturesEnum
 syn keyword cConstant SurfaceforcingsHcEnum
-syn keyword cConstant SurfaceforcingsSmb_pos_maxEnum
-syn keyword cConstant SurfaceforcingsSmb_pos_minEnum
-syn keyword cConstant SurfaceforcingsA_posEnum
-syn keyword cConstant SurfaceforcingsB_posEnum
-syn keyword cConstant SurfaceforcingsA_negEnum
-syn keyword cConstant SurfaceforcingsB_negEnum
+syn keyword cConstant SurfaceforcingsSmbPosMaxEnum
+syn keyword cConstant SurfaceforcingsSmbPosMinEnum
+syn keyword cConstant SurfaceforcingsAPosEnum
+syn keyword cConstant SurfaceforcingsBPosEnum
+syn keyword cConstant SurfaceforcingsANegEnum
+syn keyword cConstant SurfaceforcingsBNegEnum
 syn keyword cConstant ThermalMaxiterEnum
 syn keyword cConstant ThermalPenaltyFactorEnum
Index: /issm/trunk/m4/issm_options.m4
===================================================================
--- /issm/trunk/m4/issm_options.m4	(revision 12706)
+++ /issm/trunk/m4/issm_options.m4	(revision 12707)
@@ -60,4 +60,9 @@
 			export CFLAGS=" -D_INTEL_LINUX_"
 			export CXXFLAGS=" -D_INTEL_LINUX_"
+		elif test $VENDOR = intel-discover; then
+			export CC=icc
+			export CXX=icpc
+			export CXXFLAGS=" -O3 -D_INTEL_LINUX_ "
+			export CFLAGS=" -O3 -D_INTEL_LINUX_ "
 		elif test $VENDOR = intel-pleiades; then
 			export CC=icc
@@ -65,10 +70,4 @@
 			export CXXFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
 			export CFLAGS=" -O3 -xS -D_INTEL_LINUX_ "
-		elif test $VENDOR = arm-linux; then
-			export CC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-gcc
-			export GCC=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-gcc
-			export CXX=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-g++
-			export AR=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-ar
-			export RANLIB=$ANDROID_DIR/arm-linux-android-4.0/bin/arm-linux-androideabi-ranlib
         else
 		AC_MSG_ERROR([unknow compiler vendor!])
@@ -320,5 +319,16 @@
 		PYTHONLIB="-L$PYTHON_ROOT/lib -lpython$PYTHONVERSION"
 		PYTHONEXT=.so
-		PYTHONLINK="-dynamiclib"
+
+		case "${host_os}" in
+			*cygwin*)
+			PYTHONLINK="-shared"
+			;;
+			*linux*)
+			PYTHONLINK="-shared"
+			;;
+			*darwin*)
+			PYTHONLINK="-dynamiclib"
+			;;
+		esac
 
 		AC_DEFINE([_HAVE_PYTHON_],[1],[with Python in ISSM src])
@@ -429,5 +439,5 @@
 			dnl defaults
 			HAVE_ADOLC=yes
-			ADOLCINCL="-I$ADOLC_ROOT/include/adolc -I$ADOLC_ROOT/include"
+			ADOLCINCL="-I$ADOLC_ROOT/include"
 			ADOLCLIB="-L$ADOLC_ROOT/lib64 -ladolc"
 
@@ -746,5 +756,9 @@
 		dnl defaults
 		HAVE_SCALAPACK=yes
-		SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+		if test x$VENDOR = xintel-discover; then
+		 SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lmkl_scalapack_lp64"
+		else
+		 SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"
+		fi
 
 		AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
@@ -766,5 +780,8 @@
 		HAVE_BLASLAPACK=yes
 		BLASLAPACKINCL=""
-		
+	
+		if test x$VENDOR = xintel-discover; then
+		 BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide -lpthread"
+		else
 		dnl: branch on whether we are running on windows or linux.
 		case "${host_os}" in
@@ -779,4 +796,5 @@
 			;;
 		esac
+		fi
 
 		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with blas lapack in ISSM src])
@@ -853,4 +871,5 @@
 		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lpord "
 		else
+		dnl MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lmumps_common -lpord -lparmetis -lzmumps"
 		MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps  -lmumps_common -lpord -lparmetis"
 		fi
@@ -875,5 +894,9 @@
 		HAVE_BLACS=yes
 		BLACSINCL=""
-		BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+		if test x$VENDOR = xintel-discover; then
+		 BLACSLIB=-L"$BLACS_ROOT/ -lmkl_blacs_intelmpi_lp64"
+		else
+		 BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
+		fi
         
 		AC_DEFINE([_HAVE_BLACS_],[1],[with Blacs in ISSM src])
@@ -896,5 +919,5 @@
 		HAVE_HYPRE=yes
 		HYPREINCL=""
-		HYPRELIB=-L"$HYPRE_ROOT/ -lHYPRE"
+		HYPRELIB=-L"$HYPRE_ROOT/lib -lHYPRE"
         
 		AC_DEFINE([_HAVE_HYPRE_],[1],[with Blacs in ISSM src])
@@ -906,4 +929,109 @@
 	AC_MSG_RESULT($HAVE_HYPRE)
 	dnl }}}
+	dnl prometheus{{{
+		AC_ARG_WITH([prometheus-dir],
+					AS_HELP_STRING([--with-prometheus-dir=DIR],[prometheus root directory]),
+					[PROMETHEUS_ROOT=$withval],[PROMETHEUS_ROOT=""])
+
+		  AC_MSG_CHECKING(for prometheus headers and libraries in $PROMETHEUS_ROOT)
+		  if test -d "$PROMETHEUS_ROOT"; then
+
+			dnl defaults
+			  HAVE_PROMETHEUS=yes
+			  PROMETHEUSINCL=-I"$PROMETHEUS_ROOT/include"
+			  PROMETHEUSLIB=-L"$PROMETHEUS_ROOT/lib -lpromfei -lprometheus -lparmetis"
+
+			  AC_DEFINE([_HAVE_PROMETHEUS_],[1],[with Prometheus in ISSM src])
+			  AC_SUBST([PROMETHEUSINCL])
+			  AC_SUBST([PROMETHEUSLIB])
+		  else
+				HAVE_PROMETHEUS=no
+			fi
+			AC_MSG_RESULT($HAVE_PROMETHEUS)
+		dnl }}}
+dnl spai{{{
+	AC_ARG_WITH([spai-dir],
+				AS_HELP_STRING([--with-spai-dir=DIR],[spai root directory]),
+				[SPAI_ROOT=$withval],[SPAI_ROOT=""])
+
+	  AC_MSG_CHECKING(for spai headers and libraries in $SPAI_ROOT)
+	  if test -d "$SPAI_ROOT"; then
+
+		dnl defaults
+		  HAVE_SPAI=yes
+		  SPAIINCL=-I"$SPAI_ROOT/include"
+		  SPAILIB=-L"$SPAI_ROOT/lib -lspai"
+
+		  AC_DEFINE([_HAVE_SPAI_],[1],[with Spai in ISSM src])
+		  AC_SUBST([SPAIINCL])
+		  AC_SUBST([SPAILIB])
+	  else
+		HAVE_SPAI=no
+		  fi
+		  AC_MSG_RESULT($HAVE_SPAI)
+		  dnl }}}
+dnl superlu{{{ 
+	AC_ARG_WITH([superlu-dir],
+				AS_HELP_STRING([--with-superlu-dir=DIR],[superlu root directory]),
+				[SUPERLU_ROOT=$withval],[SUPERLU_ROOT=""])
+
+	  AC_MSG_CHECKING(for superlu headers and libraries in $SUPERLU_ROOT)
+	  if test -d "$SUPERLU_ROOT"; then
+
+		dnl defaults
+		  HAVE_SUPERLU=yes
+		  SUPERLUINCL=-I"$SUPERLU_ROOT/include"
+		  SUPERLULIB=-L"$SUPERLU_ROOT/lib -lsuperlu_4.3"
+
+		  AC_DEFINE([_HAVE_SUPERLU_],[1],[with Superlu in ISSM src])
+		  AC_SUBST([SUPERLUINCL])
+		  AC_SUBST([SUPERLULIB])
+	  else
+		HAVE_SUPERLU=no
+		  fi
+		  AC_MSG_RESULT($HAVE_SUPERLU)
+		  dnl }}}
+dnl spooles{{{ 
+	AC_ARG_WITH([spooles-dir],
+				AS_HELP_STRING([--with-spooles-dir=DIR],[spooles root directory]),
+				[SPOOLES_ROOT=$withval],[SPOOLES_ROOT=""])
+
+	  AC_MSG_CHECKING(for spooles headers and libraries in $SPOOLES_ROOT)
+	  if test -d "$SPOOLES_ROOT"; then
+
+		dnl defaults
+		  HAVE_SPOOLES=yes
+		  SPOOLESINCL=-I"$SPOOLES_ROOT/include"
+		  SPOOLESLIB=-L"$SPOOLES_ROOT/lib -lspooles"
+
+		  AC_DEFINE([_HAVE_SPOOLES_],[1],[with Spooles in ISSM src])
+		  AC_SUBST([SPOOLESINCL])
+		  AC_SUBST([SPOOLESLIB])
+	  else
+		HAVE_SPOOLES=no
+		  fi
+		  AC_MSG_RESULT($HAVE_SPOOLES)
+		  dnl }}}
+dnl pastix{{{ 
+	AC_ARG_WITH([pastix-dir],
+				AS_HELP_STRING([--with-pastix-dir=DIR],[pastix root directory]),
+				[PASTIX_ROOT=$withval],[PASTIX_ROOT=""])
+
+	  AC_MSG_CHECKING(for pastix headers and libraries in $PASTIX_ROOT)
+	  if test -d "$PASTIX_ROOT"; then
+
+		dnl defaults
+		  HAVE_PASTIX=yes
+		  PASTIXINCL=-I"$PASTIX_ROOT/include"
+		  PASTIXLIB=-L"$PASTIX_ROOT/lib -lpastix_XXbit_mpi_smp_nobubble_int32_simple_real_scotch_i686_pc_linux -lptscotch -lptscotcherr -lpastix"
+
+		  AC_DEFINE([_HAVE_PASTIX_],[1],[with Pastix in ISSM src])
+		  AC_SUBST([PASTIXINCL])
+		  AC_SUBST([PASTIXLIB])
+	  else
+		HAVE_PASTIX=no
+		  fi
+		  AC_MSG_RESULT($HAVE_PASTIX)
+		  dnl }}}
 	dnl ml{{{
 	AC_ARG_WITH([ml-dir],
@@ -990,4 +1118,21 @@
 	fi
 	AC_MSG_RESULT(done)
+	dnl }}}
+
+	dnl Capabilities
+	dnl with-kriging{{{
+	AC_ARG_WITH([kriging],
+		AS_HELP_STRING([--with-kriging = YES],[compile with kriging capabilities (default is yes)]),
+		[KRIGING=$withval],[KRIGING=yes]) 
+	AC_MSG_CHECKING(for kriging capability compilation)
+
+	if test "x$KRIGING" = "xyes"; then
+		HAVE_KRIGING=yes
+		AC_DEFINE([_HAVE_KRIGING_],[1],[with kriging capability])
+	else
+		HAVE_KRIGING=no
+	fi
+	AM_CONDITIONAL([KRIGING], [test x$HAVE_KRIGING = xyes])
+	AC_MSG_RESULT($HAVE_KRIGING)
 	dnl }}}
 	dnl with-steadystate{{{
@@ -1310,3 +1455,12 @@
 	AC_MSG_RESULT($USE_64BIT_INDICES)
 	dnl }}}
+	dnl circular-dependency{{{
+	AC_ARG_WITH([circular-dependency],
+	  AS_HELP_STRING([--with-circular-dependency = bool],[do we look for circular dependencies, default "yes", ex: --with-circular-dependency="no"]),
+	  [CIRCULAR_DEPENDENCIES=$withval],[CIRCULAR_DEPENDENCIES=yes]) 
+	AC_MSG_CHECKING(for circular dependencies)
+	AM_CONDITIONAL([CIRCULAR_DEPENDENCIES], [test x$CIRCULAR_DEPENDENCIES = xyes])
+	AC_MSG_RESULT($CIRCULAR_DEPENDENCIES) 
+
+	dnl }}}
 ])
Index: /issm/trunk/scripts/automakererun.sh
===================================================================
--- /issm/trunk/scripts/automakererun.sh	(revision 12706)
+++ /issm/trunk/scripts/automakererun.sh	(revision 12707)
@@ -3,39 +3,9 @@
 #  archive.
 
+# As it turns out, the autoreconf script provided by Autotools
+# encompasses the functionality of this script. As such, the 
+# following two lines will replace the remainder of the script.
+# If all goes well, then the script will be shortened in the future.
 
- ACLOCAL="$ISSM_DIR/externalpackages/automake/install/bin/aclocal"
-AUTOCONF="$ISSM_DIR/externalpackages/autoconf/install/bin/autoconf"
-AUTOHEAD="$ISSM_DIR/externalpackages/autoconf/install/bin/autoheader"
-AUTOMAKE="$ISSM_DIR/externalpackages/automake/install/bin/automake"
-
-echo "removing config.cach"
-rm -rf config.cach
-rm -rf aclocal.m4
-
-if [ ! -f "$ACLOCAL" ]
-then echo "issm aclocal not found, calling default aclocal" 
-	aclocal -I m4
-else echo "Calling aclocal" 
-	$ACLOCAL -I m4
-fi
-
-if [ ! -f "$AUTOCONF" ]
-then echo "issm autoconf not found, calling default aclocal" 
-	autoconf
-else echo "Calling autoconf" 
-	$AUTOCONF
-fi
-
-if [ ! -f "$AUTOHEAD" ]
-then echo "issm autoheader not found, calling default aclocal" 
-	autoheader
-else echo "Calling autoheader" 
-	$AUTOHEAD
-fi
-
-if [ ! -f "$AUTOMAKE" ]
-then echo "issm automake  not found, calling default aclocal" 
-	automake
-else echo "Calling automake " 
-	$AUTOMAKE -a
-fi
+cd $ISSM_DIR
+autoreconf -iv -I m4
Index: /issm/trunk/scripts/getloc.sh
===================================================================
--- /issm/trunk/scripts/getloc.sh	(revision 12706)
+++ /issm/trunk/scripts/getloc.sh	(revision 12707)
@@ -1,5 +1,5 @@
 #!/bin/bash
 #get number of lines of code
-cloc-1.55.pl $ISSM_DIR/src $ISSM_DIR/m4 --exclude-dir=.svn --exclude-ext=exp --exclude-lang=make --out=temp
+cloc-1.55.pl $ISSM_DIR/src $ISSM_DIR/m4 --exclude-dir=.svn --exclude-dir=ad  --exclude-dir=android --exclude-ext=exp --exclude-lang=make --out=temp
 cat temp
 ./cloc2html.py
Index: /issm/trunk/startup.py
===================================================================
--- /issm/trunk/startup.py	(revision 12706)
+++ /issm/trunk/startup.py	(revision 12707)
@@ -22,4 +22,6 @@
 #ISSM path. Go through src/py and load everything we find  that looks like a python file
 for root,dirs,files in os.walk(ISSM_DIR+ '/src/py'):
+	if '.svn' in dirs:
+		dirs.remove('.svn')
 	for file in files:
 		if file.find(".py") != -1:
@@ -31,4 +33,6 @@
 
 for root,dirs,files in os.walk(ISSM_DIR+ '/src/m'):
+	if '.svn' in dirs:
+		dirs.remove('.svn')
 	for file in files:
 		if file.find(".py") != -1:
@@ -77,6 +81,4 @@
 from stokesoptions import *
 from generic import *
-from none import *
-from none import *
 from hydrology import *
 from miscellaneous import *
Index: /issm/trunk/test/NightlyRun/IdFromString.m
===================================================================
--- /issm/trunk/test/NightlyRun/IdFromString.m	(revision 12706)
+++ /issm/trunk/test/NightlyRun/IdFromString.m	(revision 12707)
@@ -22,5 +22,5 @@
 %return if no test found
 if isempty(ids_raw),
-	disp(['No test matches ''' string '' ]);
+	disp(['No test matches ''' string '''' ]);
 	return
 end
Index: /issm/trunk/test/NightlyRun/IdFromString.py
===================================================================
--- /issm/trunk/test/NightlyRun/IdFromString.py	(revision 12707)
+++ /issm/trunk/test/NightlyRun/IdFromString.py	(revision 12707)
@@ -0,0 +1,37 @@
+#! /usr/bin/env python
+"""
+IDFROMSTRING - output ids from a given string
+ 
+    Usage:
+       ids=IdFromString(string)
+ 
+    Examples:
+       ids=IdFromString('Parallel')
+       ids=IdFromString('79North')
+"""
+
+from IdToName import IdToName
+
+def IdFromString(string):
+
+	#Check input
+	if not isinstance(string,str):
+		raise TypeError('IdFromString error message: input argument is not a string.')
+
+	#Get the dictionary and scan for matches
+	idnames=IdToName(0)
+	ids=[item[0] for item in idnames.iteritems() if string in item[1]]
+
+	#Return if no test found
+	if not ids:
+		print "No test matches '%s'." % string
+		return ids
+
+	#Display names
+	ids.sort()
+	print "%d tests match '%s':" % (len(ids),string)
+	for id in ids:
+		print "   %d : %s" % (id,idnames[id])
+
+	return ids
+
Index: /issm/trunk/test/NightlyRun/IdToName.m
===================================================================
--- /issm/trunk/test/NightlyRun/IdToName.m	(revision 12706)
+++ /issm/trunk/test/NightlyRun/IdToName.m	(revision 12707)
@@ -116,6 +116,6 @@
 	case 265, name='SquareShelfTranP3dForcTempSerial';
 	case 266, name='SquareShelfTranP3dForcTempParallel';
-	case 267, name='SquareShelfTranForceNeg2dDakotaSamp';
-   case 268, name='SquareShelfTranForceNeg2dDakotaLocal';
+	case 268, name='SquareShelfTranForceNeg2dDakotaSamp';
+	case 270, name='SquareShelfTranForceNeg2dDakotaLocal';
 	case 301, name='SquareSheetConstrainedDiagM2dSerial';
 	case 302, name='SquareSheetConstrainedDiagM2dParallel';
@@ -172,4 +172,6 @@
 	case 353, name='SquareSheetConstrainedTransP3dEnthSerial';
 	case 354, name='SquareSheetConstrainedTransP3dEnthParallel';
+	case 356, name='SquareSheetConstrainedSmbGradients2dParallel';
+	case 358, name='SquareSheetConstrainedSmbGradients3dParallel';
 	case 401, name='SquareSheetShelfDiagM2dSerial';
 	case 402, name='SquareSheetShelfDiagM2dParallel';
@@ -205,5 +207,5 @@
 	case 432, name='SquareSheetShelfCMDragSteaP3dParallel';
 	case 434, name='SquareSheetShelfDiadM3dDakotaSamp';
-	case 435, name='SquareSheetShelfDiadM3dDakotaAreaAverage';
+	case 436, name='SquareSheetShelfDiadM3dDakotaAreaAverage';
 	case 437, name='SquareSheetShelfDiagMP3dTilingSerial';
 	case 438, name='SquareSheetShelfDiagMP3dTilingParallel';
Index: /issm/trunk/test/NightlyRun/IdToName.py
===================================================================
--- /issm/trunk/test/NightlyRun/IdToName.py	(revision 12707)
+++ /issm/trunk/test/NightlyRun/IdToName.py	(revision 12707)
@@ -0,0 +1,329 @@
+#! /usr/bin/env python
+"""
+IDTONAME- return name of test
+ 
+    Usage:
+       name=IdToName(id)
+"""
+
+def IdToName(id):
+	idname={
+		101 : 'SquareShelfConstrainedDiagM2dSerial',
+		102 : 'SquareShelfConstrainedDiagM2dParallel',
+		103 : 'SquareShelfConstrainedDiagM3dSerial',
+		104 : 'SquareShelfConstrainedDiagM3dParallel',
+		105 : 'SquareShelfConstrainedDiagP3dSerial',
+		106 : 'SquareShelfConstrainedDiagP3dParallel',
+		107 : 'SquareShelfConstrainedDiagS3dSerial',
+		108 : 'SquareShelfConstrainedDiagS3dParallel',
+		109 : 'SquareShelfConstrainedProg2dSerial',
+		110 : 'SquareShelfConstrainedProg2dParallel',
+		111 : 'SquareShelfConstrainedProg2dDGSerial',
+		112 : 'SquareShelfConstrainedProg2dDGParallel',
+		113 : 'SquareShelfConstrainedProg3dSerial',
+		114 : 'SquareShelfConstrainedProg3dParallel',
+		115 : 'SquareShelfConstrainedTherSteaSerial',
+		116 : 'SquareShelfConstrainedTherSteaParallel',
+		117 : 'SquareShelfConstrainedTherTranSerial',
+		118 : 'SquareShelfConstrainedTherTranParallel',
+		119 : 'SquareShelfConstrainedTranM2dSerial',
+		120 : 'SquareShelfConstrainedTranM2dParallel',
+		121 : 'SquareShelfConstrainedTranP3dSerial',
+		122 : 'SquareShelfConstrainedTranP3dParallel',
+		123 : 'SquareShelfConstrainedSurfSlop2dSerial',
+		124 : 'SquareShelfConstrainedSurfSlop2dParallel',
+		125 : 'SquareShelfConstrainedSurfSlop3dSerial',
+		126 : 'SquareShelfConstrainedSurfSlope3dParallel',
+		127 : 'SquareShelfConstrainedBedSlop2dSerial',
+		128 : 'SquareShelfConstrainedBedSlop2dParallel',
+		129 : 'SquareShelfConstrainedBedSlop3dSerial',
+		130 : 'SquareShelfConstrainedBedSlop3dParallel',
+		131 : 'SquareShelfConstrainedBalThic2dSerial',
+		132 : 'SquareShelfConstrainedBalThic2dParallel',
+		133 : 'SquareShelfConstrainedBalThic3dSerial',
+		134 : 'SquareShelfConstrainedBalThic3dParallel',
+		135 : 'SquareShelfConstrainedBalThic2dDGSerial',
+		136 : 'SquareShelfConstrainedBalThic2dDGParallel',
+		137 : 'SquareBamgMesh',
+		139 : 'SquareShelfConstrainedEnthalpySteaSerial',
+		140 : 'SquareShelfConstrainedEnthalpySteaParallel',
+		141 : 'SquareShelfConstrainedEnthalpyTranSerial',
+		142 : 'SquareShelfConstrainedEnthalpyTranParallel',
+		143 : 'SquareShelfConstrainedTransP3dEnthSerial',
+		144 : 'SquareShelfConstrainedTransP3dEnthParallel',
+		201 : 'SquareShelfDiagM2dSerial',
+		202 : 'SquareShelfDiagM2dParallel',
+		203 : 'SquareShelfDiagM3dSerial',
+		204 : 'SquareShelfDiagM3dParallel',
+		205 : 'SquareShelfDiagP3dSerial',
+		206 : 'SquareShelfDiagP3dParallel',
+		207 : 'SquareShelfDiagS3dSerial',
+		208 : 'SquareShelfDiagS3dParallel',
+		209 : 'SquareShelfDiagMP3dPenaltiesSerial',
+		210 : 'SquareShelfDiagMP3dPenaltiesParallel',
+		211 : 'SquareShelfTherSteaSerial',
+		212 : 'SquareShelfTherSteaParallel',
+		213 : 'SquareShelfTherTranSerial',
+		214 : 'SquareShelfTherTranParallel',
+		215 : 'SquareShelfTranM2dSerial',
+		216 : 'SquareShelfTranM2dParallel',
+		217 : 'SquareShelfTranM3dSerial',
+		218 : 'SquareShelfTranM3dParallel',
+		219 : 'SquareShelfTranP3dSerial',
+		220 : 'SquareShelfTranP3dParallel',
+		221 : 'SquareShelfTranS3dSerial',
+		222 : 'SquareShelfTranS3dParallel',
+		223 : 'SquareShelfCMBM2dSerial',
+		224 : 'SquareShelfCMBM2dParallel',
+		225 : 'SquareShelfCMBM3dSerial',
+		226 : 'SquareShelfCMBM3dParallel',
+		227 : 'SquareShelfCMBP3dSerial',
+		228 : 'SquareShelfCMBP3dParallel',
+		229 : 'SquareShelfCMBS3dSerial',
+		230 : 'SquareShelfCMBS3dParallel',
+		231 : 'SquareShelfDiagM2dRiftSerial',
+		232 : 'SquareShelfDiagM2dRiftParallel',
+		233 : 'SquareShelfConstrainedSerial',
+		234 : 'SquareShelfConstrainedParallel',
+		235 : 'SquareShelfConstrainedDakotaBSerial',
+		236 : 'SquareShelfConstrainedDakotaBParallel',
+		237 : 'SquareShelfDiagMP3dTilingSerial',
+		238 : 'SquareShelfDiagMP3dTilingParallel',
+		239 : 'SquareShelfDiagPS3dTilingSerial',
+		240 : 'SquareShelfDiagPS3dTilingParallel',
+		241 : 'SquareShelfDiagMS3dTilingSerial',
+		242 : 'SquareShelfDiagMS3dTilingParallel',
+		243 : 'SquareShelfDiagM2dTransientIncrHydroSerial',
+		244 : 'SquareShelfDiagM2dTransientIncrHydroParallel',
+		245 : 'SquareShelfDiagM2dTransientIncrNonHydroSerial',
+		246 : 'SquareShelfDiagM2dTransientIncrNonHydroParallel',
+		247 : 'SquareShelfDiagP3dTransientIncrHydroSerial',
+		248 : 'SquareShelfDiagP3dTransientIncrHydroParallel',
+		249 : 'SquareShelfDiagP3dTransientIncrNonHydroSerial',
+		250 : 'SquareShelfDiagP3dTransientIncrNonHydroParallel',
+		251 : 'SquareShelfTranCflM2dSerial',
+		252 : 'SquareShelfTranCflM2dParallel',
+		253 : 'SquareShelfTranCflP3dSerial',
+		254 : 'SquareShelfTranCflP3dParallel',
+		255 : 'SquareShelfTranForceNeg2dSerial',
+		256 : 'SquareShelfTranForceNeg2dParallel',
+		257 : 'SquareShelfTranForcePos2dSerial',
+		258 : 'SquareShelfTranForcePos2dParallel',
+		259 : 'SquareShelfTranForceNeg3dSerial',
+		260 : 'SquareShelfTranForceNeg3dParallel',
+		261 : 'SquareShelfTranForcePos3dSerial',
+		262 : 'SquareShelfTranForcePos3dParallel',
+		263 : 'SquareShelfTherTranForcTempSerial',
+		264 : 'SquareShelfTherTranForcTempParallel',
+		265 : 'SquareShelfTranP3dForcTempSerial',
+		266 : 'SquareShelfTranP3dForcTempParallel',
+		267 : 'SquareShelfTranForceNeg2dDakotaSamp',
+   	268 : 'SquareShelfTranForceNeg2dDakotaLocal',
+		301 : 'SquareSheetConstrainedDiagM2dSerial',
+		302 : 'SquareSheetConstrainedDiagM2dParallel',
+		303 : 'SquareSheetConstrainedDiagH2dSerial',
+		304 : 'SquareSheetConstrainedDiagH2dParallel',
+		305 : 'SquareSheetConstrainedDiagHM2dSerial',
+		306 : 'SquareSheetConstrainedDiagHM2dParallel',
+		307 : 'SquareSheetConstrainedDiagM3dSerial',
+		308 : 'SquareSheetConstrainedDiagM3dParallel',
+		309 : 'SquareSheetConstrainedDiagH3dSerial',
+		310 : 'SquareSheetConstrainedDiagH3dParallel',
+		311 : 'SquareSheetConstrainedDiagHM3dSerial',
+		312 : 'SquareSheetConstrainedDiagHM3dParallel',
+		313 : 'SquareSheetConstrainedDiagP3dSerial',
+		314 : 'SquareSheetConstrainedDiagP3dParallel',
+		315 : 'SquareSheetConstrainedDiagS3dSerial',
+		316 : 'SquareSheetConstrainedDiagS3dParallel',
+		317 : 'SquareSheetConstrainedProg2dSerial',
+		318 : 'SquareSheetConstrainedProg2dParallel',
+		319 : 'SquareSheetConstrainedProg2dDGSerial',
+		320 : 'SquareSheetConstrainedProg2dDGParallel',
+		321 : 'SquareSheetConstrainedProg3dSerial',
+		322 : 'SquareSheetConstrainedProg3dParallel',
+		323 : 'SquareSheetConstrainedTherSteaSerial',
+		324 : 'SquareSheetConstrainedTherSteaParallel',
+		325 : 'SquareSheetConstrainedTherTranSerial',
+		326 : 'SquareSheetConstrainedTherTranParallel',
+		327 : 'SquareSheetConstrainedTranH2dSerial',
+		328 : 'SquareSheetConstrainedTranH2dParallel',
+		329 : 'SquareSheetConstrainedTranH3dSerial',
+		330 : 'SquareSheetConstrainedTranH3dParallel',
+		331 : 'SquareSheetConstrainedTranM2dSerial',
+		332 : 'SquareSheetConstrainedTranM2dParallel',
+		333 : 'SquareSheetConstrainedTranP3dSerial',
+		334 : 'SquareSheetConstrainedTranP3dParallel',
+		335 : 'SquareSheetConstrainedSteaH3dSerial',
+		336 : 'SquareSheetConstrainedSteaH3dParallel',
+		337 : 'SquareSheetConstrainedCMDragM2dSerial',
+		338 : 'SquareSheetConstrainedCMDragM2dParallel',
+		339 : 'SquareSheetConstrainedCMDragM3dSerial',
+		340 : 'SquareSheetConstrainedCMDragM3dParallel',
+		341 : 'SquareSheetConstrainedCMDragP3dSerial',
+		342 : 'SquareSheetConstrainedCMDragP3dParallel',
+		343 : 'SquareSheetConstrainedCMDragS3dSerial',
+		344 : 'SquareSheetConstrainedCMDragS3dParallel',
+		345 : 'SquareSheetConstrainedTranCflM2dSerial',
+		346 : 'SquareSheetConstrainedTranCflM2dParallel',
+		347 : 'SquareSheetConstrainedTranCflH3dSerial',
+		348 : 'SquareSheetConstrainedTranCflH3dParallel',
+		349 : 'SquareSheetConstrainedEnthalpySteaSerial',
+		350 : 'SquareSheetConstrainedEnthalpySteaParallel',
+		351 : 'SquareSheetConstrainedEnthalpyTranSerial',
+		352 : 'SquareSheetConstrainedEnthalpyTranParallel',
+		353 : 'SquareSheetConstrainedTransP3dEnthSerial',
+		354 : 'SquareSheetConstrainedTransP3dEnthParallel',
+		401 : 'SquareSheetShelfDiagM2dSerial',
+		402 : 'SquareSheetShelfDiagM2dParallel',
+		403 : 'SquareSheetShelfDiagM3dSerial',
+		404 : 'SquareSheetShelfDiagM3dParallel',
+		405 : 'SquareSheetShelfDiagP3dSerial',
+		406 : 'SquareSheetShelfDiagP3dParallel',
+		407 : 'SquareSheetShelfDiagS3dSerial',
+		408 : 'SquareSheetShelfDiagS3dParallel',
+		409 : 'SquareSheetShelfDiagMP3dPenaltiesSerial',
+		410 : 'SquareSheetShelfDiagMP3dPenaltiesParallel',
+		411 : 'SquareSheetShelfTherSteaSerial',
+		412 : 'SquareSheetShelfTherSteaParallel',
+		413 : 'SquareSheetShelfTherTranSerial',
+		414 : 'SquareSheetShelfTherTranParallel',
+		415 : 'SquareSheetShelfTranM2dSerial',
+		416 : 'SquareSheetShelfTranM2dParallel',
+		417 : 'SquareSheetShelfTranMP3dPenaltiesSerial',
+		418 : 'SquareSheetShelfTranMP3dPenaltiesParallel',
+		419 : 'SquareSheetShelfSteaM3dSerial',
+		420 : 'SquareSheetShelfSteaM3dParallel',
+		421 : 'SquareSheetShelfSteaP3dSerial',
+		422 : 'SquareSheetShelfSteaP3dParallel',
+		423 : 'SquareSheetShelfDiadM3dDakotaSerial',
+		424 : 'SquareSheetShelfDiadM3dDakotaParallel',
+		425 : 'SquareSheetShelfDiadM3dDakotaPartSerial',
+		426 : 'SquareSheetShelfDiadM3dDakotaPartParallel',
+		427 : 'SquareSheetShelfDiadM3dDakotaMassFluxSerial',
+		428 : 'SquareSheetShelfDiadM3dDakotaMassFluxParallel',
+		429 : 'SquareSheetShelfCMDragSteaM3dSerial',
+		430 : 'SquareSheetShelfCMDragSteaM3dParallel',
+		431 : 'SquareSheetShelfCMDragSteaP3dSerial',
+		432 : 'SquareSheetShelfCMDragSteaP3dParallel',
+		434 : 'SquareSheetShelfDiadM3dDakotaSamp',
+		435 : 'SquareSheetShelfDiadM3dDakotaAreaAverage',
+		437 : 'SquareSheetShelfDiagMP3dTilingSerial',
+		438 : 'SquareSheetShelfDiagMP3dTilingParallel',
+		439 : 'SquareSheetShelfDakotaScaledResponse',
+		440 : 'SquareSheetShelfDakotaScaledResponse',
+		441 : 'SquareSheetShelfDiagPS3dTilingSerial',
+		442 : 'SquareSheetShelfDiagPS3dTilingParallel',
+		443 : 'SquareSheetShelfDiagMS3dTilingSerial',
+		444 : 'SquareSheetShelfDiagMS3dTilingParallel',
+		445 : 'RoundSheetShelfGLMigrationM2dSerial',
+		446 : 'RoundSheetShelfGLMigrationM2dParallel',
+		447 : 'SquareSheetShelfGroundingLine2dAgressiceSerial',
+		448 : 'SquareSheetShelfGroundingLine2dAgressiceParallel',
+		449 : 'SquareSheetShelfGroundingLine2dSoftSerial',
+		450 : 'SquareSheetShelfGroundingLine2dSoftParallel',
+		451 : 'SquareSheetShelfGroundingLine3dAgressiceSerial',
+		452 : 'SquareSheetShelfGroundingLine3dAgressiceParallel',
+		453 : 'SquareSheetShelfGroundingLine3dSoftSerial',
+		454 : 'SquareSheetShelfGroundingLine3dSoftParallel',
+		455 : 'SquareSheetShelfDiagM2dNewtonSerial',
+		456 : 'SquareSheetShelfDiagM2dNewtonParallel',
+		457 : 'SquareSheetShelfDiagP3dNewtonSerial',
+		458 : 'SquareSheetShelfDiagP3dNewtonParallel',
+		459 : 'SquareSheetShelfDiagS3dNewtonSerial',
+		460 : 'SquareSheetShelfDiagS3dNewtonParallel',
+		461 : 'SquareSheetShelfSteaEnthalpyM3dSerial',
+		462 : 'SquareSheetShelfSteaEnthalpyM3dParallel',
+		463 : 'SquareSheetShelfSteaEnthalpyP3dSerial',
+		464 : 'SquareSheetShelfSteaEnthalpyP3dParallel',
+		501 : 'PigDiagM2dSerial',
+		502 : 'PigDiagM2dParallel',
+		503 : 'PigDiagP3dSerial',
+		504 : 'PigDiagP3dParallel',
+		505 : 'PigDiagS3dSerial',
+		506 : 'PigDiagS3dParallel',
+		507 : 'PigTranM2dSerial',
+		508 : 'PigTranM2dParallel',
+		509 : 'PigTranM3dSerial',
+		510 : 'PigTranM3dParallel',
+		511 : 'PigTranP3dSerial',
+		512 : 'PigTranP3dParallel',
+		513 : 'PigTranS3dSerial',
+		514 : 'PigTranS3dParallel',
+		515 : 'PigSteaM3dSerial',
+		516 : 'PigSteaM3dParallel',
+		517 : 'PigSteaP3dSerial',
+		518 : 'PigSteaP3dParallel',
+		519 : 'PigSteaS3dSerial',
+		520 : 'PigSteaS3dParallel',
+		521 : 'PigCMBS3dSerial',
+		522 : 'PigCMBS3dparallel',
+		523 : 'PigCMDragP3dSerial',
+		524 : 'PigCMDragP3dparallel',
+		525 : 'PigCMDragSteaM3dSerial',
+		526 : 'PigCMDragSteaM3dparallel',
+		527 : 'PigBamgMesh',
+		529 : 'PigTherTranSUPGSerial',
+		530 : 'PigTherTranSUPGParallel',
+		531 : 'PigTherSteaSUPGSerial',
+		532 : 'PigTherSteaSUPGParallel',
+		601 : '79NorthProg2dSerial',
+		602 : '79NorthProg2dParallel',
+		603 : '79NorthProg2dDGSerial',
+		604 : '79NorthProg2dDGParallel',
+		605 : '79NorthProg3dSerial',
+		606 : '79NorthProg3dParallel',
+		607 : '79NorthSurfSlop2dSerial',
+		608 : '79NorthSurfSlop2dParallel',
+		609 : '79NorthSurfSlop3dSerial',
+		610 : '79NorthSurfSlop3dParallel',
+		611 : '79NorthBedSlop2dSerial',
+		612 : '79NorthBedSlop2dParallel',
+		613 : '79NorthBedSlop3dSerial',
+		614 : '79NorthBedSlop3dParallel',
+		615 : '79NorthBalThic2dSerial',
+		616 : '79NorthBalThic2dParallel',
+		617 : '79NorthBalThic2dDGSerial',
+		618 : '79NorthBalThic2dDGParallel',
+		619 : '79NorthBalThic3dSerial',
+		620 : '79NorthBalThic3dParallel',
+		621 : '79NorthCMBalThic2dCGSerial',
+		622 : '79NorthCMBalThic2dCGParallel',
+		623 : '79NorthCMBalThic2dDGSerial',
+		624 : '79NorthCMBalThic2dDGParallel',
+		625 : '79NorthCMBalThicVxVyParallel',
+		626 : '79NorthCMBalThicVxVySerial',
+		1101 : 'ISMIPAPattyn',
+		1102 : 'ISMIPAStokes',
+		1103 : 'ISMIPBPattyn',
+		1104 : 'ISMIPBStokes',
+		1105 : 'ISMIPCPattyn',
+		1106 : 'ISMIPCStokes',
+		1107 : 'ISMIPDPattyn',
+		1108 : 'ISMIPDStokes',
+		1109 : 'ISMIPE',
+		1110 : 'ISMIPF',
+		1201 : 'EISMINTMassConservation',
+		1202 : 'EISMINTDiag1',
+		1203 : 'EISMINTDiag2',
+		1204 : 'EISMINTTran2',
+		1205 : 'EISMINTRoundIceSheetStaticHutter',
+		1206 : 'EISMINTRoundIceSheetStaticPattyn',
+		1207 : 'EISMINTRoundIceSheetStaticStokes',
+		1208 : 'EISMINTA',
+		1301 : 'ThermalMelting',
+		1302 : 'ThermalAdvection',
+		1303 : 'ThermalConduction',
+		1304 : 'ThermalGeothermalFlux',
+		1401 : 'AdaptiveMeshRefinement1',
+		1402 : 'AdaptiveMeshRefinement2',
+		1501 : 'SquareShelfTranSawTooth2d',
+		1502 : 'SquareShelfTranSawTooth3d',
+		1601 : 'SquareShelfM2dRotation',
+		1602 : 'SquareSheetShelfP3dRotation',
+	}
+
+	if not id == 0:
+		return idname.get(id,'N/A')
+	else:
+		return idname
+
Index: sm/trunk/test/NightlyRun/dak.m
===================================================================
--- /issm/trunk/test/NightlyRun/dak.m	(revision 12706)
+++ 	(revision )
@@ -1,52 +1,0 @@
-md=triangle(model,'../Exp/Square.exp',150000);
-md=setmask(md,'all','');
-md=parameterize(md,'../Par/SquareShelf.par');
-md=setflowequation(md,'macayeal','all');
-md.cluster=generic('name',oshostname(),'np',1);
-
-md.timestepping.time_step=1;
-md.settings.output_frequency=1;
-md.timestepping.final_time=4;
-
-%Set up transient
-smb = ones(md.mesh.numberofvertices,1)*3.6;
-smb=[ smb smb*-1 ];
-
-md.surfaceforcings.mass_balance=smb;
-md.surfaceforcings.mass_balance(end+1,:)=[1.5 3];
-md.transient.isthermal=0;
-
-%sigma_on_partition=AreaAverageOntoPartition(md,sigma);
-%sigma_on_grids=sigma_on_partition(md.part+1); %just to check in case
-%md.variables.thickness=normal_uncertain('scaled_Thickness',1,1);
-%md.variables.thickness.stddev=sigma_on_partition;
-
-%Dakota inputs,outputs
-md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,0.1);
-md.qmu.responses.IceVolume=response_function('IceVolume',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
-
-%%  nond_sampling study
-md.qmu.method     =dakota_method('nond_samp');
-md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),...
-'seed',1234,...
-'samples',20,...
-'sample_type','lhs');
-
-%%  a variety of parameters
-md.qmu.params.evaluation_concurrency=1;
-md.qmu.params.analysis_driver='';
-md.qmu.params.analysis_components='';
-
-%partitioning
-md.qmu.numberofpartitions=20;
-md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
-md.qmu.partition=md.qmu.partition-1;
-md.qmu.isdakota=1;
-
-md.transient.requested_outputs=IceVolumeEnum();
-
-md.diagnostic.reltol=10^-5; %tighten for qmu analyses
-%md.debug.valgrind=1;
-%md.verbose.solution=true;
-md=solve(md,TransientSolutionEnum,'overwrite','y');
Index: /issm/trunk/test/NightlyRun/runme.m
===================================================================
--- /issm/trunk/test/NightlyRun/runme.m	(revision 12706)
+++ /issm/trunk/test/NightlyRun/runme.m	(revision 12707)
@@ -49,5 +49,5 @@
 if ~ismember(benchmark,{'all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing'})
 	disp('runme warning: benchmark not supported, defaulting to test ''nightly''')
-	benchmark='nighlty';
+	benchmark='nightly';
 end
 % }}}
@@ -87,5 +87,5 @@
 test_ids=intersect(test_ids,list_ids);
 % }}}
-%GET exculde {{{1
+%GET exclude {{{1
 exclude_ids=getfieldvalue(options,'exclude',[]);
 exclude_ids=[exclude_ids];
@@ -126,5 +126,5 @@
 
 			if ~strcmp(oshostname(),'larsen');
-				error(['Nighlty run archives must be saved on "larsen" (hostname is "' oshostname() '")']);
+				error(['Nightly run archives must be saved on "larsen" (hostname is "' oshostname() '")']);
 			end
 			for k=1:length(field_names),
@@ -135,5 +135,5 @@
 			disp(sprintf(['File ./../Archives/' archive_name ' saved\n']));
 
-			%ELSE: CHECK TEST
+		%ELSE: CHECK TEST
 		else,
 
Index: /issm/trunk/test/NightlyRun/runme.py
===================================================================
--- /issm/trunk/test/NightlyRun/runme.py	(revision 12707)
+++ /issm/trunk/test/NightlyRun/runme.py	(revision 12707)
@@ -0,0 +1,275 @@
+#! /usr/bin/env python
+"""
+RUNME - test deck for ISSM nightly runs
+ 
+    In a test deck directory (tests/Vertification/NightlyRun for example)
+    The following command will launch all the existing tests:
+    >>> runme()
+    To run the tests 101 and 102:
+    >>> runme(id=[101,102])
+    etc...
+ 
+    Available options:
+       'id'            followed by the list of ids requested
+       'exclude'       ids to be excluded from the test
+       'benchmark'     'nightly' (nightly run/ daily run)
+                       'ismip'  : validation of ismip-hom tests
+                       'eismint': validation of eismint tests
+                       'thermal': validation of thermal tests
+                       'mesh'   : validation of mesh tests
+                       ...
+       'procedure'     'check' : run the test (default)
+                       'update': update the archive
+ 
+    Usage:
+       md=runme(varargin);
+ 
+    Examples:
+       runme()
+       runme(exclude=101)
+       md=runme(id=102,procedure='update')
+"""
+
+import os
+import glob
+import socket
+import numpy
+#import h5py
+import netCDF4
+import sys
+
+def runme(id=None,exclude=None,benchmark='nightly',procedure='check',output='none',rank=1,numprocs=1):
+
+	from parallelrange import parallelrange
+	from IdToName import IdToName
+
+	#Get ISSM_DIR variable
+	ISSM_DIR=os.environ['ISSM_DIR']
+	print 'ISSM_DIR =',ISSM_DIR
+
+	#Process options
+	#GET benchmark {{{1
+	if not benchmark.lower() in ['all','nightly','ismip','eismint','thermal','mesh','validation','tranforcing']:
+		print "runme warning: benchmark '%s' not supported, defaulting to test 'nightly'." % benchmark
+		benchmark='nightly'
+	# }}}
+	#GET procedure {{{1
+	if not procedure.lower() in ['check','update']:
+		print "runme warning: procedure '%s' not supported, defaulting to test 'check'." % procedure
+		procedure='check'
+	# }}}
+	#GET output {{{1
+	if not output.lower() in ['nightly','daily','none']:
+		print "runme warning: output '%s' not supported, defaulting to test 'none'." % output
+		output='none'
+	# }}}
+	#GET RANK and NUMPROCS for multithreaded runs {{{1
+	if (numprocs<rank):
+		numprocs=1
+	# }}}
+
+	print 'id =',id
+	print 'exclude =',exclude
+	print 'benchmark =',benchmark
+	print 'procedure =',procedure
+	print 'output =',output
+	print 'rank =',rank
+	print 'numprocs =',numprocs
+
+	#GET ids  {{{1
+	flist=glob.glob('test*.py')    #File name must start with 'test' and must end by '.py' and must be different than 'test.py'
+	list_ids=[int(file[4:-3]) for file in flist if not file == 'test.py']    #Keep test id only (skip 'test' and '.py')
+	print 'list_ids =',list_ids
+
+	i1,i2=parallelrange(rank,numprocs,len(list_ids))    #Get tests for this cpu only
+	list_ids=list_ids[i1:i2+1]
+	print 'list_ids after parallelrange =',list_ids
+
+	if id:
+		if isinstance(id,list):
+			test_ids=id
+		else:
+			test_ids=[id]
+		test_ids=set(test_ids).intersection(set(list_ids))
+	else:
+		test_ids=set(list_ids)
+#	print 'test_ids after list =',test_ids
+	# }}}
+
+	#GET exclude {{{1
+	if exclude:
+		if isinstance(exclude,list):
+			exclude_ids=exclude
+		else:
+			exclude_ids=[exclude]
+		test_ids=test_ids.difference(set(exclude_ids))
+#	print 'test_ids after exclude =',test_ids
+	# }}}
+
+	#Process Ids according to benchmarks {{{1
+	if   benchmark.lower() == 'nightly':
+		test_ids=test_ids.intersection(set(range(1,1000)))
+	elif benchmark.lower() == 'ismip':
+		test_ids=test_ids.intersection(set(range(1101,1200)))
+	elif benchmark.lower() == 'eismint':
+		test_ids=test_ids.intersection(set(range(1201,1300)))
+	elif benchmark.lower() == 'thermal':
+		test_ids=test_ids.intersection(set(range(1301,1400)))
+	elif benchmark.lower() == 'mesh':
+		test_ids=test_ids.intersection(set(range(1401,1500)))
+	elif benchmark.lower() == 'validation':
+		test_ids=test_ids.intersection(set(range(1001,2000)))
+	elif benchmark.lower() == 'tranforcing':
+		test_ids=test_ids.intersection(set(range(1501,1503)))
+#	print 'test_ids after benchmark =',test_ids
+	test_ids=list(test_ids)
+	test_ids.sort()
+	print 'test_ids after sort =',test_ids
+	# }}}
+
+	#Loop over tests and launch sequence
+	root=os.getcwd()
+	for id in test_ids:
+		try:
+
+			#Execute test
+			os.chdir(root)
+			id_string=IdToName(id)
+			execfile('test'+str(id)+'.py',globals())
+
+			#UPDATE ARCHIVE?
+			archive_name='Archive'+str(id)
+			if procedure.lower() == 'update':
+
+				if not socket.gethostname().lower().split('.')[0] == 'larsen':
+#					raise RuntimeError("Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"').")
+					print "Nightly run archives must be saved on 'larsen' (hostname is '"+socket.gethostname()+"')."
+#				f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'w')
+				f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'w')
+				for k,fieldname in enumerate(field_names):
+					field=numpy.array(field_values[k],dtype=float)
+#					f.create_dataset(archive_name+'_field'+str(k),data=field)
+					f.createDimension(archive_name+'_field'+str(k)+'_0',numpy.size(field,0))
+					f.createDimension(archive_name+'_field'+str(k)+'_1',numpy.size(field,1))
+					v = f.createVariable(archive_name+'_field'+str(k),'f8',(archive_name+'_field'+str(k)+'_0',archive_name+'_field'+str(k)+'_1'))
+					v[:] = field
+				f.close()
+				print "File '%s' saved.\n" % os.path.join('..','Archives',archive_name+'.nc')
+
+			#ELSE: CHECK TEST
+			else:
+
+				#load archive
+				if os.path.exists(os.path.join('..','Archives',archive_name+'.nc')):
+#					f = h5py.File(os.path.join('..','Archives',archive_name+'.hdf5'),'r')
+					f = netCDF4.Dataset(os.path.join('..','Archives',archive_name+'.nc'),'r')
+				else:
+					raise IOError("Archive file '"+os.path.join('..','Archives',archive_name+'.nc')+"' does not exist.")
+
+				for k,fieldname in enumerate(field_names):
+
+					try:
+						#Get field and tolerance
+						field=numpy.array(field_values[k],dtype=float)
+#						print 'field =',field
+						tolerance=field_tolerances[k]
+#						print 'tolerance =',tolerance
+
+						#compare to archive
+#						if archive_name+'_field'+str(k) in f:
+#							archive=f[archive_name+'_field'+str(k)][...]
+						if archive_name+'_field'+str(k) in f.variables:
+							archive=f.variables[archive_name+'_field'+str(k)][:]
+						else:
+							raise NameError("Field name '"+archive_name+'_field'+str(k)+"' does not exist in archive file.")
+#						print 'archive =',archive
+						error_diff=numpy.amax(numpy.abs(archive-field),axis=1)/ \
+								   (numpy.amax(numpy.abs(archive),axis=1)+sys.float_info.epsilon)
+#						print 'error_diff =',error_diff
+
+						#disp test result
+						if (error_diff>tolerance):
+							print 'ERROR   difference: %-7.2g > %7.2g test id: %i test name: %s field: %s' % \
+								(error_diff,tolerance,id,id_string,fieldname)
+						else:
+							print 'SUCCESS difference: %-7.2g < %7.2g test id: %i test name: %s field: %s' % \
+								(error_diff,tolerance,id,id_string,fieldname)
+
+					except Exception as me2:
+
+						#something went wrong, print failure message:
+						directory=os.getcwd().split('/')    #  not used?
+						message=me2
+						if   output.lower() == 'nightly':
+							fid=open(os.path.join(ISSM_DIR,'nightlylog','matlaberror.log'), 'a')
+							fid.write('%s' % message)
+							fid.write('\n------------------------------------------------------------------\n')
+							fid.close()
+							print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
+						elif output.lower() == 'daily':
+							fid=open(os.path.join(ISSM_DIR,'dailylog','matlaberror.log'), 'a')
+							fid.write('%s' % message)
+							fid.write('\n------------------------------------------------------------------\n')
+							fid.close()
+							print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
+						else:
+							print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,fieldname)
+							raise RuntimeError(me2)
+
+				f.close()
+
+		except Exception as me:
+
+			#something went wrong, print failure message:
+			directory=os.getcwd().split('/')    #  not used?
+			message=me
+			if   output.lower() == 'nightly':
+				fid=open(os.path.join(ISSM_DIR+'nightlylog','matlaberror.log'), 'a')
+				fid.write('%s' % message)
+				fid.write('\n------------------------------------------------------------------\n')
+				fid.close()
+				print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
+			elif output.lower() == 'daily':
+				fid=open(os.path.join(ISSM_DIR+'dailylog','matlaberror.log'), 'a')
+				fid.write('%s' % message)
+				fid.write('\n------------------------------------------------------------------\n')
+				fid.close()
+				print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
+			else:
+				print 'FAILURE difference: N/A test id: %i test name: %s field: %s' % (id,id_string,'N/A')
+				raise RuntimeError(me)
+
+#	#output md if requested
+#	if nargout==1
+#		varargout{1}=md;
+#	end
+
+	return
+
+if __name__ == '__main__':
+	if 'PYTHONSTARTUP' in os.environ:
+		PYTHONSTARTUP=os.environ['PYTHONSTARTUP']
+		print 'PYTHONSTARTUP =',PYTHONSTARTUP
+		if os.path.exists(PYTHONSTARTUP):
+			try:
+				execfile(PYTHONSTARTUP)
+			except Exception as e:
+				print "PYTHONSTARTUP error: ",e
+		else:
+			print "PYTHONSTARTUP file '%s' does not exist." % PYTHONSTARTUP
+
+	import argparse
+	parser = argparse.ArgumentParser(description='RUNME - test deck for ISSM nightly runs')
+	parser.add_argument('-i','--id', nargs='*', type=int, help='followed by the list of ids requested', default=[])
+	parser.add_argument('-e','--exclude', nargs='*', type=int, help='ids to be excluded from the test', default=[])
+	parser.add_argument('-b','--benchmark', help='nightly/ismip/eismint/thermal/mesh/...', default='nightly')
+	parser.add_argument('-p','--procedure', help='check/update', default='check')
+	parser.add_argument('-o','--output', help='nightly/daily/none', default='none')
+	parser.add_argument('-r','--rank', type=int, help='rank', default=1)
+	parser.add_argument('-n','--numprocs', type=int, help='numprocs', default=1)
+	args = parser.parse_args()
+
+	md = runme(args.id, args.exclude, args.benchmark, args.procedure, args.output, args.rank, args.numprocs)
+
+	exit(md)
+
Index: /issm/trunk/test/NightlyRun/test102.py
===================================================================
--- /issm/trunk/test/NightlyRun/test102.py	(revision 12706)
+++ /issm/trunk/test/NightlyRun/test102.py	(revision 12707)
@@ -4,6 +4,21 @@
 from parameterize import *
 
-md=model();
-md=triangle(md,'../Exp/Square.exp',50000);
-md=setmask(md,'all','');
+md=model()
+md=triangle(md,'../Exp/Square.exp',50000)
+md=setmask(md,'all','')
 md=parameterize(md,'../Par/SquareShelfConstrained.py')
+
+#Fields and tolerances to track changes
+field_names     =['Vx','Vy','Vel','Pressure',\
+	'StressTensorxx','StressTensoryy','StressTensorxy']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13]
+field_values=[\
+	[md.results.DiagnosticSolution.Vx],\
+	[md.results.DiagnosticSolution.Vy],\
+	[md.results.DiagnosticSolution.Vel],\
+	[md.results.DiagnosticSolution.Pressure],\
+	[md.results.DiagnosticSolution.StressTensorxx],\
+	[md.results.DiagnosticSolution.StressTensoryy],\
+	[md.results.DiagnosticSolution.StressTensorxy],\
+	]
Index: /issm/trunk/test/NightlyRun/test268.m
===================================================================
--- /issm/trunk/test/NightlyRun/test268.m	(revision 12706)
+++ /issm/trunk/test/NightlyRun/test268.m	(revision 12707)
@@ -23,5 +23,5 @@
 
 %variables
-md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,100);
+md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,0.1);
 
 %responses
@@ -39,6 +39,7 @@
 md.qmu.mass_flux_profile_directory=pwd;
 
-%method
-md.qmu.method     =dakota_method('nond_l');
+%%  nond_sampling study
+md.qmu.method=dakota_method('nond_samp');
+md.qmu.method(end)=dmeth_params_set(md.qmu.method(end),'seed',1234,'samples',20,'sample_type','lhs');
 
 %parameters
@@ -48,5 +49,4 @@
 md.qmu.params.evaluation_concurrency=1;
 md.qmu.params.interval_type='forward';
-md.qmu.params.fd_gradient_step_size='0.1';
 md.qmu.isdakota=1;
 
Index: /issm/trunk/test/NightlyRun/test270.m
===================================================================
--- /issm/trunk/test/NightlyRun/test270.m	(revision 12707)
+++ /issm/trunk/test/NightlyRun/test270.m	(revision 12707)
@@ -0,0 +1,72 @@
+md=triangle(model,'../Exp/Square.exp',180000);
+md=setmask(md,'all','');
+md=parameterize(md,'../Par/SquareShelf.par');
+md=setflowequation(md,'macayeal','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+md.timestepping.time_step=1;
+md.settings.output_frequency=1;
+md.timestepping.final_time=4;
+
+smb = ones(md.mesh.numberofvertices,1)*3.6;
+smb=[ smb smb*-1 ];
+
+md.surfaceforcings.mass_balance= smb;
+md.surfaceforcings.mass_balance(end+1,:)=[1.5 3];
+md.transient.isthermal=0;
+%Dakota options
+
+%partitioning
+md.qmu.numberofpartitions=20;
+md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions,'weighting','on');
+md.qmu.partition=md.qmu.partition-1;
+
+%variables
+md.qmu.variables.surface_mass_balance=normal_uncertain('scaled_SurfaceforcingsMassBalance',1,100);
+
+%responses
+md.qmu.responses.MaxVel=response_function('MaxVel',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.IceVolume=response_function('IceVolume',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux1=response_function('indexed_MassFlux_1',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux2=response_function('indexed_MassFlux_2',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux3=response_function('indexed_MassFlux_3',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux4=response_function('indexed_MassFlux_4',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.MassFlux5=response_function('indexed_MassFlux_5',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+md.qmu.responses.massFlux6=response_function('indexed_MassFlux_6',[],[0.0001 0.001 0.01 0.25 0.5 0.75 0.99 0.999 0.9999]);
+
+%mass flux profiles
+md.qmu.mass_flux_profiles={'../Exp/MassFlux1.exp','../Exp/MassFlux2.exp','../Exp/MassFlux3.exp','../Exp/MassFlux4.exp','../Exp/MassFlux5.exp','../Exp/MassFlux6.exp'};
+md.qmu.mass_flux_profile_directory=pwd;
+
+%method
+md.qmu.method     =dakota_method('nond_l');
+
+%parameters
+md.qmu.params.direct=true;
+md.qmu.params.analysis_driver='';
+md.qmu.params.analysis_components='';
+md.qmu.params.evaluation_concurrency=1;
+md.qmu.params.interval_type='forward';
+md.qmu.params.fd_gradient_step_size='0.1';
+md.qmu.isdakota=1;
+
+md.diagnostic.reltol=10^-5; %tighten for qmu analyses
+md.transient.requested_outputs=IceVolumeEnum();
+
+%solve
+md=solve(md,TransientSolutionEnum,'overwrite','y');
+md=tres(md,'dakota');
+
+%Fields and tolerances to track changes
+md.results.dakota.importancefactors=[];
+for i=1:8,
+	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).mean];
+end
+for i=1:8,
+	md.results.dakota.importancefactors=[md.results.dakota.importancefactors md.results.dakota.dresp_out(i).stddev];
+end
+field_names     ={'importancefactors'};
+field_tolerances={1e-11};
+field_values={...
+         md.results.dakota.importancefactors,...
+	};
Index: /issm/trunk/test/NightlyRun/test356.m
===================================================================
--- /issm/trunk/test/NightlyRun/test356.m	(revision 12707)
+++ /issm/trunk/test/NightlyRun/test356.m	(revision 12707)
@@ -0,0 +1,41 @@
+md=triangle(model,'../Exp/Square.exp',150000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=setflowequation(md,'macayeal','all');
+md.surfaceforcings.issmbgradients=1;
+md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
+md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
+md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
+md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
+md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,TransientSolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vel1','Bed1','Surface1','Thickness1','SMB1','Vx2','Vy2','Vel2','Bed2','Surface2','Thickness2','SMB2','Vx3','Vy3','Vel3','Bed3','Surface3','Thickness3','SMB3'};
+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};
+field_values={...
+	(md.results.TransientSolution(1).Vx),...
+	(md.results.TransientSolution(1).Vy),...
+	(md.results.TransientSolution(1).Vel),...
+	(md.results.TransientSolution(1).Bed),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Bed),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Bed),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test358.m
===================================================================
--- /issm/trunk/test/NightlyRun/test358.m	(revision 12707)
+++ /issm/trunk/test/NightlyRun/test358.m	(revision 12707)
@@ -0,0 +1,51 @@
+md=triangle(model,'../Exp/Square.exp',150000);
+md=setmask(md,'','');
+md=parameterize(md,'../Par/SquareSheetConstrained.par');
+md=extrude(md,3,1);
+md=setflowequation(md,'pattyn','all');
+md.surfaceforcings.issmbgradients=1;
+md.surfaceforcings.smb_pos_max=5000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+md.surfaceforcings.smb_pos_min=1250. + 0.00005*md.mesh.x -0.0001*md.mesh.y;
+md.surfaceforcings.a_pos=15000. - 0.000051*md.mesh.x + 0.00011*md.mesh.y;
+md.surfaceforcings.b_pos=-100. + 0.00005*md.mesh.x - 0.0001*md.mesh.y;
+md.surfaceforcings.a_neg=-20000. - 0.00005*md.mesh.x + 0.0001*md.mesh.y;
+md.surfaceforcings.b_neg=250. + 0.000051*md.mesh.x - 0.00011*md.mesh.y;
+md.surfaceforcings.hc=(md.surfaceforcings.a_pos-md.surfaceforcings.a_neg)./(md.surfaceforcings.b_neg-md.surfaceforcings.b_pos);
+md.cluster=generic('name',oshostname(),'np',3);
+md=solve(md,TransientSolutionEnum);
+
+%Fields and tolerances to track changes
+field_names     ={'Vx1','Vy1','Vz1','Vel1','Bed1','Surface1','Thickness1','Temperature1','SMB1','Vx2','Vy2','Vz2','Vel2','Bed2','Surface2','Thickness2','Temperature2','SMB2','Vx3','Vy3','Vz3','Vel3','Bed3','Surface3','Thickness3','Temperature3','SMB3'};
+field_tolerances={1e-09,1e-09,1e-09,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-09,5e-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).Bed),...
+	(md.results.TransientSolution(1).Surface),...
+	(md.results.TransientSolution(1).Thickness),...
+	(md.results.TransientSolution(1).Temperature),...
+	(md.results.TransientSolution(1).SurfaceforcingsMassBalance),...
+	(md.results.TransientSolution(2).Vx),...
+	(md.results.TransientSolution(2).Vy),...
+	(md.results.TransientSolution(2).Vz),...
+	(md.results.TransientSolution(2).Vel),...
+	(md.results.TransientSolution(2).Bed),...
+	(md.results.TransientSolution(2).Surface),...
+	(md.results.TransientSolution(2).Thickness),...
+	(md.results.TransientSolution(2).Temperature),...
+	(md.results.TransientSolution(2).SurfaceforcingsMassBalance),...
+	(md.results.TransientSolution(3).Vx),...
+	(md.results.TransientSolution(3).Vy),...
+	(md.results.TransientSolution(3).Vz),...
+	(md.results.TransientSolution(3).Vel),...
+	(md.results.TransientSolution(3).Bed),...
+	(md.results.TransientSolution(3).Surface),...
+	(md.results.TransientSolution(3).Thickness),...
+	(md.results.TransientSolution(3).Temperature),...
+	(md.results.TransientSolution(3).SurfaceforcingsMassBalance),...
+	};
Index: /issm/trunk/test/NightlyRun/test436.m
===================================================================
--- /issm/trunk/test/NightlyRun/test436.m	(revision 12707)
+++ /issm/trunk/test/NightlyRun/test436.m	(revision 12707)
@@ -0,0 +1,21 @@
+%test partitioning, and partition averaging
+md=triangle(model,'../Exp/Square.exp',30000);
+md=setmask(md,'../Exp/SquareShelf.exp','');
+md=parameterize(md,'../Par/SquareSheetShelf.par');
+md=setflowequation(md,'macayeal','all');
+md.cluster=generic('name',oshostname(),'np',3);
+
+%partitioning
+md.qmu.numberofpartitions=100;
+md=partitioner(md,'package','chaco','npart',md.qmu.numberofpartitions);
+md.qmu.partition=md.qmu.partition-1;
+
+vector=(1:1:md.mesh.numberofvertices)';
+vector_on_partition=AreaAverageOntoPartition(md,vector);
+vector_on_nodes=vector_on_partition(md.qmu.partition+1);
+
+field_names     ={'vector_on_nodes'};
+field_tolerances={1e-11};
+field_values={...
+         vector_on_nodes,...
+	};
Index: /issm/trunk/test/NightlyRun/test999.py
===================================================================
--- /issm/trunk/test/NightlyRun/test999.py	(revision 12707)
+++ /issm/trunk/test/NightlyRun/test999.py	(revision 12707)
@@ -0,0 +1,27 @@
+#md=model()
+#md=triangle(md,'../Exp/Square.exp',50000)
+#md=setmask(md,'all','')
+#md=parameterize(md,'../Par/SquareShelfConstrained.py')
+
+md1=[11,12,13]
+md2=[21,22,23]
+md3=[34,32,33]
+md4=[41,44,43]
+md5=[51,52,53]
+md6=[61,62,63]
+md7=[71,72,73]
+
+#Fields and tolerances to track changes
+field_names     =['Vx','Vy','Vel','Pressure',\
+	'StressTensorxx','StressTensoryy','StressTensorxy']
+field_tolerances=[1e-13,1e-13,1e-13,1e-13,\
+	1e-13,1e-13,1e-13]
+field_values=[\
+	[md1],\
+	[md2],\
+	[md3],\
+	[md4],\
+	[md5],\
+	[md6],\
+	[md7],\
+	]
