Index: /issm/trunk/configure
===================================================================
--- /issm/trunk/configure	(revision 1438)
+++ /issm/trunk/configure	(revision 1439)
@@ -579,5 +579,156 @@
 PACKAGE_BUGREPORT='Eric Larour <eric.larour@jpl.nasa.gov>'
 
+<<<<<<< .mine
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+GRAPHICSLIB
+FORTRANLIB
+MATHLIB
+BLACSLIB
+BLACSINCL
+MUMPSLIB
+MUMPSINCL
+PLAPACKLIB
+PLAPACKINCL
+MKLINCL
+MKLLIB
+BLASLAPACKINCL
+BLASLAPACKLIB
+SCALAPACKLIB
+SLEPCLIB
+SLEPCINCL
+PETSCLIB
+PETSCINCL
+MPILIB
+MPIINCL
+METISLIB
+METISINCL
+DAKOTALIB
+DAKOTAINCL
+TRIANGLELIB
+TRIANGLEINCL
+LARGEARRAYS_FALSE
+LARGEARRAYS_TRUE
+MATLAB_MINOR
+MATLAB_MAJOR
+MATLAB_VERSION
+MATLAB
+MEXLINK
+MEXLIB
+MEXEXT
+MEX
+MATLABINCL
+NOPARALLEL_FALSE
+NOPARALLEL_TRUE
+NOSERIAL_FALSE
+NOSERIAL_TRUE
+X_EXTRA_LIBS
+X_LIBS
+X_PRE_LIBS
+X_CFLAGS
+XMKMF
+FLIBS
+ac_ct_F77
+FFLAGS
+F77
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+CPP
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+RANLIB
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+=======
 ac_subst_vars='SHELL
+>>>>>>> .r1435
 PATH_SEPARATOR
 PACKAGE_NAME
@@ -726,4 +877,34 @@
 LTLIBOBJS'
 ac_subst_files=''
+<<<<<<< .mine
+ac_user_opts='
+enable_option_checking
+enable_dependency_tracking
+with_x
+enable_debugging
+with_serial
+with_parallel
+with_matlab_dir
+with_triangle_dir
+with_dakota_dir
+with_metis_dir
+with_mpi_lib
+with_mpi_include
+with_petsc_dir
+with_petsc_arch
+with_slepc_dir
+with_scalapack_dir
+with_blas_lapack_dir
+with_mkl_dir
+with_plapack_dir
+with_mumps_dir
+with_blacs_dir
+with_math_lib
+with_fortran_lib
+with_graphics_lib
+with_vendor
+'
+=======
+>>>>>>> .r1435
       ac_precious_vars='build_alias
 host_alias
@@ -734,4 +915,5 @@
 LIBS
 CPPFLAGS
+CPP
 CXX
 CXXFLAGS
@@ -739,6 +921,5 @@
 F77
 FFLAGS
-XMKMF
-CPP'
+XMKMF'
 
 
@@ -1356,8 +1537,18 @@
   --with-mumps-dir = DIR  mumps root directory
   --with-blacs-dir = DIR  blacs root directory
+<<<<<<< .mine
   --with-math-lib = otions
                           math options, for ex: "/usr/lib/libm.a
   --with-fortran-lib = options
                           fortran options, for ex: "/usr/lib/gfortran.a
+  --with-graphics-lib = options
+                          graphics options, for ex: "/usr/X11/lib/libX11.a
+  --with-vendor = VENDOR  vendor name, ex: intel
+=======
+  --with-math-lib = otions
+                          math options, for ex: "/usr/lib/libm.a
+  --with-fortran-lib = options
+                          fortran options, for ex: "/usr/lib/gfortran.a
+>>>>>>> .r1435
 
 Some influential environment variables:
@@ -1369,4 +1560,5 @@
   CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
@@ -1374,5 +1566,4 @@
   FFLAGS      Fortran 77 compiler flags
   XMKMF       Path to xmkmf, Makefile generator for X Window System
-  CPP         C preprocessor
 
 Use these variables to override the choices made by `configure' or to help
@@ -1966,5 +2157,5 @@
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
-am__api_version='1.10'
+am__api_version='1.11'
 
 # Find a good install program.  We prefer a C program (faster),
@@ -2053,4 +2244,21 @@
 sleep 1
 echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe absolute working directory name" >&5
+$as_echo "$as_me: error: unsafe absolute working directory name" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    { { $as_echo "$as_me:$LINENO: error: unsafe srcdir value: \`$srcdir'" >&5
+$as_echo "$as_me: error: unsafe srcdir value: \`$srcdir'" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+
 # Do `set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
@@ -2059,8 +2267,8 @@
 # directory).
 if (
-   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
    if test "$*" = "X"; then
       # -L didn't work.
-      set X `ls -t $srcdir/configure conftest.file`
+      set X `ls -t "$srcdir/configure" conftest.file`
    fi
    rm -f conftest.file
@@ -2109,5 +2317,12 @@
 am_aux_dir=`cd $ac_aux_dir && pwd`
 
-test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
 # Use eval to expand $SHELL
 if eval "$MISSING --run true"; then
@@ -2119,6 +2334,120 @@
 fi
 
+<<<<<<< .mine
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+=======
 { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+>>>>>>> .r1435
 if test -z "$MKDIR_P"; then
   if test "${ac_cv_path_mkdir+set}" = set; then
@@ -2300,4 +2629,6 @@
 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
+<<<<<<< .mine
+=======
 install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
 
@@ -2406,4 +2737,5 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 
+>>>>>>> .r1435
 # We need awk for the "check" target.  The system "awk" is bad on
 # some platforms.
@@ -2520,4 +2852,7 @@
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
+<<<<<<< .mine
+  for ac_prog in gcc icl
+=======
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
@@ -2715,4 +3050,5 @@
   if test -n "$ac_tool_prefix"; then
   for ac_prog in cl.exe
+>>>>>>> .r1435
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
@@ -2758,5 +3094,5 @@
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl.exe
+  for ac_prog in gcc icl
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -2815,6 +3151,4 @@
     CC=$ac_ct_CC
   fi
-fi
-
 fi
 
@@ -3440,5 +3774,5 @@
 cat > confinc << 'END'
 am__doit:
-	@echo done
+	@echo this is the am__doit target
 .PHONY: am__doit
 END
@@ -3451,22 +3785,22 @@
 # First try GNU make style include.
 echo "include confinc" > confmf
-# We grep out `Entering directory' and `Leaving directory'
-# messages which can occur if `w' ends up in MAKEFLAGS.
-# In particular we don't look at `^make:' because GNU make might
-# be invoked under some other name (usually "gmake"), in which
-# case it prints its new name instead of `make'.
-if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
-   am__include=include
-   am__quote=
-   _am_result=GNU
-fi
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
 # Now try BSD make style include.
 if test "$am__include" = "#"; then
    echo '.include "confinc"' > confmf
-   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
-      am__include=.include
-      am__quote="\""
-      _am_result=BSD
-   fi
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
 fi
 
@@ -3525,4 +3859,9 @@
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
@@ -3542,5 +3881,15 @@
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
@@ -3552,17 +3901,21 @@
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
@@ -3603,4 +3956,240 @@
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -3613,5 +4202,5 @@
   else
     if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  for ac_prog in g++ icl
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
@@ -3657,5 +4246,5 @@
 if test -z "$CXX"; then
   ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  for ac_prog in g++ icl
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -3997,4 +4586,9 @@
      am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
   for depmode in $am_compiler_list; do
     # Setup a source with many dependencies, because some compilers
@@ -4014,5 +4608,15 @@
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
     case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
     nosideeffect)
       # after this tag, mechanisms are not by side-effect, so they'll
@@ -4024,17 +4628,21 @@
       fi
       ;;
+    msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
     none) break ;;
     esac
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.
     if depmode=$depmode \
-       source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+       source=sub/conftest.c object=$am__obj \
        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
          >/dev/null 2>conftest.err &&
        grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
       # icc doesn't choke on unknown options, it will just issue warnings
@@ -4080,5 +4688,5 @@
 ac_compiler_gnu=$ac_cv_f77_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in ifort g77
+  for ac_prog in ifort g77 gfortran
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
@@ -4124,5 +4732,5 @@
 if test -z "$F77"; then
   ac_ct_F77=$F77
-  for ac_prog in ifort g77
+  for ac_prog in ifort g77 gfortran
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -4787,4 +5395,6 @@
 
 
+<<<<<<< .mine
+=======
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -4847,5 +5457,8 @@
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
-
+>>>>>>> .r1435
+
+<<<<<<< .mine
+=======
   # Broken: fails on valid input.
 continue
@@ -5018,4 +5631,5 @@
 
 
+>>>>>>> .r1435
 { echo "$as_me:$LINENO: checking for X" >&5
 echo $ECHO_N "checking for X... $ECHO_C" >&6; }
@@ -6507,6 +7121,5 @@
 				HAVE_MATLAB=yes
 		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
-				MEXEXT=`$MATLAB_ROOT/bin/mexext`
-		MEXEXT=".$MEXEXT"
+
 		MEX=$MATLAB_ROOT/bin/mex
 
@@ -6521,5 +7134,23 @@
 				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
 			fi
+			MEXEXT=`$MATLAB_ROOT/bin/mexext`
+			MEXEXT=".$MEXEXT"
 			;;
+<<<<<<< .mine
+			*darwin9.6.0*)
+			MEXLIB=-L"$MATLAB_ROOT/bin/maci/ -lmex -lmx"
+			MEXLINK="-Wl,-twolevel_namespace -undefined error -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
+			MEXEXT=`$MATLAB_ROOT/bin/mexext`
+			MEXEXT=".$MEXEXT"
+			;;
+			*cygwin*)
+			MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO"
+
+
+			MEXEXT=`$MATLAB_ROOT/bin/mexext.bat`
+			MEXEXT=".$MEXEXT"
+			;;
+
+=======
 			*darwin9.6.0*)
 			MEXLIB=-L"$MATLAB_ROOT/bin/maci/ -lmex -lmx"
@@ -6527,4 +7158,5 @@
 			;;
 
+>>>>>>> .r1435
 		esac
 
@@ -6590,4 +7222,11 @@
 				break
 	    		fi
+
+				# For Matlab R2008 and more, the version number is stored in bin/util/mex/version.txt
+	    		ax_cv_matlab_version=`cat $MATLAB/bin/util/mex/version.txt`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+
 		fi
     	done
@@ -6609,4 +7248,9 @@
     MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^[0-9]*\.\([0-9]*\).*/\1/'`
     ;;
+  R2009a)
+	MATLAB_VERSION=R2009a
+    MATLAB_MAJOR=R2009
+    MATLAB_MINOR=a
+	;;
   *)
     if test x$ax_enable_matlab = xyes ; then
@@ -6745,6 +7389,18 @@
 
 				HAVE_METIS=yes
+
+		case "${host_os}" in
+			*cygwin*)
+			METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib"
+			;;
+			*linux*)
+			METISLIB=-L"$METIS_ROOT/ -lmetis"
+			;;
+			*darwin9.6.0*)
+			METISLIB=-L"$METIS_ROOT/ -lmetis"
+			;;
+		esac
+
 		METISINCL=-I"$METIS_ROOT/Lib"
-		METISLIB=-L"$METIS_ROOT/ -lmetis"
 
 
@@ -6790,6 +7446,11 @@
 		if test -z "$MPILIB" ; then
 		if test "$PARALLEL_VALUE" = "yes" ; then
+<<<<<<< .mine
+			{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&2;}
+=======
 			{ { echo "$as_me:$LINENO: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&5
 echo "$as_me: error: empty --with-mpi-lib options! MPI is needed to run ISSM in paralle!" >&2;}
+>>>>>>> .r1435
    { (exit 1); exit 1; }; }
 		fi
@@ -6797,6 +7458,11 @@
 		if test -z "$MPI_INCLUDE" ; then
 			if test "$PARALLEL_VALUE" = "yes" ; then
+<<<<<<< .mine
+				{ { $as_echo "$as_me:$LINENO: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&5
+$as_echo "$as_me: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&2;}
+=======
 				{ { echo "$as_me:$LINENO: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&5
 echo "$as_me: error: empty --with-mpi-include directory! MPI is needed to run ISSM in paralle!" >&2;}
+>>>>>>> .r1435
    { (exit 1); exit 1; }; }
 			fi
@@ -6864,5 +7530,16 @@
 
 			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
-			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+
+			case "${host_os}" in
+				*cygwin*)
+				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib  libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetsc.lib  libpetscsnes.lib libpetscts.lib libmpiuni.lib"
+				;;
+				*linux*)
+				PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+				;;
+				*darwin9.6.0*)
+				PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+				;;
+			esac
 
 
@@ -6885,12 +7562,49 @@
 
 	if test $HAVE_PETSC = no; then
+<<<<<<< .mine
+		{ { $as_echo "$as_me:$LINENO: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM!" >&5
+$as_echo "$as_me: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM!" >&2;}
+=======
 		if test "$PARALLEL_VALUE" = "yes" ; then
 			{ { echo "$as_me:$LINENO: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&5
 echo "$as_me: error: could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!" >&2;}
+>>>>>>> .r1435
    { (exit 1); exit 1; }; }
-		fi
 	else
 		{ echo "$as_me:$LINENO: result: $HAVE_PETSC" >&5
 echo "${ECHO_T}$HAVE_PETSC" >&6; }
+	fi
+
+		if test "$PARALLEL_VALUE" = "no" ; then
+		HAVE_MPI=yes
+		MPIINCL=-I"$PETSC_ROOT/include/mpiuni"
+
+		case "${host_os}" in
+			*cygwin*)
+			MPILIB="-link -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libmpiuni.lib"
+			;;
+			*linux*)
+			MPILIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
+			;;
+			*darwin9.6.0*)
+			MPILIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
+			;;
+		esac
+
+
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_MPI_ 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MPI 1
+_ACEOF
+
+
+
 	fi
 
@@ -6972,5 +7686,18 @@
 				HAVE_BLASLAPACK=yes
 		BLASLAPACKINCL=""
-				BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack"
+
+				case "${host_os}" in
+			*cygwin*)
+			BLASLAPACKLIB="-link -LIBPATH:\"$BLASLAPACK_ROOT\" libf2cblas.lib  libf2clapack.lib"
+			;;
+			*linux*)
+			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack"
+			;;
+			*darwin9.6.0*)
+			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack"
+			;;
+		esac
+
+
 
 
@@ -7108,6 +7835,11 @@
 echo "${ECHO_T}$HAVE_BLACS" >&6; }
 
+<<<<<<< .mine
+		{ $as_echo "$as_me:$LINENO: checking for math library..." >&5
+$as_echo_n "checking for math library...... " >&6; }
+=======
 		{ echo "$as_me:$LINENO: checking for math library..." >&5
 echo $ECHO_N "checking for math library...... $ECHO_C" >&6; }
+>>>>>>> .r1435
 
 # Check whether --with-math-lib was given.
@@ -7123,4 +7855,90 @@
 		MATHLIB="$MATH_LIB"
 
+<<<<<<< .mine
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_MATH_ 1
+_ACEOF
+
+
+	fi
+	{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
+
+		{ $as_echo "$as_me:$LINENO: checking for fortran library..." >&5
+$as_echo_n "checking for fortran library...... " >&6; }
+
+# Check whether --with-fortran-lib was given.
+if test "${with_fortran_lib+set}" = set; then
+  withval=$with_fortran_lib; FORTRAN_LIB=$withval
+else
+  FORTRAN_LIB=""
+fi
+
+
+		if test -n "$FORTRAN_LIB" ; then
+		HAVE_FORTRAN=yes
+		FORTRANLIB="$FORTRAN_LIB"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_FORTRAN_ 1
+_ACEOF
+
+
+	fi
+	{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
+
+		{ $as_echo "$as_me:$LINENO: checking for graphics library..." >&5
+$as_echo_n "checking for graphics library...... " >&6; }
+
+# Check whether --with-graphics-lib was given.
+if test "${with_graphics_lib+set}" = set; then
+  withval=$with_graphics_lib; GRAPHICS_LIB=$withval
+else
+  GRAPHICS_LIB=""
+fi
+
+
+		if test -n "$GRAPHICS_LIB" ; then
+		HAVE_GRAPHICS=yes
+		GRAPHICSLIB="$GRAPHICS_LIB"
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _HAVE_GRAPHICS_ 1
+_ACEOF
+
+
+	fi
+	{ $as_echo "$as_me:$LINENO: result: done" >&5
+$as_echo "done" >&6; }
+
+
+# Check whether --with-vendor was given.
+if test "${with_vendor+set}" = set; then
+  withval=$with_vendor; VENDOR=$withval
+else
+  VENDOR=""
+fi
+
+	{ $as_echo "$as_me:$LINENO: checking for vendor compilers " >&5
+$as_echo_n "checking for vendor compilers ... " >&6; }
+	if test -n "$VENDOR"; then
+
+		if  test $VENDOR = intel; then
+			export CC=icl
+			export CXX=icl
+			export CXXFLAGS="-DWIN32 -D_INTEL_"
+		else
+		{ { $as_echo "$as_me:$LINENO: error: unknow compiler vendor!" >&5
+$as_echo "$as_me: error: unknow compiler vendor!" >&2;}
+   { (exit 1); exit 1; }; }
+		fi
+	fi
+
+
+=======
 
 cat >>confdefs.h <<\_ACEOF
@@ -7159,4 +7977,5 @@
 
 
+>>>>>>> .r1435
 ac_config_files="$ac_config_files Makefile src/Makefile src/c/Makefile src/mex/Makefile bin/Makefile"
 
@@ -7256,4 +8075,12 @@
 LTLIBOBJS=$ac_ltlibobjs
 
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
 
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
@@ -8466,4 +9293,28 @@
 
   case $ac_file$ac_mode in
+<<<<<<< .mine
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+=======
     "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
   # Strip MF so we end up with the name of the file.
@@ -8478,4 +9329,5 @@
   if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
     dirpart=`$as_dirname -- "$mf" ||
+>>>>>>> .r1435
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$mf" : 'X\(//\)[^/]' \| \
@@ -8500,26 +9352,26 @@
 	  }
 	  s/.*/./; q'`
-  else
-    continue
-  fi
-  # Extract the definition of DEPDIR, am__include, and am__quote
-  # from the Makefile without running `make'.
-  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-  test -z "$DEPDIR" && continue
-  am__include=`sed -n 's/^am__include = //p' < "$mf"`
-  test -z "am__include" && continue
-  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-  # When using ansi2knr, U may be empty or an underscore; expand it
-  U=`sed -n 's/^U = //p' < "$mf"`
-  # Find all dependency output files, they are included files with
-  # $(DEPDIR) in their names.  We invoke sed twice because it is the
-  # simplest approach to changing $(DEPDIR) to its actual value in the
-  # expansion.
-  for file in `sed -n "
-    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-    # Make sure the directory exists.
-    test -f "$dirpart/$file" && continue
-    fdir=`$as_dirname -- "$file" ||
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
 	 X"$file" : 'X\(//\)[^/]' \| \
@@ -8544,5 +9396,5 @@
 	  }
 	  s/.*/./; q'`
-    { as_dir=$dirpart/$fdir
+      { as_dir=$dirpart/$fdir
   case $as_dir in #(
   -*) as_dir=./$as_dir;;
@@ -8585,8 +9437,9 @@
 echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-    # echo "creating $dirpart/$file"
-    echo '# dummy' > "$dirpart/$file"
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
   done
-done
+}
  ;;
 
Index: /issm/trunk/configure.ac
===================================================================
--- /issm/trunk/configure.ac	(revision 1438)
+++ /issm/trunk/configure.ac	(revision 1439)
@@ -4,7 +4,8 @@
 AM_INIT_AUTOMAKE
 AC_PROG_RANLIB
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_F77([ifort g77])
+AC_PROG_CC([gcc icl])
+AC_PROG_CPP
+AC_PROG_CXX([g++ icl])
+AC_PROG_F77([ifort g77 gfortran])
 AC_F77_LIBRARY_LDFLAGS
 AM_PROG_CC_C_O
Index: /issm/trunk/etc/environment.csh
===================================================================
--- /issm/trunk/etc/environment.csh	(revision 1438)
+++ /issm/trunk/etc/environment.csh	(revision 1439)
@@ -86,2 +86,7 @@
 setenv AUTOMAKE_DIR
 setenv PATH {$PATH}:{$AUTOMAKE_DIR}/bin
+
+#BORLAND
+setenv BORLAND_DIR
+setenv PATH {$PATH}:{$BORLAND_DIR}/Bin
+
Index: /issm/trunk/etc/environment.sh
===================================================================
--- /issm/trunk/etc/environment.sh	(revision 1438)
+++ /issm/trunk/etc/environment.sh	(revision 1439)
@@ -89,3 +89,13 @@
 PATH="$PATH:$AUTOMAKE_DIR/bin"
 
+#BORLAND
+export BORLAND_DIR
+PATH="$PATH:$BORLAND_DIR/Bin"
 
+#INTEL
+export INTEL_DIR
+PATH="$PATH:$INTEL_DIR"
+
+#SDK
+export SDK_DIR
+PATH="$PATH:$SDK_DIR"
Index: /issm/trunk/etc/environment_variables.csh
===================================================================
--- /issm/trunk/etc/environment_variables.csh	(revision 1438)
+++ /issm/trunk/etc/environment_variables.csh	(revision 1439)
@@ -63,2 +63,5 @@
 #autoconf
 set AUTOCONF_DIR={$ISSM_DIR}/devpackages/autoconf/install
+
+#borland
+set BORLAND_DIR=/cygdrive/c/Borland
Index: /issm/trunk/etc/environment_variables.sh
===================================================================
--- /issm/trunk/etc/environment_variables.sh	(revision 1438)
+++ /issm/trunk/etc/environment_variables.sh	(revision 1439)
@@ -7,5 +7,5 @@
 
 #MATLAB
-MATLAB_DIR=/usr/local/pkgs/matlab-7.6/
+MATLAB_DIR=C:/MATLAB/R2009a/
 
 #MPI
@@ -71,2 +71,12 @@
 #autoconf
 AUTOCONF_DIR="$ISSM_DIR/devpackages/autoconf/install"
+
+#borland
+#BORLAND_DIR="/cygdrive/c/Borland/"
+
+#intel
+INTEL_DIR="C:/IntelInstall/Compiler/11.1/038/bin/ia32/"
+
+#sdk
+SDK_DIR="C:/MicrosoftVisualStudio 9.0/Microsoft Visual C++ 2008 Express Edition with SP1 - ENU"
+
Index: /issm/trunk/m4/issm_options.m4
===================================================================
--- /issm/trunk/m4/issm_options.m4	(revision 1438)
+++ /issm/trunk/m4/issm_options.m4	(revision 1439)
@@ -51,6 +51,5 @@
 		MATLABINCL=-I"$MATLAB_ROOT/extern/include";
 		dnl  use matlab provided mexext routine to test for extension
-		MEXEXT=`$MATLAB_ROOT/bin/mexext`
-		MEXEXT=".$MEXEXT"
+				
 		MEX=$MATLAB_ROOT/bin/mex
 
@@ -66,8 +65,19 @@
 				MEXLINK="-pthread -shared -W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
 			fi
+			MEXEXT=`$MATLAB_ROOT/bin/mexext`
+			MEXEXT=".$MEXEXT"
 			;;
 			*darwin9.6.0*)
 			MEXLIB=-L"$MATLAB_ROOT/bin/maci/ -lmex -lmx"
 			MEXLINK="-Wl,-twolevel_namespace -undefined error -arch i386 -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -bundle -Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
+			MEXEXT=`$MATLAB_ROOT/bin/mexext`
+			MEXEXT=".$MEXEXT"
+			;;
+			*cygwin*)
+			MEXLIB="-dll -export:mexFunction -LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  -NOLOGO -INCREMENTAL:NO"
+
+
+			MEXEXT=`$MATLAB_ROOT/bin/mexext.bat`
+			MEXEXT=".$MEXEXT"
 			;;
 
@@ -176,6 +186,18 @@
 		dnl defaults
 		HAVE_METIS=yes
+		
+		case "${host_os}" in
+			*cygwin*)
+			METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib"
+			;;
+			*linux*)
+			METISLIB=-L"$METIS_ROOT/ -lmetis"
+			;;
+			*darwin9.6.0*)
+			METISLIB=-L"$METIS_ROOT/ -lmetis"
+			;;
+		esac
+			                          
 		METISINCL=-I"$METIS_ROOT/Lib"
-		METISLIB=-L"$METIS_ROOT/ -lmetis"
 
 		AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src])
@@ -256,5 +278,16 @@
 		
 			PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/ -I$PETSC_ROOT/bmake/$PETSC_ARCH -I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
-			PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+		
+			case "${host_os}" in
+				*cygwin*)
+				PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib  libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetsc.lib  libpetscsnes.lib libpetscts.lib libmpiuni.lib"
+				;;
+				*linux*)
+				PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+				;;
+				*darwin9.6.0*)
+				PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lpetscksp -lpetscdm -lpetscmat -lpetscvec -lpetsc  -lpetscsnes -lpetscts"
+				;;
+			esac
 			                          
 
@@ -273,11 +306,35 @@
 
 	if test $HAVE_PETSC = no; then
-		if test "$PARALLEL_VALUE" = "yes" ; then
-			AC_MSG_ERROR([could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM in paralle!])
-		fi
+		AC_MSG_ERROR([could not find petsc. user should specify --with-petsc-dir and --with-petsc-arch options. Petsc is needed to run ISSM!])
 	else
 		AC_MSG_RESULT($HAVE_PETSC)
 	fi
 
+	dnl: when running in serial mode, MPI must be ignored, and set to internal petsc mpiuni: 
+	if test "$PARALLEL_VALUE" = "no" ; then
+		HAVE_MPI=yes
+		MPIINCL=-I"$PETSC_ROOT/include/mpiuni"
+
+		case "${host_os}" in
+			*cygwin*)
+			MPILIB="-link -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libmpiuni.lib"
+			;;
+			*linux*)
+			MPILIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
+			;;
+			*darwin9.6.0*)
+			MPILIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
+			;;
+		esac
+								  
+
+
+			
+		AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
+		AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
+		AC_SUBST([MPIINCL])
+		AC_SUBST([MPILIB])
+	fi
+	
 
 	dnl Slepc directory
@@ -338,6 +395,19 @@
 		HAVE_BLASLAPACK=yes
 		BLASLAPACKINCL=""
-		dnl BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lmkl_lapack -lmkl -lguide"
-		BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack"
+		
+		dnl: branch on whether we are running on windows or linux.
+		case "${host_os}" in
+			*cygwin*)
+			BLASLAPACKLIB="-link -LIBPATH:\"$BLASLAPACK_ROOT\" libf2cblas.lib  libf2clapack.lib"
+			;;
+			*linux*)
+			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack" 
+			;;
+			*darwin9.6.0*)
+			BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack" 
+			;;
+		esac
+								  
+
 
 		AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with blas lapack in ISSM src])
@@ -489,3 +559,19 @@
 	AC_MSG_RESULT(done)
 
+	dnl vendor?
+	AC_ARG_WITH([vendor],
+			  AS_HELP_STRING([--with-vendor = VENDOR], [vendor name, ex: intel]),
+			 [VENDOR=$withval],[VENDOR=""]) 
+	AC_MSG_CHECKING(for vendor compilers )
+	if test -n "$VENDOR"; then
+
+		if  test $VENDOR = intel; then
+			export CC=icl
+			export CXX=icl
+			export CXXFLAGS="-DWIN32 -D_INTEL_"
+		else
+		AC_MSG_ERROR([unknow compiler vendor!])
+		fi
+	fi
+
 ])
Index: /issm/trunk/m4/matlab.m4
===================================================================
--- /issm/trunk/m4/matlab.m4	(revision 1438)
+++ /issm/trunk/m4/matlab.m4	(revision 1439)
@@ -289,4 +289,11 @@
 				break
 	    		fi
+				
+				# For Matlab R2008 and more, the version number is stored in bin/util/mex/version.txt 
+	    		ax_cv_matlab_version=`cat $MATLAB/bin/util/mex/version.txt`
+	    		if test -n "$ax_cv_matlab_version" ; then
+				break
+	    		fi
+
 		fi
     	done
@@ -305,4 +312,9 @@
     MATLAB_MINOR=`echo $MATLAB_VERSION | sed -e 's/^@<:@0-9@:>@*\.\(@<:@0-9@:>@*\).*/\1/'`
     ;;
+  R2009a)
+	MATLAB_VERSION=R2009a
+    MATLAB_MAJOR=R2009
+    MATLAB_MINOR=a
+	;;
   *)
     if test x$ax_enable_matlab = xyes ; then
Index: /issm/trunk/src/c/HoleFillerx/HoleFillerCrippen.c
===================================================================
--- /issm/trunk/src/c/HoleFillerx/HoleFillerCrippen.c	(revision 1438)
+++ /issm/trunk/src/c/HoleFillerx/HoleFillerCrippen.c	(revision 1439)
@@ -21,4 +21,6 @@
 #include <stdlib.h>
 #include <math.h>
+
+
 #include <time.h>
 #include <string.h>
Index: /issm/trunk/src/c/InterpFromGridx/InterpFromGridx.cpp
===================================================================
--- /issm/trunk/src/c/InterpFromGridx/InterpFromGridx.cpp	(revision 1438)
+++ /issm/trunk/src/c/InterpFromGridx/InterpFromGridx.cpp	(revision 1439)
@@ -115,5 +115,5 @@
 
 			/*Treat NANs*/
-			if isnan(data_value){
+			if (isnan(data_value)){
 				data_value=default_value;
 			}
Index: /issm/trunk/src/c/InterpFromMesh2dx/InterpFromMesh2dx.cpp
===================================================================
--- /issm/trunk/src/c/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 1438)
+++ /issm/trunk/src/c/InterpFromMesh2dx/InterpFromMesh2dx.cpp	(revision 1439)
@@ -30,5 +30,5 @@
 
 	/*Set debug to 1 if there are lots of elements*/
-	debug=(bool)((double)nels_data*(double)nods_prime >= pow(10,9));
+	debug=(bool)((double)nels_data*(double)nods_prime >= pow((double)10,(double)9));
 
 	/*figure out what kind of interpolation is needed*/
@@ -61,5 +61,5 @@
 
 		/*display current iteration*/
-		if (debug && fmod(i,100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
+		if (debug && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
 
 		/*if there is no point inside the domain, go to next iteration*/
@@ -99,5 +99,5 @@
 					data_value=data[i];
 				}
-				if isnan(data_value) data_value=default_value;
+				if (isnan(data_value)) data_value=default_value;
 
 				/*insert value and go to the next point*/
Index: /issm/trunk/src/c/InterpFromMesh3dx/InterpFromMesh3dx.cpp
===================================================================
--- /issm/trunk/src/c/InterpFromMesh3dx/InterpFromMesh3dx.cpp	(revision 1438)
+++ /issm/trunk/src/c/InterpFromMesh3dx/InterpFromMesh3dx.cpp	(revision 1439)
@@ -31,5 +31,5 @@
 
 	/*Set debug to 1 if there are lots of elements*/
-	debug=(bool)((double)nels_data*(double)nods_prime >= pow(10,9));
+	debug=(bool)((double)nels_data*(double)nods_prime >= pow((double)10,(double)9));
 
 	/*figure out what kind of interpolation is needed*/
@@ -62,5 +62,5 @@
 
 		/*display current iteration*/
-		if (debug && fmod(i,100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
+		if (debug && fmod((double)i,(double)100)==0) printf("\b\b\b\b\b\b\b%5.2lf %%",(double)i/nels_data*100);
 
 		/*if there is no point inside the domain, go to next iteration*/
@@ -108,5 +108,5 @@
 						data_value=data[i];
 					}
-					if isnan(data_value) data_value=default_value;
+					if (isnan(data_value)) data_value=default_value;
 
 					/*insert value and go to the next point*/
Index: /issm/trunk/src/c/Makefile.am
===================================================================
--- /issm/trunk/src/c/Makefile.am	(revision 1438)
+++ /issm/trunk/src/c/Makefile.am	(revision 1439)
@@ -85,4 +85,6 @@
 					./shared/Dofs/DistributeNumDofs.cpp\
 					./shared/Numerics/numerics.h\
+					./shared/Numerics/isnan.h\
+					./shared/Numerics/isnan.cpp\
 					./shared/Numerics/GaussPoints.h\
 					./shared/Numerics/cross.cpp\
@@ -290,5 +292,5 @@
 
 
-libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_ -m32
+libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE -fno-omit-frame-pointer -pthread -D_CPP_ 
 if LARGEARRAYS
 libISSM_a_CXXFLAGS += -D__GCC4BUILD__  
@@ -594,10 +596,5 @@
 endif
 
-
-#this compilation order works for linux
-#LDADD = ./libpISSM.a $(METISLIB) $(PETSCLIB) $(DAKOTALIB) $(SLEPCLIB) $(MUMPSLIB) $(PLAPACKLIB)  $(MPILIB) $(X_LIBS) $(BLASLAPACKLIB) $(MKLLIB) $(SCALAPACKLIB) $(BLACSLIB) $(FLIBS) $(GRAPHICSLIB)
-
-#this compilation order works  for mac
-LDADD = $(TRIANGLELIB)  $(PETSCLIB)  ../c/libpISSM.a  $(METISLIB) $(FLIBS)  $(PLAPACKLIB) $(SCALAPACKLIB) $(BLASLAPACKLIB) $(MKLLIB) $(MUMPSLIB) $(BLACSLIB) $(DAKOTALIB) $(X_LIBS) $(SLEPCLIB)  $(MPILIB) $(MATHLIB) $(FORTRANLIB) $(GRAPHICSLIB)
+LDADD = ./libpISSM.a $(METISLIB) $(PETSCLIB) $(DAKOTALIB) $(SLEPCLIB) $(MUMPSLIB) $(PLAPACKLIB)  $(MPILIB) $(X_LIBS) -lX11 $(BLASLAPACKLIB) $(MKLLIB) $(SCALAPACKLIB) $(BLACSLIB) $(FLIBS)
 
 diagnostic_exe_SOURCES = parallel/diagnostic.cpp
Index: /issm/trunk/src/c/io/WriteNodeSets.cpp
===================================================================
--- /issm/trunk/src/c/io/WriteNodeSets.cpp	(revision 1438)
+++ /issm/trunk/src/c/io/WriteNodeSets.cpp	(revision 1439)
@@ -28,5 +28,5 @@
 	int fsize=0;
 	int ssize=0;
-	mwSize nfields=9;
+	const mwSize nfields=9;
 	const	char*	fnames[nfields];
 	mwSize		onebyone[2] = {1,1};
Index: /issm/trunk/src/c/objects/Beam.cpp
===================================================================
--- /issm/trunk/src/c/objects/Beam.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Beam.cpp	(revision 1439)
@@ -408,5 +408,5 @@
 
 		//compute ub
-		constant_part=-1.58*pow(10.0,-10.0)*rho_ice*gravity*h[0];
+		constant_part=-1.58*pow((double)10.0,-(double)10.0)*rho_ice*gravity*h[0];
 		ub=constant_part*slope[0];
 		vb=constant_part*slope[1];
Index: /issm/trunk/src/c/objects/Friction.cpp
===================================================================
--- /issm/trunk/src/c/objects/Friction.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Friction.cpp	(revision 1439)
@@ -67,5 +67,5 @@
 	/*diverse: */
 	int     i;
-	int     numgrids=3;
+	const int     numgrids=3;
 	double  Neff[numgrids];
 	double  r,s;
@@ -118,5 +118,5 @@
 	/*diverse: */
 	int     i;
-	int     numgrids=3;
+	const int     numgrids=3;
 	double  Neff[numgrids];
 	double  r,s;
Index: /issm/trunk/src/c/objects/Icefront.cpp
===================================================================
--- /issm/trunk/src/c/objects/Icefront.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Icefront.cpp	(revision 1439)
@@ -1072,14 +1072,14 @@
 		//Get the coordinates of gauss point for each triangle in penta/quad
 		r_tria=gauss_coord[1]-gauss_coord[0];
-		s_tria=-3/sqrt(3)*(gauss_coord[0]+gauss_coord[1]-2/3);
+		s_tria=-3/sqrt((double)3)*(gauss_coord[0]+gauss_coord[1]-2/3);
 
 		//Coordinates of gauss points in the reference triangle
 		r_quad[0]=r_tria;
-		s_quad[0]=1/sqrt(3)*s_tria-2/3;
-		r_quad[1]=-1/sqrt(3)*s_tria+2/3;
+		s_quad[0]=1/sqrt((double)3)*s_tria-2/3;
+		r_quad[1]=-1/sqrt((double)3)*s_tria+2/3;
 		s_quad[1]=r_tria;
 		r_quad[2]=-r_tria;
-		s_quad[2]=-1/sqrt(3)*s_tria+2/3;
-		r_quad[3]=1/sqrt(3)*s_tria-2/3;
+		s_quad[2]=-1/sqrt((double)3)*s_tria+2/3;
+		r_quad[3]=1/sqrt((double)3)*s_tria-2/3;
 		s_quad[3]=-r_tria;
 
@@ -1324,14 +1324,14 @@
 		//Get the coordinates of gauss point for each triangle in penta/quad
 		r_tria=gauss_coord[1]-gauss_coord[0];
-		s_tria=-3/sqrt(3)*(gauss_coord[0]+gauss_coord[1]-2/3);
+		s_tria=-3/sqrt((double)3)*(gauss_coord[0]+gauss_coord[1]-2/3);
 
 		//Coordinates of gauss points in the reference triangle
 		r_quad[0]=r_tria;
-		s_quad[0]=1/sqrt(3)*s_tria-2/3;
-		r_quad[1]=-1/sqrt(3)*s_tria+2/3;
+		s_quad[0]=1/sqrt((double)3)*s_tria-2/3;
+		r_quad[1]=-1/sqrt((double)3)*s_tria+2/3;
 		s_quad[1]=r_tria;
 		r_quad[2]=-r_tria;
-		s_quad[2]=-1/sqrt(3)*s_tria+2/3;
-		r_quad[3]=1/sqrt(3)*s_tria-2/3;
+		s_quad[2]=-1/sqrt((double)3)*s_tria+2/3;
+		r_quad[3]=1/sqrt((double)3)*s_tria-2/3;
 		s_quad[3]=-r_tria;
 
Index: /issm/trunk/src/c/objects/Matice.cpp
===================================================================
--- /issm/trunk/src/c/objects/Matice.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Matice.cpp	(revision 1439)
@@ -161,5 +161,5 @@
 	else{
 		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0)){
-			viscosity=pow(10,14);
+			viscosity=pow((double)10,(double)14);
 		}
 		else{
@@ -173,5 +173,5 @@
 			if(A==0){
 				/*Maxiviscositym viscosity for 0 shear areas: */
-				viscosity=4.5*pow(10,17);
+				viscosity=4.5*pow((double)10,(double)17);
 			}
 			else{
@@ -229,5 +229,5 @@
 		if(A==0){
 			/*Maximum viscosity_complement for 0 shear areas: */
-			viscosity_complement=4.5*pow(10,17);
+			viscosity_complement=4.5*pow((double)10,(double)17);
 		}
 		else{
@@ -238,5 +238,5 @@
 	}
 	else{
-		viscosity_complement=4.5*pow(10,17);
+		viscosity_complement=4.5*pow((double)10,(double)17);
 	}
 		
@@ -282,5 +282,5 @@
 		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
 				(epsilon[3]==0) && (epsilon[4]==0)){
-			viscosity3d=pow(10,14);
+			viscosity3d=pow((double)10,(double)14);
 		}
 		else{
@@ -297,5 +297,5 @@
 			if(A==0){
 				/*Maxiviscosity3dm viscosity for 0 shear areas: */
-				viscosity3d=4.5*pow(10,17);
+				viscosity3d=4.5*pow((double)10,(double)17);
 			}
 			else{
@@ -341,5 +341,5 @@
 	double eps0;
 
-	eps0=pow(10,-27);
+	eps0=pow((double)10,(double)-27);
 	
 	if (n==1){
@@ -350,5 +350,5 @@
 		if((epsilon[0]==0) && (epsilon[1]==0) && (epsilon[2]==0) && 
 				(epsilon[3]==0) && (epsilon[4]==0) && (epsilon[5]==0)){
-			viscosity3d=pow(10,14);
+			viscosity3d=pow((double)10,(double)14);
 		}
 		else{
@@ -366,5 +366,5 @@
 			if(A==0){
 				/*Maxiviscosity3dm viscosity for 0 shear areas: */
-				viscosity3d=4.5*pow(10,17);
+				viscosity3d=4.5*pow((double)10,(double)17);
 			}
 			else{
Index: /issm/trunk/src/c/objects/Pengrid.cpp
===================================================================
--- /issm/trunk/src/c/objects/Pengrid.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Pengrid.cpp	(revision 1439)
@@ -267,7 +267,7 @@
 
 	//Create elementary matrix: add penalty to contrain wb (wb=ub*db/dx+vb*db/dy)
-	Ke[2][0]=-slope[0]*kmax*pow(10.0,penalty_offset);
-	Ke[2][1]=-slope[1]*kmax*pow(10.0,penalty_offset);
-	Ke[2][2]=kmax*pow(10,penalty_offset);
+	Ke[2][0]=-slope[0]*kmax*pow((double)10.0,penalty_offset);
+	Ke[2][1]=-slope[1]*kmax*pow((double)10.0,penalty_offset);
+	Ke[2][2]=kmax*pow((double)10,penalty_offset);
 	
 	/*Add Ke to global matrix Kgg: */
@@ -299,5 +299,5 @@
 	GetDofList(&doflist[0],&numberofdofspernode);
 
-	Ke[0][0]=kmax*pow(10,penalty_offset);
+	Ke[0][0]=kmax*pow((double)10,penalty_offset);
 	
 	/*Add Ke to global matrix Kgg: */
@@ -348,5 +348,5 @@
 	//Add penalty load
 	if (temperature<t_pmp){ //If T<Tpmp, there must be no melting. Therefore, melting should be  constrained to 0 when T<Tpmp, instead of using spcs, use penalties
-		Ke[0][0]=kmax*pow(10,penalty_offset);
+		Ke[0][0]=kmax*pow((double)10,penalty_offset);
 	}
 	
@@ -435,5 +435,5 @@
 
 	//Add penalty load
-	P_terms[0]=kmax*pow(10,penalty_offset)*t_pmp;
+	P_terms[0]=kmax*pow((double)10,penalty_offset)*t_pmp;
 
 	/*Add P_terms to global vector pg: */
@@ -501,8 +501,8 @@
 	else{
 		if (sub_analysis_type==SteadyAnalysisEnum()){
-			P_terms[0]=melting_offset*pow(10,penalty_offset)*(temperature-t_pmp);
+			P_terms[0]=melting_offset*pow((double)10,penalty_offset)*(temperature-t_pmp);
 		}
 		else{
-			P_terms[0]=melting_offset*pow(10,penalty_offset)*(temperature-t_pmp)/dt;
+			P_terms[0]=melting_offset*pow((double)10,penalty_offset)*(temperature-t_pmp)/dt;
 		}
 	}
Index: /issm/trunk/src/c/objects/Penta.cpp
===================================================================
--- /issm/trunk/src/c/objects/Penta.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Penta.cpp	(revision 1439)
@@ -774,12 +774,12 @@
 	int i,j;
 
-	int numgrids=6;
-	int DOFPERGRID=4;
-	int numdof=numgrids*DOFPERGRID;
+	const int numgrids=6;
+	const int DOFPERGRID=4;
+	const int numdof=numgrids*DOFPERGRID;
 	int doflist[numdof];
 	int numberofdofspernode;
 
-	int numgrids2d=3;
-	int numdof2d=numgrids2d*DOFPERGRID;
+	const int numgrids2d=3;
+	const int numdof2d=numgrids2d*DOFPERGRID;
 
 	int   dofs[3]={0,1,2};
@@ -2564,6 +2564,6 @@
 	int i,j;
 
-	int numgrids=6;
-	int DOFVELOCITY=3;
+	const int numgrids=6;
+	const int DOFVELOCITY=3;
 	double B[8][27];
 	double B_reduced[numgrids][DOFVELOCITY*numgrids];
@@ -2616,6 +2616,6 @@
 	
 	int i;
-	int calculationdof=3;
-	int numgrids=6;
+	const int calculationdof=3;
+	const int numgrids=6;
 	int DOFPERGRID=4;
 
@@ -2698,6 +2698,6 @@
 
 	int i;
-	int calculationdof=3;
-	int numgrids=6;
+	const int calculationdof=3;
+	const int numgrids=6;
 	int DOFPERGRID=4;
 
@@ -2784,5 +2784,5 @@
 
 	int i;
-	int numgrids2d=3;
+	const int numgrids2d=3;
 	int num_dof=4;
 
@@ -2891,5 +2891,5 @@
 
 	int i;
-	int numgrids2d=3;
+	const int numgrids2d=3;
 	int num_dof=4;
 
@@ -2983,5 +2983,5 @@
 	int i;
 
-	int numgrids=7;
+	const  int numgrids=7;
 	double dh1dh7_param[3][numgrids];
 	double Jinv[3][3];
@@ -3068,8 +3068,8 @@
 	int i,j;
 
-	int numgrids=6;
-	int DOFPERGRID=4;
-	int numdof=numgrids*DOFPERGRID;
-	int numgrids2d=3;
+	const int numgrids=6;
+	const int DOFPERGRID=4;
+	const int numdof=numgrids*DOFPERGRID;
+	const int numgrids2d=3;
 	int numdof2d=numgrids2d*DOFPERGRID;
 	int doflist[numdof];
@@ -3603,6 +3603,6 @@
 	
 	int i;
-	int calculationdof=3;
-	int numgrids=6;
+	const int calculationdof=3;
+	const int numgrids=6;
 	int DOFPERGRID=1;
 
@@ -3672,6 +3672,6 @@
 	
 	int i;
-	int calculationdof=3;
-	int numgrids=6;
+	const int calculationdof=3;
+	const int numgrids=6;
 	int DOFPERGRID=1;
 
Index: /issm/trunk/src/c/objects/Sing.cpp
===================================================================
--- /issm/trunk/src/c/objects/Sing.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Sing.cpp	(revision 1439)
@@ -312,6 +312,6 @@
 	B=matice->GetB();
 
-	ub=-1.58*pow(10.0,-10.0)*rho_ice*gravity*h*slope[0];
-	vb=-1.58*pow(10.0,-10.0)*rho_ice*gravity*h*slope[1];
+	ub=-1.58*pow((double)10.0,(double)-10.0)*rho_ice*gravity*h*slope[0];
+	vb=-1.58*pow((double)10.0,(double)-10.0)*rho_ice*gravity*h*slope[1];
 
 	//compute constant_part
Index: /issm/trunk/src/c/objects/Tria.cpp
===================================================================
--- /issm/trunk/src/c/objects/Tria.cpp	(revision 1438)
+++ /issm/trunk/src/c/objects/Tria.cpp	(revision 1439)
@@ -655,6 +655,6 @@
 		v_gauss[1]=1.0/3.0*(vxvy_list[0][1]+vxvy_list[1][1]+vxvy_list[2][1]);
 		
-		K[0][0]=pow(Jdettria,.5)/2.0*fabs(v_gauss[0]);
-		K[1][1]=pow(Jdettria,.5)/2.0*fabs(v_gauss[1]);
+		K[0][0]=pow(Jdettria,(double).5)/2.0*fabs(v_gauss[0]);
+		K[1][1]=pow(Jdettria,(double).5)/2.0*fabs(v_gauss[1]);
 	}
 
@@ -1016,7 +1016,7 @@
 
 		if (slope_magnitude>MAXSLOPE){
-			alpha2_list[0]=pow(10,MOUNTAINKEXPONENT);
-			alpha2_list[1]=pow(10,MOUNTAINKEXPONENT);
-			alpha2_list[2]=pow(10,MOUNTAINKEXPONENT);
+			alpha2_list[0]=pow((double)10,MOUNTAINKEXPONENT);
+			alpha2_list[1]=pow((double)10,MOUNTAINKEXPONENT);
+			alpha2_list[2]=pow((double)10,MOUNTAINKEXPONENT);
 		}
 
@@ -2662,5 +2662,5 @@
 	normal[2]=v13[0]*v23[1]-v13[1]*v23[0];
 
-	normal_norm=sqrt( pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2) );
+	normal_norm=sqrt( pow(normal[0],(double)2)+pow(normal[1],(double)2)+pow(normal[2],(double)2) );
 
 	*(surface_normal)=normal[0]/normal_norm;
@@ -2903,5 +2903,5 @@
 		/*We are using an absolute misfit: */
 		for (i=0;i<numgrids;i++){
-			absolute_list[i]=0.5*(pow((vx_list[i]-obs_vx_list[i]),2)+pow((vy_list[i]-obs_vy_list[i]),2));
+			absolute_list[i]=0.5*(pow((vx_list[i]-obs_vx_list[i]),(double)2)+pow((vy_list[i]-obs_vy_list[i]),(double)2));
 		}
 	}
@@ -2909,6 +2909,6 @@
 		/*We are using a relative misfit: */
 		for (i=0;i<numgrids;i++){
-			scalex=pow(meanvel/(obs_vx_list[i]+epsvel),2);
-			scaley=pow(meanvel/(obs_vy_list[i]+epsvel),2);
+			scalex=pow(meanvel/(obs_vx_list[i]+epsvel),(double)2);
+			scaley=pow(meanvel/(obs_vy_list[i]+epsvel),(double)2);
 			if(obs_vx_list[i]==0)scalex=0;
 			if(obs_vy_list[i]==0)scaley=0;
@@ -2919,7 +2919,7 @@
 		/*We are using a logarithmic misfit: */
 		for (i=0;i<numgrids;i++){
-			velocity_mag=sqrt(pow(vx_list[i],2)+pow(vy_list[i],2))+epsvel; //epsvel to avoid velocity being nil.
-			obs_velocity_mag=sqrt(pow(obs_vx_list[i],2)+pow(obs_vy_list[i],2))+epsvel; //epsvel to avoid observed velocity being nil.
-			logarithmic_list[i]=4*pow(meanvel,2)*pow(log(velocity_mag/obs_velocity_mag),2);
+			velocity_mag=sqrt(pow(vx_list[i],(double)2)+pow(vy_list[i],(double)2))+epsvel; //epsvel to avoid velocity being nil.
+			obs_velocity_mag=sqrt(pow(obs_vx_list[i],(double)2)+pow(obs_vy_list[i],(double)2))+epsvel; //epsvel to avoid observed velocity being nil.
+			logarithmic_list[i]=4*pow(meanvel,(double)2)*pow(log(velocity_mag/obs_velocity_mag),(double)2);
 		}
 	}
@@ -3100,5 +3100,5 @@
 	normal[2]=(x4-x6)*(y5-y6)-(y4-y6)*(x5-x6);
 
-	norm_normal=sqrt(pow(normal[0],2)+pow(normal[1],2)+pow(normal[2],2));
+	norm_normal=sqrt(pow(normal[0],(double)2)+pow(normal[1],(double)2)+pow(normal[2],(double)2));
 	nz=1.0/norm_normal*normal[2];
 
@@ -3684,5 +3684,5 @@
 	/* Compute basal friction */
 	for(i=0;i<numgrids;i++){
-		basalfriction_list[i]= alpha2_list[i]*(pow(vx_list[i],2.0)+pow(vy_list[i],2.0));
+		basalfriction_list[i]= alpha2_list[i]*(pow(vx_list[i],(double)2.0)+pow(vy_list[i],(double)2.0));
 	}
 	
Index: /issm/trunk/src/c/shared/Elements/Paterson.cpp
===================================================================
--- /issm/trunk/src/c/shared/Elements/Paterson.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/Elements/Paterson.cpp	(revision 1439)
@@ -8,4 +8,6 @@
 #define __FUNCT__ "Paterson"
 #include <math.h>
+
+
 double Paterson(double temperature){
 	
@@ -31,35 +33,35 @@
 
 	if(T<=-45.0){
-		B=pow(10,8)*(-0.000292866376675*pow(T+50,3)+ 0.011672640664130*pow(T+50,2)  -0.325004442485481*(T+50)+  6.524779401948101);
+		B=pow((double)10,(double)8)*(-0.000292866376675*pow(T+50,3)+ 0.011672640664130*pow(T+50,2)  -0.325004442485481*(T+50)+  6.524779401948101);
 	}
 	if((T>=-45.0) && (T<=-40.0)){
-		B=pow(10,8)*(-0.000292866376675*pow(T+45,3)+ 0.007279645014004*pow(T+45,2)  -0.230243014094813*(T+45)+  5.154964909039554);
+		B=pow((double)10,(double)8)*(-0.000292866376675*pow(T+45,3)+ 0.007279645014004*pow(T+45,2)  -0.230243014094813*(T+45)+  5.154964909039554);
 	}
 	if((T>=-40.0) && (T<=-35.0)){
-		B=pow(10,8)*(0.000072737147457*pow(T+40,3)+  0.002886649363879*pow(T+40,2)  -0.179411542205399*(T+40)+  4.149132666831214);
+		B=pow((double)10,(double)8)*(0.000072737147457*pow(T+40,3)+  0.002886649363879*pow(T+40,2)  -0.179411542205399*(T+40)+  4.149132666831214);
 	}
 	if((T>=-35.0) && (T<=-30.0)){
-		B=pow(10,8)*(-0.000086144770023*pow(T+35,3)+ 0.003977706575736*pow(T+35,2)  -0.145089762507325*(T+35)+  3.333333333333331);
+		B=pow((double)10,(double)8)*(-0.000086144770023*pow(T+35,3)+ 0.003977706575736*pow(T+35,2)  -0.145089762507325*(T+35)+  3.333333333333331);
 	}
 	if((T>=-30.0) && (T<=-25.0)){
-		B=pow(10,8)*(-0.000043984685769*pow(T+30,3)+ 0.002685535025386*pow(T+30,2)  -0.111773554501713*(T+30)+  2.696559088937191);
+		B=pow((double)10,(double)8)*(-0.000043984685769*pow(T+30,3)+ 0.002685535025386*pow(T+30,2)  -0.111773554501713*(T+30)+  2.696559088937191);
 	}
 	if((T>=-25.0) && (T<=-20.0)){
-		B=pow(10,8)*(-0.000029799523463*pow(T+25,3)+ 0.002025764738854*pow(T+25,2)  -0.088217055680511*(T+25)+  2.199331606342181);
+		B=pow((double)10,(double)8)*(-0.000029799523463*pow(T+25,3)+ 0.002025764738854*pow(T+25,2)  -0.088217055680511*(T+25)+  2.199331606342181);
 	}
 	if((T>=-20.0) && (T<=-15.0)){
-		B=pow(10,8)*(0.000136920904777*pow(T+20,3)+  0.001578771886910*pow(T+20,2)  -0.070194372551690*(T+20)+  1.805165505978111);
+		B=pow((double)10,(double)8)*(0.000136920904777*pow(T+20,3)+  0.001578771886910*pow(T+20,2)  -0.070194372551690*(T+20)+  1.805165505978111);
 	}
 	if((T>=-15.0) && (T<=-10.0)){
-		B=pow(10,8)*(-0.000899763781026*pow(T+15,3)+ 0.003632585458564*pow(T+15,2)  -0.044137585824322*(T+15)+  1.510778053489523);
+		B=pow((double)10,(double)8)*(-0.000899763781026*pow(T+15,3)+ 0.003632585458564*pow(T+15,2)  -0.044137585824322*(T+15)+  1.510778053489523);
 	}
 	if((T>=-10.0) && (T<=-5.0)){
-		B=pow(10,8)*(0.001676964325070*pow(T+10,3)-  0.009863871256831*pow(T+10,2)  -0.075294014815659*(T+10)+  1.268434288203714);
+		B=pow((double)10,(double)8)*(0.001676964325070*pow(T+10,3)-  0.009863871256831*pow(T+10,2)  -0.075294014815659*(T+10)+  1.268434288203714);
 	}
 	if((T>=-5.0) && (T<=-2.0)){
-		B=pow(10,8)*(-0.003748937622487*pow(T+5,3)+0.015290593619213*pow(T+5,2)  -0.048160403003748*(T+5)+  0.854987973338348);
+		B=pow((double)10,(double)8)*(-0.003748937622487*pow(T+5,3)+0.015290593619213*pow(T+5,2)  -0.048160403003748*(T+5)+  0.854987973338348);
 	}
 	if(T>=-2.0){
-		B=pow(10,8)*(-0.003748937622488*pow(T+2,3)-0.018449844983174*pow(T+2,2)  -0.057638157095631*(T+2)+  0.746900791092860);
+		B=pow((double)10,(double)8)*(-0.003748937622488*pow(T+2,3)-0.018449844983174*pow(T+2,2)  -0.057638157095631*(T+2)+  0.746900791092860);
 	}
 
Index: /issm/trunk/src/c/shared/Exp/IsInPolySerial.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/IsInPolySerial.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/Exp/IsInPolySerial.cpp	(revision 1439)
@@ -4,4 +4,6 @@
 
 #include <math.h>
+
+
 #include "./exp.h"
 
Index: /issm/trunk/src/c/shared/Matlab/PrintfFunction.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matlab/PrintfFunction.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/Matlab/PrintfFunction.cpp	(revision 1439)
@@ -6,4 +6,8 @@
 #include "stdarg.h"
 #include "stdio.h"
+
+#ifdef _SERIAL_
+#include "mex.h"
+#endif
 
 int PrintfFunction(char* format,...){
@@ -20,5 +24,9 @@
 	//First use vsprintf to get the whole input string.
 	va_start(ap,format);
+	 #ifndef WIN32
 	string_size=vsprintf(string,format,ap); //printf style coding 
+	#else
+	string_size=vsprintf_s(string,format,ap); //printf style coding 
+	#endif
 	va_end(ap); 
 
@@ -27,6 +35,8 @@
 		if(my_rank==0)printf(string);
 	#else
-		printf(string);
+		mexPrintf(string);
 	#endif
+
+	return 1;
 }
 
Index: /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/Matrix/MatrixUtils.cpp	(revision 1439)
@@ -39,5 +39,5 @@
 #include <stdio.h>
 #include <sys/types.h>
-#include <math.h>     /*  fabs  */
+#include <math.h>
 #include <float.h>    /*  DBL_EPSILON  */
 
@@ -197,5 +197,5 @@
 	if (ntrma != ntrmb) {
 		_printf_("%s -- Matrix A and B inner vectors not equal size.\n",
-				 __func__);
+				 __FUNCT__);
 	    noerr=0;	
 		return noerr;
@@ -275,5 +275,5 @@
 	if (!b && nvec) {
 		_printf_("%s -- No right-hand side for nvec=%d.\n",
-				 __func__,nvec);
+				 __FUNCT__,nvec);
 		noerr=0;
 		return noerr;
@@ -310,5 +310,5 @@
 			xfree((void **)&pindx);
 			_printf_("%s -- Pivot %f less than machine epsilon.\n",
-					 __func__,pivot);
+					 __FUNCT__,pivot);
 			noerr=0;
 			return noerr;
Index: /issm/trunk/src/c/shared/Numerics/GaussPoints.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/GaussPoints.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/Numerics/GaussPoints.cpp	(revision 1439)
@@ -9,4 +9,5 @@
 #include <math.h>
 #include <float.h>
+
 
 /*=======1=========2=========3=========4=========5=========6=========7=========8
Index: /issm/trunk/src/c/shared/Numerics/norm.cpp
===================================================================
--- /issm/trunk/src/c/shared/Numerics/norm.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/Numerics/norm.cpp	(revision 1439)
@@ -9,5 +9,6 @@
 #endif
 
-#include "math.h"
+#include <math.h>
+
 
 double norm(double* vector){
Index: /issm/trunk/src/c/shared/Numerics/numerics.h
===================================================================
--- /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 1438)
+++ /issm/trunk/src/c/shared/Numerics/numerics.h	(revision 1439)
@@ -7,4 +7,5 @@
 
 #include "./GaussPoints.h"
+#include "./isnan.h"
 #include "../../objects/objects.h"
 
Index: /issm/trunk/src/c/shared/TriMesh/GridInsideHole.cpp
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 1438)
+++ /issm/trunk/src/c/shared/TriMesh/GridInsideHole.cpp	(revision 1439)
@@ -8,4 +8,6 @@
 
 #include <math.h>
+
+
 #include "./trimesh.h"
 #include "../Exp/exp.h"
Index: /issm/trunk/src/c/shared/TriMesh/trimesh.h
===================================================================
--- /issm/trunk/src/c/shared/TriMesh/trimesh.h	(revision 1438)
+++ /issm/trunk/src/c/shared/TriMesh/trimesh.h	(revision 1439)
@@ -9,4 +9,6 @@
 #include "stdio.h"
 #include <math.h>
+
+
 
 //#define REAL double //took  it out because it may conflict with stdlib.h defines. put back if necessary
Index: /issm/trunk/src/c/toolkits/petsc/patches/PetscDetermineLocalSize.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/petsc/patches/PetscDetermineLocalSize.cpp	(revision 1438)
+++ /issm/trunk/src/c/toolkits/petsc/patches/PetscDetermineLocalSize.cpp	(revision 1439)
@@ -5,4 +5,6 @@
 #include "stdio.h"
 #include <math.h>
+
+
 #include "../../../shared/shared.h"
 
@@ -29,9 +31,9 @@
 		  left  are then redistributed, therefore resulting in a 
 		  more even distribution.*/
-		num_local_rows[i]=(int)floor(global_size/num_procs); 
+		num_local_rows[i]=(int)floor((double)global_size/(double)num_procs); 
 	}
 	
 	/*There may be some rows left. Distribute evenly.*/ 
-	row_rest=global_size - num_procs*(int)floor(global_size/num_procs);
+	row_rest=global_size - num_procs*(int)floor((double)global_size/(double)num_procs);
 	for (i=0;i<row_rest;i++){
 		num_local_rows[i]++;
Index: /issm/trunk/src/c/toolkits/plapack/patches/CyclicalFactorization.cpp
===================================================================
--- /issm/trunk/src/c/toolkits/plapack/patches/CyclicalFactorization.cpp	(revision 1438)
+++ /issm/trunk/src/c/toolkits/plapack/patches/CyclicalFactorization.cpp	(revision 1439)
@@ -3,4 +3,6 @@
 */
 #include <math.h>
+
+
 #include "../../../shared/shared.h"
 
Index: /issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m
===================================================================
--- /issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m	(revision 1438)
+++ /issm/trunk/src/m/classes/public/LaunchQueueJobGeneric.m	(revision 1439)
@@ -14,28 +14,38 @@
 end
 
-%if we are running locally, no need to call ssh to launch the job. We figure out by comparing the 
-%hostname to the cluster name
-[result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
-	
-disp('uploading input file and queueing script');
-if strcmpi(hostname,md.cluster),
-	if md.qmu_analysis,
-		system(['cp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' ' ' executionpath]);
+if ~strcmpi(options.batch,'yes'),
+
+	%if we are running locally, no need to call ssh to launch the job. We figure out by comparing the 
+	%hostname to the cluster name
+	[result,hostname]=system('hostname -s');hostname=hostname(1:end-1);
+	disp('uploading input file and queueing script');
+	if strcmpi(hostname,md.cluster),
+		if md.qmu_analysis,
+			system(['cp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' ' ' executionpath]);
+		else
+			system(['cp ' md.name '.bin' ' ' md.name '.queue' ' ' executionpath]);
+		end
 	else
-		system(['cp ' md.name '.bin' ' ' md.name '.queue' ' ' executionpath]);
+		if md.qmu_analysis,
+			system(['scp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' ' ' md.cluster ':' executionpath]);
+		else
+			system(['scp ' md.name '.bin' ' ' md.name '.queue' ' ' md.cluster ':' executionpath]);
+		end
 	end
+
+	disp('launching solution sequence on remote cluster');
+	%now call the queuing script to launch the job.
+	if strcmpi(hostname,md.cluster),
+		system(['cd ' executionpath ' && source ' md.name '.queue ']);
+	else
+		system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ' md.name '.queue ''']);
+	end
+
 else
-	if md.qmu_analysis,
-		system(['scp ' md.name '.bin' ' ' md.name '.queue ' md.name '.qmu.in ' ' ' md.cluster ':' executionpath]);
-	else
-		system(['scp ' md.name '.bin' ' ' md.name '.queue' ' ' md.cluster ':' executionpath]);
-	end
+	disp('batch mode requested: not launching job interactively');
+	disp(['launch solution sequence by copying files ' md.name '.bin' ',' md.name '.queue and ' md.name '.qmu.in, onto remote cluster ' md.cluster]);
+	disp(['   then log int ' md.cluster ' and source queue file ' md.name '.queue']);
+	md.waitonlock=0;
 end
 
-disp('launching solution sequence on remote cluster');
-%now call the queuing script to launch the job.
-if strcmpi(hostname,md.cluster),
-	system(['cd ' executionpath ' && source ' md.name '.queue ']);
-else
-	system(['ssh  ' md.cluster ' ''cd ' executionpath ' && source ' md.name '.queue ''']);
-end
+
Index: /issm/trunk/src/m/utils/Nightly/nightlyrun.m
===================================================================
--- /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 1438)
+++ /issm/trunk/src/m/utils/Nightly/nightlyrun.m	(revision 1439)
@@ -30,7 +30,7 @@
 cd Verification
 
-%Get a list of the test decks
-[status,list]=system('ls -l | grep -v CVS | grep -v cielo | awk ''{printf("%s|",$9);}'' '); %only works on *nix systems.
-list=strsplit(list,'|');
+[status,list]=system('ls '); %will work on all machines, hopefully
+list=strsplit(list,char(10));
+list=list(1:end-1);
 
 %Get packages
Index: /issm/trunk/src/mex/ComputePressure/ComputePressure.cpp
===================================================================
--- /issm/trunk/src/mex/ComputePressure/ComputePressure.cpp	(revision 1438)
+++ /issm/trunk/src/mex/ComputePressure/ComputePressure.cpp	(revision 1439)
@@ -17,4 +17,6 @@
 	ParameterInputs* inputs=NULL;
 	int      numberofnodes;
+
+	printf("hello\n");
 
 	/* output datasets: */
@@ -60,6 +62,6 @@
 
 void ComputePressureUsage(void) {
-	_printf_("\n");
-	_printf_("   usage: [p_g] = %s(elements, nodes, loads, materials, params,inputs);\n",__FUNCT__);
-	_printf_("\n");
+	printf("\n");
+	printf("   usage: [p_g] = %s(elements, nodes, loads, materials, params,inputs);\n",__FUNCT__);
+	printf("\n");
 }
Index: /issm/trunk/startup.m
===================================================================
--- /issm/trunk/startup.m	(revision 1438)
+++ /issm/trunk/startup.m	(revision 1439)
@@ -13,5 +13,9 @@
 
 %Recover ISSM_DIR 
-[status,ISSM_DIR]=system('echo $ISSM_DIR');
+if ispc,
+	[status,ISSM_DIR]=system('echo [%ISSM_DIR%]');
+else
+	[status,ISSM_DIR]=system('echo $ISSM_DIR');
+end
 if status~=0,
 	error('issmdir error message: problem when running ''echo $ISSM_DIR'' shell command');
@@ -20,6 +24,11 @@
 	error('issmdir error message: ''ISSM_DIR'' environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!');
 end
-%get rid of return carriage
-ISSM_DIR=ISSM_DIR(1:end-1); clear status;
+%get rid of useless symbols in the name
+if ispc,
+ISSM_DIR=ISSM_DIR(2:end-2); 
+else
+ISSM_DIR=ISSM_DIR(1:end-1); 
+end
+clear status;
 
 %Now add all issm code paths necessary to run issm smoothly. 
