[cig-commits] r22441 - in seismo/3D/SPECFEM3D_GLOBE/branches/undo_att: . EXAMPLES doc doc/USER_MANUAL setup src/meshfem3D src/specfem3D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Fri Jun 28 09:17:02 PDT 2013


Author: dkomati1
Date: 2013-06-28 09:17:01 -0700 (Fri, 28 Jun 2013)
New Revision: 22441

Added:
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth/
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/EXAMPLES/small_benchmark_run_to_test_very_simple_Earth/
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.guess
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.sub
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/install-sh
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/yyyy_will_need_to_add_UNDO_ATT_NT_DUMP_to_all_EXAMPLE_Par_files
Removed:
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/EXAMPLES/small_benchmark_run_to_test_a_new_machine/
Modified:
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure.ac
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/bibliography.bib
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.pdf
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/time_scheme_we_use_in_the_code_from_Hughes_1987.pdf
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/meshfem3D.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_aniso_mantle.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_atten3D_QRFSI12.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crust.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crustmaps.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_epcrust.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_eucrust.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gapp2.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gll.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_heterogen_mantle.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_ppm.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s20rts.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s362ani.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s40rts.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_sea99_s.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_receivers.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_regular_points.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90
Log:
merged changes from the trunk; no conflict was detected


Copied: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.guess (from rev 22440, seismo/3D/SPECFEM3D_GLOBE/trunk/config.guess)
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.guess	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.guess	2013-06-28 16:17:01 UTC (rev 22441)
@@ -0,0 +1,1530 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
+
+timestamp='2012-06-10'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep -q __ELF__
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+		os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+	exitcode=$?
+	trap '' 0
+	exit $exitcode ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+	echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+	echo m68k-milan-mint${UNAME_RELEASE}
+	exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+	echo m68k-hades-mint${UNAME_RELEASE}
+	exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+	echo m68k-unknown-mint${UNAME_RELEASE}
+	exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+	# DG/UX returns AViiON for all architectures
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[4567])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+		    case "${sc_cpu_version}" in
+		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+		      532)                      # CPU_PA_RISC2_0
+			case "${sc_kernel_bits}" in
+			  32) HP_ARCH="hppa2.0n" ;;
+			  64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+			esac ;;
+		    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^		//' << EOF >$dummy.c
+
+		#define _HPUX_SOURCE
+		#include <stdlib.h>
+		#include <unistd.h>
+
+		int main ()
+		{
+		#if defined(_SC_KERNEL_BITS)
+		    long bits = sysconf(_SC_KERNEL_BITS);
+		#endif
+		    long cpu  = sysconf (_SC_CPU_VERSION);
+
+		    switch (cpu)
+			{
+			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+			case CPU_PA_RISC2_0:
+		#if defined(_SC_KERNEL_BITS)
+			    switch (bits)
+				{
+				case 64: puts ("hppa2.0w"); break;
+				case 32: puts ("hppa2.0n"); break;
+				default: puts ("hppa2.0"); break;
+				} break;
+		#else  /* !defined(_SC_KERNEL_BITS) */
+			    puts ("hppa2.0"); break;
+		#endif
+			default: puts ("hppa1.0"); break;
+			}
+		    exit (0);
+		}
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+	exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+	exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+	exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+	exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    5000:UNIX_System_V:4.*:*)
+	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	UNAME_PROCESSOR=`/usr/bin/uname -p`
+	case ${UNAME_PROCESSOR} in
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:MSYS*:*)
+	echo ${UNAME_MACHINE}-pc-msys
+	exit ;;
+    i*:windows32*:*)
+	# uname -m includes "-pc" on this system.
+	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:*)
+	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    aarch64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    aarch64_be:Linux:*:*)
+	UNAME_MACHINE=aarch64_be
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+	esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep -q __ARM_PCS_VFP
+	    then
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	    else
+		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+	    fi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo ${UNAME_MACHINE}-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo ${UNAME_MACHINE}-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    hexagon:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=${UNAME_MACHINE}el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=${UNAME_MACHINE}
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    tile*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+	# Unixware is an offshoot of SVR4, but it has its own version
+	# number series starting with 2...
+	# I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+	# Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+	# uname -m prints for DJGPP always 'pc', but it prints nothing about
+	# the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+	exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+			# says <Richard.M.Bartel at ccMail.Census.GOV>
+	echo i586-unisys-sysv4
+	exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+		echo mips-nec-sysv${UNAME_RELEASE}
+	else
+		echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+	exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NEO-?:NONSTOP_KERNEL:*:*)
+	echo neo-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSE-*:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+	echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+    x86_64:VMkernel:*:*)
+	echo ${UNAME_MACHINE}-unknown-esx
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+	"4"
+#else
+	""
+#endif
+	); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:

Copied: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.sub (from rev 22440, seismo/3D/SPECFEM3D_GLOBE/trunk/config.sub)
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.sub	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/config.sub	2013-06-28 16:17:01 UTC (rev 22441)
@@ -0,0 +1,1782 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+#   2011, 2012 Free Software Foundation, Inc.
+
+timestamp='2012-04-18'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray | -microblaze)
+		os=
+		basic_machine=$1
+		;;
+	-bluegene*)
+		os=-cnk
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+	-chorusrdb)
+		os=-chorusrdb
+		basic_machine=$1
+		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*178)
+		os=-lynxos178
+		;;
+	-lynx*5)
+		os=-lynxos5
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| aarch64 | aarch64_be \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+        | be32 | be64 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| epiphany \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| hexagon \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| le32 | le64 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nds32 | nds32le | nds32be \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| open8 \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle \
+	| pyramid \
+	| rl78 | rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu \
+	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| we32k \
+	| x86 | xc16x | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=$basic_machine-unknown
+		;;
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	strongarm | thumb | xscale)
+		basic_machine=arm-unknown
+		;;
+	xgate)
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	xscaleeb)
+		basic_machine=armeb-unknown
+		;;
+
+	xscaleel)
+		basic_machine=armel-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| aarch64-* | aarch64_be-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| be32-* | be64-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| hexagon-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| le32-* | le64-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nds32-* | nds32le-* | nds32be-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| open8-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+	| pyramid-* \
+	| rl78-* | romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| tahoe-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile*-* \
+	| tron-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+	| vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16 | cr16-*)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	microblaze)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	msys)
+		basic_machine=i386-pc
+		os=-msys
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	nacl)
+		basic_machine=le32-unknown
+		os=-nacl
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	neo-tandem)
+		basic_machine=neo-tandem
+		;;
+	nse-tandem)
+		basic_machine=nse-tandem
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc | ppcbe)	basic_machine=powerpc-unknown
+		;;
+	ppc-* | ppcbe-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	strongarm-* | thumb-*)
+		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+	tile*)
+		basic_machine=$basic_machine-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	xscale-* | xscalee[bl]-*)
+		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+	# First match some system type aliases
+	# that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-auroraux)
+		os=-auroraux
+		;;
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+	-os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+	-tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
+	-nacl*)
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+	score-*)
+		os=-elf
+		;;
+	spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+	c4x-* | tic4x-*)
+		os=-coff
+		;;
+	hexagon-*)
+		os=-elf
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-cnk*|-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure	2013-06-28 16:17:01 UTC (rev 22441)
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for Specfem3D Globe 5.1.5.
+# Generated by GNU Autoconf 2.69 for Specfem3D Globe 5.1.5.
 #
 # Report bugs to <jtromp AT princeton.edu>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,7 +192,8 @@
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -214,21 +238,25 @@
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -331,6 +359,14 @@
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -452,6 +488,10 @@
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -486,16 +526,16 @@
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -507,28 +547,8 @@
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -631,6 +651,14 @@
 FC
 CUSTOM_MPI_TYPE
 CUSTOM_REAL
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
 target_alias
 host_alias
 build_alias
@@ -1144,8 +1172,6 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1287,6 +1313,10 @@
 _ACEOF
 
   cat <<\_ACEOF
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
 _ACEOF
 fi
 
@@ -1388,9 +1418,9 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Specfem3D Globe configure 5.1.5
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1504,7 +1534,7 @@
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -1728,7 +1758,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Specfem3D Globe $as_me 5.1.5, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2080,7 +2110,107 @@
 
 
 
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
 
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
 # 'configure' options
 
 # Check whether --enable-double-precision was given.
@@ -2116,7 +2246,7 @@
 ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_fc_compiler_gnu
 if test -n "$ac_tool_prefix"; then
-  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
@@ -2134,7 +2264,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2160,7 +2290,7 @@
 fi
 if test -z "$FC"; then
   ac_ct_FC=$FC
-  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -2178,7 +2308,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_FC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2543,6 +2673,11 @@
   fi
 fi
 
+if test $ac_compiler_gnu = yes; then
+  GFC=yes
+else
+  GFC=
+fi
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2618,9 +2753,16 @@
 #        that detects unbalanced quotes in FLIBS should be implemented
 #        and (ugh) tested at some point.
 case $ac_fc_v_output in
-  # If we are using xlf then replace all the commas with spaces.
+  # With xlf replace commas with spaces,
+  # and remove "-link" and closing parenthesis.
   *xlfentry*)
-    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;;
+    ac_fc_v_output=`echo $ac_fc_v_output |
+      sed '
+        s/,/ /g
+        s/ -link / /g
+        s/) *$//
+      '
+    ` ;;
 
   # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
   # $LIBS confuse us, and the libraries appear later in the output anyway).
@@ -2636,6 +2778,16 @@
 	s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
 	s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
 
+  # If we are using fort77 (the f2c wrapper) then filter output and delete quotes.
+  *fort77*f2c*gcc*)
+    ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n '
+        /:[	 ]\+Running[	 ]\{1,\}"gcc"/{
+          /"-c"/d
+          /[.]c"*/d
+          s/^.*"gcc"/"gcc"/
+          s/"//gp
+        }'` ;;
+
   # If we are using Cray Fortran then delete quotes.
   *cft90*)
     ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;;
@@ -2709,9 +2861,16 @@
 #        that detects unbalanced quotes in FLIBS should be implemented
 #        and (ugh) tested at some point.
 case $ac_fc_v_output in
-  # If we are using xlf then replace all the commas with spaces.
+  # With xlf replace commas with spaces,
+  # and remove "-link" and closing parenthesis.
   *xlfentry*)
-    ac_fc_v_output=`echo $ac_fc_v_output | sed 's/,/ /g'` ;;
+    ac_fc_v_output=`echo $ac_fc_v_output |
+      sed '
+        s/,/ /g
+        s/ -link / /g
+        s/) *$//
+      '
+    ` ;;
 
   # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted
   # $LIBS confuse us, and the libraries appear later in the output anyway).
@@ -2727,6 +2886,16 @@
 	s/-ignore  *'[^']*'/ /g; s/-ignore  *\"[^\"]*\"/ /g
 	s/-def  *'[^']*'/ /g; s/-def  *\"[^\"]*\"/ /g"` ;;
 
+  # If we are using fort77 (the f2c wrapper) then filter output and delete quotes.
+  *fort77*f2c*gcc*)
+    ac_fc_v_output=`echo "$ac_fc_v_output" | sed -n '
+        /:[	 ]\+Running[	 ]\{1,\}"gcc"/{
+          /"-c"/d
+          /[.]c"*/d
+          s/^.*"gcc"/"gcc"/
+          s/"//gp
+        }'` ;;
+
   # If we are using Cray Fortran then delete quotes.
   *cft90*)
     ac_fc_v_output=`echo $ac_fc_v_output | sed 's/"//g'` ;;
@@ -2785,7 +2954,11 @@
 	  |-LANG:=* | -LIST:* | -LNO:* | -link)
 	  ;;
 	-lkernel32)
-	  test x"$CYGWIN" != xyes && ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+	  case $host_os in
+	  *cygwin*) ;;
+	  *) ac_cv_fc_libs="$ac_cv_fc_libs $ac_arg"
+	    ;;
+	  esac
 	  ;;
 	-[LRuYz])
 	  # These flags, when seen by themselves, take an argument.
@@ -2895,7 +3068,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2935,7 +3108,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2988,7 +3161,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3029,7 +3202,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3087,7 +3260,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3131,7 +3304,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3337,13 +3510,13 @@
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
-    CFLAGS="-g -O1"
+    CFLAGS="-g -O2"
   else
     CFLAGS="-g"
   fi
 else
   if test "$GCC" = yes; then
-    CFLAGS="-O1"
+    CFLAGS="-O2"
   else
     CFLAGS=
   fi
@@ -3359,8 +3532,7 @@
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3809,7 +3981,11 @@
 ac_fcflags_srcext_save=$ac_fcflags_srcext
 ac_fcflags_srcext=
 ac_cv_fc_srcext_f90=unknown
-for ac_flag in none -qsuffix=f=f90 -Tf; do
+case $ac_ext in #(
+  [fF]77) ac_try=f77;; #(
+  *) ac_try=f95;;
+esac
+for ac_flag in none -qsuffix=f=f90 -Tf "-x $ac_try"; do
   test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag"
   cat > conftest.$ac_ext <<_ACEOF
       program main
@@ -3858,7 +4034,7 @@
   ac_cv_fc_freeform=unknown
 ac_fc_freeform_FCFLAGS_save=$FCFLAGS
 for ac_flag in none -ffree-form -FR -free -qfree -Mfree -Mfreeform \
-	       -freeform "-f free" +source=free -nfix
+	       -freeform "-f free" -8 +source=free -nfix --nfix -Free
 do
   test "x$ac_flag" != xnone && FCFLAGS="$ac_fc_freeform_FCFLAGS_save $ac_flag"
   cat > conftest.$ac_ext <<_ACEOF
@@ -3916,7 +4092,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3956,7 +4132,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4009,7 +4185,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4050,7 +4226,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -4108,7 +4284,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4152,7 +4328,7 @@
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4358,13 +4534,13 @@
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
-    CFLAGS="-g -O1"
+    CFLAGS="-g -O2"
   else
     CFLAGS="-g"
   fi
 else
   if test "$GCC" = yes; then
-    CFLAGS="-O1"
+    CFLAGS="-O2"
   else
     CFLAGS=
   fi
@@ -4380,8 +4556,7 @@
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -4634,7 +4809,7 @@
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4700,7 +4875,7 @@
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -4912,7 +5087,6 @@
 
 
 
-
 if test x"$MPIFC" = x; then
     MPIFC=mpif90
 fi
@@ -5672,16 +5846,16 @@
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -5741,29 +5915,17 @@
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
 
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 
@@ -5784,7 +5946,7 @@
 # values after options handling.
 ac_log="
 This file was extended by Specfem3D Globe $as_me 5.1.5, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -5854,10 +6016,10 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Specfem3D Globe config.status 5.1.5
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -5945,7 +6107,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure.ac
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure.ac	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/configure.ac	2013-06-28 16:17:01 UTC (rev 22441)
@@ -13,11 +13,12 @@
 AC_CONFIG_HEADER([setup/config.h])
 AC_CONFIG_MACRO_DIR([m4])
 
+AC_CANONICAL_HOST
 
 # 'configure' options
 
 AC_ARG_ENABLE([double-precision],
-    [AC_HELP_STRING([--enable-double-precision],
+    [AS_HELP_STRING([--enable-double-precision],
         [solver in double precision @<:@default=no@:>@])],
     [want_double_precision="$enableval"],
     [want_double_precision=no])

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/bibliography.bib
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/bibliography.bib	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/bibliography.bib	2013-06-28 16:17:01 UTC (rev 22441)
@@ -1,4 +1,4 @@
-% This file was created with JabRef 2.8.1.
+% This file was created with JabRef 2.9b2.
 % Encoding: UTF-8
 
 @STRING{bssa = {Bull. Seismol. Soc. Am.}}
@@ -220,8 +220,6 @@
   year = {2003},
   pages = {52-72},
   address = {Phoenix, Arizona, USA},
-  month = nov,
-  note = {{G}ordon {B}ell {P}rize winner article},
   doi = {10.1145/1048935.1050202}
 }
 
@@ -1218,11 +1216,12 @@
 	systems},
   booktitle = {SC'11: Proceedings of the 2011 ACM/IEEE conference on Supercomputing},
   year = {2011},
+  series = {SC '11},
   pages = {32:1-32:12},
   address = {Seattle, Washington, USA},
   month = nov,
+  publisher = {ACM},
   note = {Article \#32},
-  articleno = {32},
   doi = {10.1145/2063384.2063427}
 }
 
@@ -1365,6 +1364,15 @@
   pages = {41-46}
 }
 
+ at ARTICLE{BeBoBa06,
+  author = {Berland, J. and Bogey, C. and Bailly, C.},
+  title = {Low-dissipation and low-dispersion fourth-order {Runge-Kutta} algorithm},
+  journal = {Computers and Fluids},
+  year = {2006},
+  volume = {35},
+  pages = {1459-1463}
+}
+
 @INPROCEEDINGS{BeHePrRo06b,
   author = {Alfredo Berm\'udez and Luis Hervella-Nieto and Andr\'es Prieto and
 	Rodolfo Rodr\'{\i}guez},
@@ -1503,6 +1511,16 @@
   pages = {413-423}
 }
 
+ at ARTICLE{BiSy04,
+  author = {B. Biondi and W. Symes},
+  title = {Angle-domain common-image gathers for migration velocity analysis
+	by wavefield-continuation imaging},
+  journal = geophysics,
+  year = {2004},
+  volume = {69},
+  pages = {1283-1298}
+}
+
 @ARTICLE{Biot56a,
   author = {M. A. Biot},
   title = {Theory of propagation of elastic waves in a fluid-saturated porous
@@ -1863,6 +1881,20 @@
   address = {London, United Kingdom}
 }
 
+ at INPROCEEDINGS{BoMaHe91,
+  author = {Bourdel, Fran\c{c}oise and Mazet, Pierre-Alain and Helluy, Philippe},
+  title = {Resolution of the non-stationary or harmonic {M}axwell equations
+	by a discontinuous finite element method: {A}pplication to an {E.M.I.}
+	(electromagnetic impulse) case},
+  booktitle = {Proceedings of the 10th international conference on computing methods
+	in applied sciences and engineering},
+  year = {1991},
+  pages = {405--422},
+  address = {Commack, NY, USA},
+  publisher = {Nova Science Publishers, Inc.},
+  location = {Paris, France}
+}
+
 @ARTICLE{brandvik_pullan_euler_2d,
   author = {Tobias Brandvik and Graham Pullan},
   title = {Acceleration of a two-dimensional {E}uler flow solver using commodity
@@ -2327,9 +2359,11 @@
 	{SPECFEM3D\_GLOBE} on 62 thousand processor cores},
   booktitle = {SC'08: Proceedings of the 2008 ACM/IEEE conference on Supercomputing},
   year = {2008},
-  pages = {1-11},
+  series = {SC '08},
+  pages = {60:1-60:11},
   address = {Austin, Texas, USA},
   month = nov,
+  publisher = {IEEE Press},
   note = {Article \#60, {G}ordon {B}ell {P}rize finalist article},
   doi = {10.1145/1413370.1413432}
 }
@@ -2420,6 +2454,17 @@
   pages = {1704-1713}
 }
 
+ at ARTICLE{CeLeDa11,
+  author = {Cecka, Cris and Lew, Adrian J. and Darve, Eric},
+  title = {Assembly of finite element methods on graphics processors},
+  journal = {International Journal for Numerical Methods in Engineering},
+  year = {2011},
+  volume = {85},
+  pages = {640-669},
+  number = {5},
+  doi = {10.1002/nme.2989}
+}
+
 @ARTICLE{CeMcMcOwQuWr09,
   author = {Elena Celledoni and Robert I. McLachlan and David I. McLaren and
 	Brynjulf Owren and G. Reinout W. Quispel and William M. Wright},
@@ -2773,6 +2818,18 @@
   doi = {10.1111/j.1365-246X.2004.02432.x}
 }
 
+ at ARTICLE{ChMaKo12,
+  author = {S. Chevrot and R. Martin and D. Komatitsch},
+  title = {Optimized discrete wavelet transforms in the cubed sphere with the
+	lifting scheme, implications for global finite-frequency tomography},
+  journal = gji,
+  year = {2012},
+  volume = {191},
+  pages = {1391-1402},
+  number = {3},
+  doi = {10.1111/j.1365-246X.2012.05686.x}
+}
+
 @ARTICLE{ChLi96,
   author = {W. C. Chew and Q. Liu},
   title = {{P}erfectly {M}atched {L}ayers for elastodynamics: a new absorbing
@@ -2829,10 +2886,20 @@
 	{E}arth: asymptotic and non-asymptotic approaches},
   journal = pepi,
   year = {2000},
-  volume = {119(1)},
-  pages = {37-56}
+  volume = {119},
+  pages = {37-56},
+  number = {1}
 }
 
+ at ARTICLE{Cla71,
+  author = {J. F. Claerbout},
+  title = {Toward a unified theory of reflector mapping},
+  journal = geophysics,
+  year = {1971},
+  volume = {36},
+  pages = {467-481}
+}
+
 @ARTICLE{Cla72,
   author = {M. N. Clark},
   title = {Intensity of shaking estimated from displaced stones},
@@ -3440,18 +3507,6 @@
   pages = {520-531}
 }
 
- at ARTICLE{DeSeWh08,
-  author = {De Basabe, J. D. and Sen, M. K. and Wheeler, M. F.},
-  title = {The interior penalty discontinuous {G}alerkin method for elastic
-	wave propagation: grid dispersion},
-  journal = gji,
-  year = {2008},
-  volume = {175},
-  pages = {83-93},
-  number = {1},
-  doi = {10.1111/j.1365-246X.2008.03915.x}
-}
-
 @ARTICLE{DeSe10,
   author = {Jon{\'a}s D. {De Basabe} and Mrinal K. Sen},
   title = {Stability of the high-order finite elements for acoustic or elastic
@@ -3476,6 +3531,18 @@
   doi = {10.1190/1.2785046}
 }
 
+ at ARTICLE{DeSeWh08,
+  author = {De Basabe, J. D. and Sen, M. K. and Wheeler, M. F.},
+  title = {The interior penalty discontinuous {G}alerkin method for elastic
+	wave propagation: grid dispersion},
+  journal = gji,
+  year = {2008},
+  volume = {175},
+  pages = {83-93},
+  number = {1},
+  doi = {10.1111/j.1365-246X.2008.03915.x}
+}
+
 @BOOK{Boo78,
   title = {A practical guide to splines},
   publisher = {Springer-Verlag},
@@ -3495,6 +3562,16 @@
   pages = {253-266}
 }
 
+ at PHDTHESIS{Del07,
+  author = {\'Elise Delavaud},
+  title = {Simulation num\'erique de la propagation d'ondes en milieu g\'eologique
+	complexe : application \`a l'\'evaluation de la r\'eponse sismique
+	du bassin de Caracas (Venezuela)},
+  school = {Institut de Physique du Globe},
+  year = {2007},
+  address = {Paris, France}
+}
+
 @INPROCEEDINGS{DeCuFeVi06,
   author = {E. Delavaud and P. Cupillard and G. Festa and J.-P. Vilotte},
   title = {3{D} Spectral Element Method simulations of the seismic response
@@ -3613,6 +3690,19 @@
   address = {New York}
 }
 
+ at ARTICLE{DhReCaBoGu11,
+  author = {Dhemaied, A. and Rejiba, F. and Camerlynck, C. and Bodet, L. and
+	Gu\'erin, R.},
+  title = {Seismic-Wave Propagation Modeling in Viscoelastic Media Using the
+	{A}uxiliary {D}ifferential {E}quation Method},
+  journal = bssa,
+  year = {2011},
+  volume = {101},
+  pages = {413-420},
+  number = {1},
+  doi = {10.1785/0120100064}
+}
+
 @ARTICLE{DiEz08,
   author = {Julien Diaz and Abdela\^aziz Ezziani},
   title = {Analytical solution for waves propagation in heterogeneous acoustic/porous
@@ -3658,6 +3748,18 @@
   number = {3}
 }
 
+ at ARTICLE{DmLi11,
+  author = {M. N. Dmitriev and V. V. Lisitsa},
+  title = {Application of {M-PML} Reflectionless Boundary Conditions to the
+	Numerical Simulation of Wave Propagation in Anisotropic Media. {P}art
+	{I}: {R}eflectivity},
+  journal = {Sib. Zh. Vych. Mat.},
+  year = {2011},
+  volume = {14},
+  pages = {333-344},
+  number = {4}
+}
+
 @MISC{dobbswebsite,
   author = {Dr. Dobb's},
   month = {March},
@@ -3689,6 +3791,20 @@
   doi = {10.1088/1742-2132/2/3/003}
 }
 
+ at ARTICLE{Dongarra_BLAS_1988,
+  author = {Dongarra, Jack J. and Du Croz, Jeremy and Hammarling, Sven and Hanson,
+	Richard J.},
+  title = {An extended set of {FORTRAN} basic linear algebra subprograms},
+  journal = {ACM Trans. Math. Softw.},
+  year = {1988},
+  volume = {14},
+  pages = {1-17},
+  number = {1},
+  address = {New York, NY, USA},
+  doi = {10.1145/42288.42291},
+  publisher = {ACM}
+}
+
 @ARTICLE{Doornbos83,
   author = {D. J. Doornbos},
   title = {Observable effects of the seismic absorption band in the {E}arth},
@@ -3727,6 +3843,17 @@
   pages = {2123-2133}
 }
 
+ at ARTICLE{DoYiVaTr10,
+  author = {H. Douma and D. Yingst and I. Vasconcelos and J. Tromp},
+  title = {On the connection between artifact filtering in reverse-time migration
+	and adjoint tomography},
+  journal = geophysics,
+  year = {2010},
+  volume = {75},
+  pages = {S219-S223},
+  number = {6}
+}
+
 @PHDTHESIS{Dou94,
   author = {Christophe Doursat},
   title = {Qualit\'es, d\'efauts et am\'eliorations des maillages alg\'ebriques
@@ -3948,8 +4075,8 @@
   journal = pepi,
   year = {1981},
   volume = {25},
-  number = {4},
-  pages = {297-356}
+  pages = {297-356},
+  number = {4}
 }
 
 @ARTICLE{Dziewonski77,
@@ -4412,7 +4539,7 @@
 @ARTICLE{FaKoCaCa11,
   author = {Nathalie Favretto-Cristini and Dimitri Komatitsch and Jos\'e Carcione
 	and Fabio Cavallini},
-  title = {Elastic surface waves in crystals: {P}art {I} : Review of the physics},
+  title = {Elastic surface waves in crystals: {P}art {I}: Review of the physics},
   journal = {Ultrasonics},
   year = {2011},
   volume = {51},
@@ -4494,10 +4621,10 @@
 }
 
 @BOOK{Fic10,
-  author = {Andreas Fichtner},
   title = {Full Seismic Waveform Modelling and Inversion},
   publisher = {Springer Verlag},
   year = {2010},
+  author = {Andreas Fichtner},
   series = {Advances in Geophysical and Environmental Mechanics and Mathematics},
   address = {Heidelberg, Germany}
 }
@@ -4817,6 +4944,17 @@
   pages = {42-63}
 }
 
+ at ARTICLE{GoKoGeRiRaPuRa13,
+  author = {Dominik G\"oddeke and Dimitri Komatitsch and Markus Geveler and Dirk
+	Ribbrock and Nikola Rajovic and Nikola Puzovic and Alex Ramirez},
+  title = {Energy efficiency vs. performance of the numerical solution of {PDE}s:
+	{A}n application study on a low-power {ARM}-based cluster},
+  journal = jcp,
+  year = {2013},
+  note = {in press},
+  doi = {10.1016/j.jcp.2012.11.031}
+}
+
 @ARTICLE{GoStMoMcBuGrTu07,
   author = {Dominik G\"oddeke and Robert Strzodka and Jamaludin Mohd-Yusof and
 	Patrick McCormick and Sven H. M. Buijssen and Matthias Grajewski
@@ -5106,9 +5244,7 @@
   year = {2009},
   volume = {79},
   pages = {1309-1331},
-  number = {11},
-  owner = {komatits},
-  timestamp = {2011.01.23}
+  number = {11}
 }
 
 @ARTICLE{gilbert1970,
@@ -6647,6 +6783,18 @@
   pages = {363-387}
 }
 
+ at ARTICLE{JoPi86,
+  author = {C. Johnson and J. Pitk\"aranta},
+  title = {An analysis of the discontinuous {G}alerkin method for a scalar hyperbolic
+	equation},
+  journal = {Math. Comp.},
+  year = {1986},
+  volume = {46},
+  pages = {1-26},
+  doi = {10.1090/S0025-5718-1986-0815828-4},
+  quality = {1}
+}
+
 @TECHREPORT{Jol95,
   author = {P. Joly},
   title = {R\'esolution de l'\'equation de {B}urgers par paquets d'ondelettes},
@@ -6960,15 +7108,6 @@
   pages = {108-124}
 }
 
- at ARTICLE{MoKe95,
-  author = {J. P. Montagner and B. L. N. Kennett},
-  title = {How to reconcile body-wave and normal-mode reference {E}arth models?},
-  journal = gji,
-  year = {1995},
-  volume = {122},
-  pages = {229-248}
-}
-
 @ARTICLE{KhBoEn12,
   author = {Khan, Samee and Bouvry, Pascal and Engel, Thomas},
   title = {Energy-efficient high-performance parallel and distributed computing},
@@ -7237,7 +7376,7 @@
 @ARTICLE{KoCaCaFa11,
   author = {Dimitri Komatitsch and Jos\'e Carcione and Fabio Cavallini and Nathalie
 	Favretto-Cristini},
-  title = {Elastic surface waves in crystals: {P}art {II} : Cross-check of two
+  title = {Elastic surface waves in crystals: {P}art {II}: Cross-check of two
 	full-wave numerical modeling methods},
   journal = {Ultrasonics},
   year = {2011},
@@ -7421,10 +7560,12 @@
 	on a large {B}eowulf},
   booktitle = {SC'01: Proceedings of the 2001 ACM/IEEE conference on Supercomputing},
   year = {2001},
-  pages = {33-41},
+  series = {Supercomputing '01},
+  pages = {42-50},
   address = {Denver, Colorado, USA},
   month = nov,
-  doi = {10.1109/SC.2001.10003}
+  publisher = {ACM},
+  doi = {10.1145/582034.582076}
 }
 
 @ARTICLE{KoTr01d,
@@ -7454,11 +7595,13 @@
 	simulation on the {E}arth~{S}imulator},
   booktitle = {SC'03: Proceedings of the 2003 ACM/IEEE conference on Supercomputing},
   year = {2003},
+  series = {SC '03},
   pages = {4-11},
   address = {Phoenix, Arizona, USA},
   month = nov,
+  publisher = {ACM},
   note = {{G}ordon {B}ell {P}rize winner article},
-  doi = {10.1109/SC.2003.10023}
+  doi = {10.1145/1048935.1050155}
 }
 
 @INCOLLECTION{KoTsTr05,
@@ -7720,6 +7863,17 @@
   number = {3}
 }
 
+ at ARTICLE{KrDu13,
+  author = {Kreiss, Gunilla and Duru, Kenneth},
+  title = {Discrete stability of perfectly matched layers for anisotropic wave
+	equations in first and second order formulation},
+  journal = {BIT Numerical Mathematics},
+  year = {2013},
+  pages = {1-23},
+  doi = {10.1007/s10543-013-0426-4},
+  publisher = {Springer Netherlands}
+}
+
 @ARTICLE{Kre06,
   author = {Steen Krenk},
   title = {Energy conservation in {N}ewmark based time integration algorithms},
@@ -7866,6 +8020,18 @@
   number = {12}
 }
 
+ at ARTICLE{LaHu10,
+  author = {L\"{a}hivaara, T. and Huttunen, T.},
+  title = {A non-uniform basis order for the discontinuous {G}alerkin method
+	of the {3D} dissipative wave equation with perfectly matched layer},
+  journal = jcp,
+  year = {2010},
+  volume = {229},
+  pages = {5144-5160},
+  number = {13},
+  doi = {10.1016/j.jcp.2010.03.030}
+}
+
 @ARTICLE{LaMaQu97,
   author = {D. J. P. Lahaye and F. Maggio and A. Quarteroni},
   title = {Hybrid finite element-spectral element approximation of wave propagation
@@ -7877,6 +8043,17 @@
   number = {4}
 }
 
+ at INPROCEEDINGS{Lai83,
+  author = {P. Lailly},
+  title = {The seismic inverse problem as a sequence of before-stack migrations},
+  booktitle = {Proceedings of the Conference on Inverse Scattering, Theory and Application
+	Expanded Abstracts},
+  year = {1983},
+  pages = {206-220},
+  address = {Philadelphia, USA},
+  publisher = {Society of Industrial and Applied Mathematics}
+}
+
 @ARTICLE{Lak87,
   author = {R. Lakes},
   title = {Foam structures with a negative {P}oisson's ratio},
@@ -8085,6 +8262,20 @@
   year = {2001}
 }
 
+ at INPROCEEDINGS{LeRa74,
+  author = {P. Lesaint and P. A. Raviart},
+  title = {On a finite element method for solving the neutron transport equation
+	({P}roc. {S}ymposium, {M}athematical {R}esearch {C}enter)},
+  booktitle = {Mathematical aspects of finite elements in partial differential equations},
+  year = {1974},
+  editor = {Univ. of Wisconsin-Madison},
+  volume = {33},
+  pages = {89-123},
+  address = {New York, USA},
+  publisher = {Academic Press},
+  quality = {1}
+}
+
 @BOOK{Les97,
   title = {Turbulence in fluids},
   publisher = {Kluwer Academic Publishers},
@@ -9129,6 +9320,17 @@
   pages = {1399-1414}
 }
 
+ at ARTICLE{MeStTh12,
+  author = {Melvin, Thomas and Staniforth, Andrew and Thuburn, John},
+  title = {Dispersion analysis of the spectral element method},
+  journal = {Quarterly Journal of the Royal Meteorological Society},
+  year = {2012},
+  volume = {138},
+  pages = {1934--1947},
+  number = {668},
+  doi = {10.1002/qj.1906}
+}
+
 @ARTICLE{MeViSa06,
   author = {E. D. Mercerat and J. P. Vilotte and F. J. S\'anchez-Sesma},
   title = {Triangular spectral-element simulation of two-dimensional elastic
@@ -9404,6 +9606,25 @@
   pages = {223-256}
 }
 
+ at ARTICLE{MoKe95,
+  author = {J. P. Montagner and B. L. N. Kennett},
+  title = {How to reconcile body-wave and normal-mode reference {E}arth models?},
+  journal = gji,
+  year = {1995},
+  volume = {122},
+  pages = {229-248}
+}
+
+ at ARTICLE{MoChKoFu13,
+  author = {Vadim Monteiller and S\'ebastien Chevrot and Dimitri Komatitsch and
+	Nobuaki Fuji},
+  title = {A hybrid method to compute short period synthetic seismograms of
+	teleseismic body waves in a 3-{D} regional model},
+  journal = gji,
+  year = {2013},
+  note = {in press}
+}
+
 @ARTICLE{boutet,
   author = {L. Boutet de Monvel and P. Kr\'ee},
   title = {Pseudo-differential operators and {G}evrey classes},
@@ -10000,7 +10221,7 @@
   publisher = {Morgan Kaufmann Press},
   year = {1997},
   author = {P. S. Pacheco},
-  address = {San Francisco}
+  address = {San Francisco, USA}
 }
 
 @ARTICLE{Page1995,
@@ -10691,6 +10912,18 @@
   pages = {2005-2008}
 }
 
+ at ARTICLE{RaGiHaBi13,
+  author = {Rabinovich, Daniel and Givoli, Dan and Hagstrom, Thomas and Bielak,
+	Jacobo},
+  title = {Stress-velocity complete radiation boundary conditions},
+  journal = jca,
+  year = {2013},
+  volume = {21},
+  pages = {1350003-1--1350003-38},
+  number = {2},
+  doi = {10.1142/S0218396X13500033}
+}
+
 @ARTICLE{RaNaLi09,
   author = {Nikunj Raghuvanshi and Rahul Narain and Ming C. Lin},
   title = {Efficient and Accurate Sound Propagation Using Adaptive Rectangular
@@ -11236,6 +11469,16 @@
   number = {4}
 }
 
+ at ARTICLE{RyJi04,
+  author = {Thomas Rylander and Jian-Ming Jin},
+  title = {Perfectly matched layer for the time domain finite element method},
+  journal = jcp,
+  year = {2004},
+  volume = {200},
+  pages = {238-250},
+  doi = {10.1016/j.jcp.2004.03.016}
+}
+
 @ARTICLE{RyLe83,
   author = {G. Ryskin and L. G. Leal},
   title = {Orthogonal mapping},
@@ -11883,6 +12126,15 @@
   publisher = {SEG}
 }
 
+ at ARTICLE{Smi74,
+  author = {Warwick D. Smith},
+  title = {A Nonreflecting Plane Boundary for Wave Propagation Problems},
+  journal = jcp,
+  year = {1974},
+  volume = {15},
+  pages = {492-503}
+}
+
 @ARTICLE{Soa09,
   author = {Soares Jr., Delfim},
   title = {Acoustic modelling by {BEM-FEM} coupling procedures taking into account
@@ -12276,7 +12528,7 @@
 @ARTICLE{TaCo87,
   author = {O. Talagrand and P. Courtier},
   title = {Variational assimilation of meteorological observations with the
-	adjoint vorticity equation. I: Theory},
+	adjoint vorticity equation. {I: T}heory},
   journal = {Q. J. R. Meteorol. Soc.},
   year = {1987},
   volume = {113},
@@ -12314,6 +12566,14 @@
   doi = {10.1111/j.1365-246X.2006.03191.x}
 }
 
+ at BOOK{Tarantola2005,
+  title = {Inverse problem theory and methods for model parameter estimation},
+  publisher = {Society for Industrial andApplied Mathematics},
+  year = {2005},
+  author = {A. Tarantola},
+  address = {Philadelphia, Pennsylvania, USA}
+}
+
 @ARTICLE{Tar88,
   author = {A. Tarantola},
   title = {Theoretical background for the inversion of seismic waveforms, including
@@ -13396,6 +13656,17 @@
   pages = {120-134}
 }
 
+ at ARTICLE{WaLeTe06,
+  author = {Shumin Wang and Robert Lee and Fernando L. Teixeira},
+  title = {Anisotropic-medium {PML} for vector {FETD} with modified basis functions},
+  journal = {IEEE Transactions on Antennas and Propagation},
+  year = {2006},
+  volume = {54},
+  pages = {20-27},
+  number = {1},
+  doi = {10.1109/TAP.2005.861523}
+}
+
 @ARTICLE{WaTa03,
   author = {Tsili Wang and Xiaoming Tang},
   title = {Finite-difference modeling of elastic wave propagation: A nonsplitting
@@ -13924,6 +14195,15 @@
   pages = {558-576}
 }
 
+ at ARTICLE{zhu2009,
+  author = {H. Zhu and Y. Luo and T. Nissem-Meyer and C. Morency and J. Tromp},
+  title = {Elastic imaging and time-lapse migration based on adjoint methods},
+  journal = geophysics,
+  year = {2009},
+  volume = {74},
+  pages = {WCA167-WCA177}
+}
+
 @ARTICLE{zhu&kanamori2000,
   author = {L. Zhu and H. Kanamori},
   title = {Moho depth variation in southern {C}alifornia from teleseismic receiver
@@ -14047,35 +14327,3 @@
 	less than plus or minus one~second}
 }
 
- at ARTICLE{RyJi04,
-  author = {Thomas Rylander and Jian-Ming Jin},
-  title = {Perfectly matched layer for the time domain finite element method},
-  journal = jcp,
-  year = {2004},
-  volume = {200},
-  pages = {238-250},
-  doi = {10.1016/j.jcp.2004.03.016}
-}
-
- at ARTICLE{WaLeTe06,
-  author = {Shumin Wang and Robert Lee and Fernando L. Teixeira},
-  journal = {IEEE Transactions on Antennas and Propagation},
-  title = {Anisotropic-medium {PML} for vector {FETD} with modified basis functions},
-  year = {2006},
-  volume = {54},
-  number = {1},
-  pages = {20-27},
-  doi = {10.1109/TAP.2005.861523}
-}
-
- at article{LaHu10,
- author = {L\"{a}hivaara, T. and Huttunen, T.},
- title = {A non-uniform basis order for the discontinuous {G}alerkin method of the {3D} dissipative wave equation with perfectly matched layer},
- journal = jcp,
- volume = {229},
- number = {13},
- year = {2010},
- pages = {5144-5160},
- doi = {10.1016/j.jcp.2010.03.030}
-} 
-

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.pdf
===================================================================
(Binary files differ)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex	2013-06-28 16:17:01 UTC (rev 22441)
@@ -154,10 +154,10 @@
 global and regional seismic wave propagation based upon the spectral-element method (SEM).
 The SEM is a continuous Galerkin technique \citep{TrKoLi08,PeKoLuMaLeCaLeMaLiBlNiBaTr11},
 which can easily be made discontinous \citep{BeMaPa94,Ch00,KoWoHu02,ChCaVi03,LaWaBe05,Kop06,WiStBuGh10,AcKo11};
-it is then close to a particular case of the discontinuous Galerkin technique \citep{ReHi73,Arn82,FaRi99,HuHuRa99,CoKaSh00,GiHeWa02,RiWh03,MoRi05,GrScSc06,AiMoMu06,BeLaPi06,DuKa06,DeSeWh08,PuAmKa09,WiStBuGh10,DeSe10,EtChViGl10}, with optimized efficiency because of its tensorized basis functions \citep{WiStBuGh10,AcKo11}.
+it is then close to a particular case of the discontinuous Galerkin technique \citep{ReHi73,LeRa74,Arn82,JoPi86,BoMaHe91,FaRi99,HuHuRa99,CoKaSh00,GiHeWa02,RiWh03,MoRi05,GrScSc06,AiMoMu06,BeLaPi06,DuKa06,DeSeWh08,PuAmKa09,WiStBuGh10,DeSe10,EtChViGl10}, with optimized efficiency because of its tensorized basis functions \citep{WiStBuGh10,AcKo11}.
 In particular, it can accurately handle very distorted mesh elements \citep{OlSe11}.\\
 
-It has very good accuracy and convergence properties \citep{MaPa89,SePr94,DeFiMu02,Coh02,DeSe07,SeOl08}.
+It has very good accuracy and convergence properties \citep{MaPa89,SePr94,DeFiMu02,Coh02,DeSe07,SeOl08,MeStTh12}.
 The spectral element approach admits spectral rates of convergence and allows exploiting $hp$-convergence schemes.
 It is also very well suited to parallel implementation on very large supercomputers \citep{KoTsChTr03,TsKoChTr03,KoLaMi08a,CaKoLaTiMiLeSnTr08,KoViCh10} as well as on clusters of GPU accelerating graphics cards \citep{KoMiEr09,KoErGoMi10,Kom11}. Tensor products inside each element can be optimized to reach very high efficiency \citep{DeFiMu02}, and mesh point and element numbering can be optimized to reduce processor cache misses and improve cache reuse \citep{KoLaMi08a}. The SEM can also handle triangular (in 2D) or tetrahedral (in 3D) elements \citep{WinBoyd96,TaWi00,KoMaTrTaWi01,Coh02,MeViSa06} as well as mixed meshes, although with increased cost and reduced accuracy in these elements, as in the discontinuous Galerkin method.\\
 
@@ -170,7 +170,7 @@
 For a detailed introduction to the SEM as applied to
 global and regional seismic wave propagation, please consult \citet{TrKoLi08,PeKoLuMaLeCaLeMaLiBlNiBaTr11,KoVi98,KoTr99,Ch00,KoTr02a,KoTr02b,KoRiTr02,ChCaVi03,CaChViMo03,ChVa04,ChKoViCaVaFe07}.
 A detailed theoretical analysis of the dispersion
-and stability properties of the SEM is available in \citet{Coh02}, \citet{DeSe07}, \citet{SeOl07} and \citet{SeOl08}.\\
+and stability properties of the SEM is available in \citet{Coh02}, \citet{DeSe07}, \citet{SeOl07}, \citet{SeOl08} and \citet{MeStTh12}.\\
 
 Effects due to lateral variations in compressional-wave
 speed, shear-wave speed, density, a 3D crustal model, ellipticity,
@@ -254,7 +254,8 @@
 shell script. This script will attempt to guess the appropriate configuration
 values for your system. However, at a minimum, it is recommended that
 you explicitly specify the appropriate command names for your Fortran
-compiler and MPI package:
+compiler and MPI package (another option is to define FC, CC and MPIF90 in your .bash\_profile
+or your .cshrc file):
 
 \begin{lyxcode}
 ./configure~FC=ifort~MPIFC=mpif90
@@ -266,8 +267,6 @@
 \item [{\texttt{Intel ifort compiler}}] See if you need to add \texttt{-assume byterecl} for your machine.
 \item [{\texttt{IBM compiler}}] See if you need to add \texttt{-qsave} or \texttt{-qnosave} for your machine.
 \item [{\texttt{Mac OS}}] You will probably need to install \texttt{XCODE}.
-In addition, the \texttt{clock\_gettime} routine, which is used by the \texttt{SCOTCH} library that we use, does not exist in Mac OS.
-You will need to replace it with \texttt{clock\_get\_time} if you want to use \texttt{SCOTCH}.
 \end{description}
 
 When compiling on an IBM machine with the \texttt{xlf} and \texttt{xlc} compilers, we suggest running the \texttt{configure} script
@@ -600,7 +599,7 @@
 
 \begin{description}
 \item [{\texttt{SIMULATION\_TYPE}}] is set to 1 for forward simulations,
-2 for adjoint simulations for sources (see Section \ref{sec:Adjoint-simulation-finite})
+2 for adjoint simulations for sources (see Section \ref{sec:Adjoint-simulation-sources})
 and 3 for kernel simulations (see Section \ref{sec:Finite-Frequency-Kernels}).
 \item [{\texttt{SAVE\_FORWARD}}] is only set to \texttt{.true.} for a forward
 simulation with the last frame of the simulation saved, as part of
@@ -1393,14 +1392,15 @@
 \noindent \begin{centering}
 \includegraphics[width=3in]{figures/gauss_vs_triangle_mod}
 \par\end{centering}
-
-\caption{Comparison of the shape of a triangle and the Gaussian function actually
-used.}
-
-
+\caption{Comparison of the shape of a triangle and the Gaussian function actually used.}
 \label{fig:gauss.vs.triangle}
 \end{figure}
 
+If you know the earthquake source in strike/dip/rake format rather than in \texttt{CMTSOLUTION} format,
+use the C code \texttt{utils/strike\_dip\_rake\_to\_CMTSOLUTION.c} to convert it.
+The conversion formulas are given for instance in \cite{AkRi80}.
+Note that the \cite{AkRi80} convention is slightly different from the Harvard \texttt{CMTSOLUTION} convention
+(the sign of some components is different). The C code outputs both.
 
 Centroid latitude and longitude should be provided in geographical
 coordinates. The code converts these coordinates to geocentric coordinates~\citep{DaTr98}.
@@ -2483,14 +2483,24 @@
 \begin{lyxcode}
 {\footnotesize make~combine\_vol\_data~}{\footnotesize \par}
 
-{\footnotesize ./bin/xcombine\_vol\_data}~{\footnotesize slice\_list}~{\footnotesize filename}~{\footnotesize input\_dir}~{\footnotesize output\_dir}~{\footnotesize high/low-resolution}~{\footnotesize {[}region]}{\footnotesize \par}
+{\footnotesize ./bin/xcombine\_vol\_data}~{\footnotesize slice\_list}~{\footnotesize kernel\_filename}~
+{\footnotesize input\_topo\_dir}~
+{\footnotesize input\_file\_dir}~{\footnotesize output\_dir}
+
+{\footnotesize low/high-resolution-flag-0-or-1}~{\footnotesize {[}region]}{\footnotesize \par}
 \end{lyxcode}
 where \texttt{input\_dir} is the directory where all the individual
 kernel files are stored, and \texttt{output\_dir} is where the mesh
-file will be written.
+file will be written. Give 0 for low resolution and 1 for high resolution.
+If region is not specified, all three regions (crust and mantle, outer core, inner core)
+will be collected, otherwise, only the specified region will be.
+Here is an example: 
+\texttt{./xcombine\_vol\_data slices\_major alpha\_kernel input\_topo\_dir}
+\texttt{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~input\_file\_dir output\_dir 1}
 
 \begin{lyxcode}
-{\footnotesize ./bin/xcombine\_surf\_data~slice\_list~filename~surfname~input\_dir~output\_dir~hi~gh/low-resolution~2D/3D}{\footnotesize \par}
+{\footnotesize ./bin/xcombine\_surf\_data~slice\_list~filename~surfname~input\_dir~output\_dir}
+{\footnotesize ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~low/high-resolution~2D/3D}{\footnotesize \par}
 \end{lyxcode}
 where \texttt{surfname} should correspond to the specific kernel file
 name, and can be chosen from \texttt{Moho}, \texttt{400}, \texttt{670},

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/doc/time_scheme_we_use_in_the_code_from_Hughes_1987.pdf
===================================================================
(Binary files differ)

Copied: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/install-sh (from rev 22440, seismo/3D/SPECFEM3D_GLOBE/trunk/install-sh)
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/install-sh	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/install-sh	2013-06-28 16:17:01 UTC (rev 22441)
@@ -0,0 +1,2 @@
+# This file is empty. We don't use AC_PROG_INSTALL, but configure erroneously
+# uses this file to check for config.{guess,sub} and other auxiliary files.

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/setup/constants.h.in	2013-06-28 16:17:01 UTC (rev 22441)
@@ -213,8 +213,9 @@
 ! was found by trial and error
   double precision, parameter :: SOURCE_DECAY_MIMIC_TRIANGLE = 1.628d0
 
-! maximum number of sources to locate simultaneously
+! maximum number of sources and receivers to locate simultaneously
   integer, parameter :: NSOURCES_SUBSET_MAX = 100
+  integer, parameter :: NREC_SUBSET_MAX = 200
 
 ! use a force source located exactly at a grid point instead of a CMTSOLUTION source
 ! this can be useful e.g. for asteroid impact simulations

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/meshfem3D.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/meshfem3D.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/meshfem3D.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -865,7 +865,7 @@
                     NGLOB_INNER_CORE_ADJOINT,NSPEC_OUTER_CORE_ROT_ADJOINT, &
                     NSPEC_CRUST_MANTLE_STACEY,NSPEC_OUTER_CORE_STACEY, &
                     NGLOB_CRUST_MANTLE_OCEANS,NSPEC_OUTER_CORE_ROTATION, &
-                    SIMULATION_TYPE,SAVE_FORWARD,MOVIE_VOLUME,NOISE_TOMOGRAPHY)
+                    SIMULATION_TYPE,SAVE_FORWARD,MOVIE_VOLUME)
 
   endif   ! end of section executed by main process only
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_aniso_mantle.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_aniso_mantle.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_aniso_mantle.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -383,7 +383,7 @@
   type (model_aniso_mantle_variables) AMM_V
 ! model_aniso_mantle_variables
 
-  integer nx,ny,np1,np2,ipar,ipa1,ipa,ilat,ilon,il,idep,nfin,nfi0,nf,nri
+  integer ier,nx,ny,np1,np2,ipar,ipa1,ipa,ilat,ilon,il,idep,nfin,nfi0,nf,nri
   double precision xinf,yinf,pxy,ppp,angle,A,A2L,AL,af
   double precision ra(47),pari(14,47)
   double precision bet2(14,34,37,73)
@@ -398,7 +398,11 @@
 ! glob-prem3sm01: model with rho,A,L,xi-1,1-phi,eta
 !
   call get_value_string(glob_prem3sm01, 'model.glob_prem3sm01', 'DATA/Montagner_model/glob-prem3sm01')
-  open(19,file=glob_prem3sm01,status='old',action='read')
+  open(19,file=glob_prem3sm01,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(glob_prem3sm01), '": ', ier
+    call exit_MPI(0, 'error model aniso mantle')
+  endif
 
 !
 ! read the models
@@ -459,7 +463,11 @@
 ! normalized, in percents: 100 G/L
 !
   call get_value_string(globpreman3sm01, 'model.globpreman3sm01', 'DATA/Montagner_model/globpreman3sm01')
-  open(unit=15,file=globpreman3sm01,status='old',action='read')
+  open(unit=15,file=globpreman3sm01,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(globpreman3sm01), '": ', ier
+    call exit_MPI(0, 'error model aniso mantle')
+  endif
 
   do nf = 7,nfin,2
     ipa = nf
@@ -539,12 +547,14 @@
 
   implicit none
 
+  include "constants.h"
+
 ! read the reference Earth model: rho, Vph, Vsv, XI, PHI, ETA
 ! array par(i,nlayer)
 ! output: array pari(ipar, nlayer): rho, A, L, xi-1, phi-1, eta-1
 
   integer i,j,k,ip,ifanis,idum1,idum2,idum3,nlayer,nout,neff,&
-          nband,nri,minlay,moho,kiti
+          nband,nri,minlay,moho,kiti,ier
   double precision pari(14,47),qkappa(47),qshear(47),par(6,47)
   double precision epa(14,47),ra(47),dcori(47),ri(47)
   double precision corpar(21,47)
@@ -552,59 +562,88 @@
   character(len=80) null
   character(len=150) Adrem119
 
-     ifanis = 1
-     nri = 47
+  ifanis = 1
+  nri = 47
 
-     call get_value_string(Adrem119, 'model.Adrem119', 'DATA/Montagner_model/Adrem119')
-     open(unit=13,file=Adrem119,status='old',action='read')
-     read(13,*,end = 77) nlayer,minlay,moho,nout,neff,nband,kiti,null
+  call get_value_string(Adrem119, 'model.Adrem119', 'DATA/Montagner_model/Adrem119')
+  open(unit=13,file=Adrem119,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(Adrem119), '": ', ier
+    call exit_MPI(0, 'error model aniso mantle')
+  endif
 
-     if(kiti == 0) read(13,"(20a4)",end = 77) idum1
-     read(13,"(20a4)",end = 77) idum2
-     read(13,"(20a4)",end = 77) idum3
+  read(13,*,iostat=ier) nlayer,minlay,moho,nout,neff,nband,kiti,null
+  if (ier /= 0) then
+    close(13)
+    return
+  endif
 
-     do i = 1,nlayer
-       read(13,"(4x,f11.1,8d12.5)",end = 77) ra(i),(par(k,i),k = 1,6),qshear(i),qkappa(i)
-     enddo
+  if (kiti == 0) then
+    read(13,"(20a4)",iostat=ier) idum1
+    if (ier /= 0) then
+      close(13)
+      return
+    endif
+  endif
+  read(13,"(20a4)",iostat=ier) idum2
+  if (ier /= 0) then
+    close(13)
+    return
+  endif
+  read(13,"(20a4)",iostat=ier) idum3
+  if (ier /= 0) then
+    close(13)
+    return
+  endif
 
-     do i = 1,nlayer
-       ri(i) = 0.001*ra(i)
-     enddo
+  do i = 1,nlayer
+    read(13,"(4x,f11.1,8d12.5)",iostat=ier) ra(i),(par(k,i),k = 1,6),qshear(i),qkappa(i)
+    if (ier /= 0) then
+      close(13)
+      return
+    endif
+  enddo
 
-     do i = 1,nlayer
-       rho = par(1,i)
-       pari(1,i) = rho
-!    A : pari(2,i)
-       pari(2,i) = rho*(par(2,i)**2)
-       aa = pari(2,i)
-!    L : pari(3,i)
-       pari(3,i) = rho*(par(3,i)**2)
-       al = pari(3,i)
-!    Xi : pari(4,i)= (N-L)/L
-       an = al*par(4,i)
-       pari(4,i) = 0.
-       pari(4,i) = par(4,i) - 1.
-!    Phi : pari(5,i)=(a-c)/a
-       pari(5,i) = - par(5,i) + 1.
-       ac = par(5,i)*aa
-!    f : pari(4,i)
-       af = par(6,i)*(aa - 2.*al)
-       pari(6,i) = par(6,i)
-       do ip = 7,14
-         pari(ip,i) = 0.
-       enddo
-       vsv = 0.
-       vsh = 0.
-       if(al < 0.0001 .or. an < 0.0001) goto 12
-       vsv = dsqrt(al/rho)
-       vsh = dsqrt(an/rho)
- 12    vpv = dsqrt(ac/rho)
-       vph = dsqrt(aa/rho)
-     enddo
+  do i = 1,nlayer
+    ri(i) = 0.001*ra(i)
+  enddo
 
+  do i = 1,nlayer
+    rho = par(1,i)
+    pari(1,i) = rho
+! A : pari(2,i)
+    pari(2,i) = rho*(par(2,i)**2)
+    aa = pari(2,i)
+! L : pari(3,i)
+    pari(3,i) = rho*(par(3,i)**2)
+    al = pari(3,i)
+! Xi : pari(4,i)= (N-L)/L
+    an = al*par(4,i)
+    pari(4,i) = 0.
+    pari(4,i) = par(4,i) - 1.
+! Phi : pari(5,i)=(a-c)/a
+    pari(5,i) = - par(5,i) + 1.
+    ac = par(5,i)*aa
+! f : pari(4,i)
+    af = par(6,i)*(aa - 2.*al)
+    pari(6,i) = par(6,i)
+    do ip = 7,14
+      pari(ip,i) = 0.
+    enddo
+    vsv = 0.
+    vsh = 0.
+    if (al >= 0.0001 .and. an >= 0.0001) then
+      vsv = dsqrt(al/rho)
+      vsh = dsqrt(an/rho)
+    endif
+    vpv = dsqrt(ac/rho)
+    vph = dsqrt(aa/rho)
+  enddo
+
   red = 1.
   do i = 1,nlayer
-    read(13,"(15x,6e12.5,f11.1)",end = 77) (epa(j,i),j = 1,6),dcori(i)
+    read(13,"(15x,6e12.5,f11.1)",iostat=ier) (epa(j,i),j = 1,6),dcori(i)
+    if (ier /= 0) exit
     epa(7,i) = epa(2,i)
     epa(8,i) = epa(2,i)
     epa(9,i) = epa(3,i)
@@ -620,11 +659,11 @@
       epa(j,i) = red*epa(j,i)
     enddo
 
-    read(13,"(21f7.3)",end = 77) (corpar(j,i),j = 1,21)
-
+    read(13,"(21f7.3)",iostat=ier) (corpar(j,i),j = 1,21)
+    if (ier /= 0) exit
   enddo
 
-77 close(13)
+  close(13)
 
   end subroutine lecmod
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_atten3D_QRFSI12.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_atten3D_QRFSI12.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_atten3D_QRFSI12.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -102,7 +102,7 @@
 ! three_d_model_atten3D_QRFSI12_variables
 
   integer j,k,l,m
-  integer index,ll,mm
+  integer index,ll,mm,ier
   double precision v1,v2
 
   character(len=150) QRFSI12,QRFSI12_ref
@@ -113,7 +113,12 @@
   QRFSI12_ref='DATA/QRFSI12/ref_QRFSI12'
 
 ! get the dq model coefficients
-  open(unit=10,file=QRFSI12,status='old',action='read')
+  open(unit=10,file=QRFSI12,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(QRFSI12), '": ', ier
+    call exit_MPI(0, 'error model QRFSI12')
+  endif
+
   do k=1,NKQ
     read(10,*)index
     j=0
@@ -146,7 +151,12 @@
   QRFSI12_Q%spknt(8) = 650.0
 
 ! get the depths and 1/Q values of the reference model
-  open(11,file=QRFSI12_ref,status='old',action='read')
+  open(11,file=QRFSI12_ref,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(QRFSI12_ref), '": ', ier
+    call exit_MPI(0, 'error model QRFSI12')
+  endif
+
   do j=1,NDEPTHS_REFQ
     read(11,*)QRFSI12_Q%refdepth(j),QRFSI12_Q%refqmu(j)
   enddo

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crust.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crust.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crust.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -208,7 +208,7 @@
 ! model_crust_variables
 
 ! local variables
-  integer i
+  integer i,ier
   integer ila,icolat
   integer ikey
 
@@ -219,13 +219,23 @@
   call get_value_string(CNtype2, 'model.CNtype2', 'DATA/crust2.0/CNtype2.txt')
   call get_value_string(CNtype2_key_modif, 'model.CNtype2_key_modif', 'DATA/crust2.0/CNtype2_key_modif.txt')
 
-  open(unit=1,file=CNtype2,status='old',action='read')
+  open(unit=1,file=CNtype2,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(CNtype2), '": ', ier
+    call exit_MPI(0, 'error model crust2.0')
+  endif
+
   do ila=1,NCAP_CRUST/2
     read(1,*) icolat,(CM_V%abbreviation(ila,i),i=1,NCAP_CRUST)
   enddo
   close(1)
 
-  open(unit=1,file=CNtype2_key_modif,status='old',action='read')
+  open(unit=1,file=CNtype2_key_modif,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(CNtype2_key_modif), '": ', ier
+    call exit_MPI(0, 'error model crust2.0')
+  endif
+
   h_moho_min=HUGEVAL
   h_moho_max=-HUGEVAL
   do ikey=1,NKEYS_CRUST

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crustmaps.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crustmaps.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_crustmaps.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -147,168 +147,16 @@
   type (model_crustmaps_variables) GC_V
   !model_crustmaps_variables
 
+  integer i,l
 
-
-  integer ila,iln,i,l
-
-  character(len=150)           eucrustt3,eucrustt4,eucrustt5,eucrustt6,eucrustt7,&
-                               eucrustr3,eucrustr4,eucrustr5,eucrustr6,eucrustr7,&
-                               eucrustp3,eucrustp4,eucrustp5,eucrustp6,eucrustp7,&
-                               eucrusts3,eucrusts4,eucrusts5,eucrusts6,eucrusts7
-
-!Matthias Meschede
-  call get_value_string(eucrustt3, 'model.eucrustt3','DATA/crustmap/eucrustt3.cmap')
-  call get_value_string(eucrustt4, 'model.eucrustt4','DATA/crustmap/eucrustt4.cmap')
-  call get_value_string(eucrustt5, 'model.eucrustt5','DATA/crustmap/eucrustt5.cmap')
-  call get_value_string(eucrustt6, 'model.eucrustt6','DATA/crustmap/eucrustt6.cmap')
-  call get_value_string(eucrustt7, 'model.eucrustt7','DATA/crustmap/eucrustt7.cmap')
-
-  call get_value_string(eucrustr3, 'model.eucrustr3','DATA/crustmap/eucrustr3.cmap')
-  call get_value_string(eucrustr4, 'model.eucrustr4','DATA/crustmap/eucrustr4.cmap')
-  call get_value_string(eucrustr5, 'model.eucrustr5','DATA/crustmap/eucrustr5.cmap')
-  call get_value_string(eucrustr6, 'model.eucrustr6','DATA/crustmap/eucrustr6.cmap')
-  call get_value_string(eucrustr7, 'model.eucrustr7','DATA/crustmap/eucrustr7.cmap')
-
-  call get_value_string(eucrustp3, 'model.eucrustp3','DATA/crustmap/eucrustp3.cmap')
-  call get_value_string(eucrustp4, 'model.eucrustp4','DATA/crustmap/eucrustp4.cmap')
-  call get_value_string(eucrustp5, 'model.eucrustp5','DATA/crustmap/eucrustp5.cmap')
-  call get_value_string(eucrustp6, 'model.eucrustp6','DATA/crustmap/eucrustp6.cmap')
-  call get_value_string(eucrustp7, 'model.eucrustp7','DATA/crustmap/eucrustp7.cmap')
-
-  call get_value_string(eucrusts3, 'model.eucrusts3','DATA/crustmap/eucrusts3.cmap')
-  call get_value_string(eucrusts4, 'model.eucrusts4','DATA/crustmap/eucrusts4.cmap')
-  call get_value_string(eucrusts5, 'model.eucrusts5','DATA/crustmap/eucrusts5.cmap')
-  call get_value_string(eucrusts6, 'model.eucrusts6','DATA/crustmap/eucrusts6.cmap')
-  call get_value_string(eucrusts7, 'model.eucrusts7','DATA/crustmap/eucrusts7.cmap')
-
-
-
-  open(unit=1,file=eucrustt3,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%thickness(ila,iln,1),iln=1,360*CRUSTMAP_RESOLUTION)
+  do i=3,7
+    l = i - 2
+    call read_general_crustmap_layer(GC_V%thickness(:,:,l), 't', i)
+    call read_general_crustmap_layer(GC_V%density(:,:,l),   'r', i)
+    call read_general_crustmap_layer(GC_V%velocp(:,:,l),    'p', i)
+    call read_general_crustmap_layer(GC_V%velocs(:,:,l),    's', i)
   enddo
-  close(1)
 
-  open(unit=1,file=eucrustt4,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%thickness(ila,iln,2),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustt5,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%thickness(ila,iln,3),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustt6,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%thickness(ila,iln,4),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustt7,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%thickness(ila,iln,5),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-
-
- open(unit=1,file=eucrustr3,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%density(ila,iln,1),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
- open(unit=1,file=eucrustr4,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%density(ila,iln,2),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustr5,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%density(ila,iln,3),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustr6,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%density(ila,iln,4),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustr7,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%density(ila,iln,5),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-
-
-  open(unit=1,file=eucrustp3,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocp(ila,iln,1),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustp4,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocp(ila,iln,2),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustp5,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocp(ila,iln,3),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustp6,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocp(ila,iln,4),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrustp7,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocp(ila,iln,5),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-
-
-  open(unit=1,file=eucrusts3,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocs(ila,iln,1),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrusts4,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocs(ila,iln,2),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrusts5,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocs(ila,iln,3),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrusts6,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocs(ila,iln,4),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
-  open(unit=1,file=eucrusts7,status='old',action='read')
-  do ila=1,180*CRUSTMAP_RESOLUTION
-    read(1,*) (GC_V%velocs(ila,iln,5),iln=1,360*CRUSTMAP_RESOLUTION)
-  enddo
-  close(1)
-
   GC_V%thicknessnp(:) = 0.0
   GC_V%thicknesssp(:) = 0.0
   GC_V%densitynp(:) = 0.0
@@ -349,6 +197,45 @@
 !-------------------------------------------------------------------------------------------------
 !
 
+  subroutine read_general_crustmap_layer(var,var_letter,ind)
+
+  implicit none
+  include "constants.h"
+
+  double precision, intent(out), &
+    dimension(180*CRUSTMAP_RESOLUTION,360*CRUSTMAP_RESOLUTION)&
+    :: var
+  character(len=1), intent(in) :: var_letter
+  integer, intent(in) :: ind
+
+  ! local variables
+  character(len=50) :: config_name
+  character(len=150) :: default_name
+  character(len=150) :: eucrust
+  integer :: ier, ila, iln
+
+  write(config_name,'(a,a1,i1)') 'model.eucrust', var_letter, ind
+  write(default_name,'(a,a1,i1)') 'DATA/crustmap/eucrust', var_letter, ind
+
+  call get_value_string(eucrust, config_name, default_name)
+
+  open(unit=1,file=eucrust,status='old',action='read')
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(eucrust), '": ', ier
+    call exit_MPI(0, 'error model crustmap')
+  endif
+
+  do ila=1,180*CRUSTMAP_RESOLUTION
+    read(1,*) (var(ila,iln),iln=1,360*CRUSTMAP_RESOLUTION)
+  enddo
+  close(1)
+
+  end subroutine read_general_crustmap_layer
+
+!
+!-------------------------------------------------------------------------------------------------
+!
+
   subroutine model_crustmaps(lat,lon,x,vp,vs,rho,moho,found_crust,GC_V,elem_in_crust)
 
 ! Matthias Meschede

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_epcrust.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_epcrust.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_epcrust.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -94,10 +94,16 @@
   character(len=150) EPCRUST_FNM
   character(len=150),dimension(15) :: header
   double precision,dimension(15) :: tmp
-  integer:: ilon, jlat
+  integer:: ier, ilon, jlat
 
   call get_value_string(EPCRUST_FNM,'model.EPCRUST_FNM',PATHNAME_EPCRUST)
-  open(unit=1001,file=EPCRUST_FNM,status='old',action='read')
+
+  open(unit=1001,file=EPCRUST_FNM,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(EPCRUST_FNM), '": ', ier
+    call exit_MPI(0, 'error model epcrust')
+  endif
+
   read(1001,*) header
 
   do jlat = 1,EPCRUST_NLAT

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_eucrust.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_eucrust.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_eucrust.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -122,7 +122,11 @@
 
   ! opens data file
   call get_value_string(filename, 'model.eu', 'DATA/eucrust-07/ds01.txt')
-  open(unit=11,file=filename,status='old',action='read')
+  open(unit=11,file=filename,status='old',action='read',iostat=ierror)
+  if ( ierror /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(filename), '": ', ierror
+    call exit_MPI(0, 'error model eucrust')
+  endif
 
   ! skip first line
   read(11,*)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gapp2.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gapp2.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gapp2.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -105,7 +105,10 @@
 
   ! reads in GAP-P2 model from Obayashi
   open(unit=10,file=GAPP2,status='old',action='read',iostat=ier)
-  if( ier /= 0 ) call exit_MPI(0,'error opening file for GAPP2 model')
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(GAPP2), '": ', ier
+    call exit_MPI(0, 'error model GAPP2')
+  endif
 
   read(10,*) no,na,nnr,dela,delo
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gll.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gll.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_gll.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -256,8 +256,8 @@
     ! vp mesh
     open(unit=27,file=prname(1:len_trim(prname))//'vp_new.bin',&
           status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      write(IMAIN,*) 'error opening: ',prname(1:len_trim(prname))//'vp_new.bin'
+    if ( ier /= 0 ) then
+      write(IMAIN,*) 'error opening "',prname(1:len_trim(prname))//'vp_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%vp_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -266,8 +266,8 @@
     ! vs mesh
     open(unit=27,file=prname(1:len_trim(prname))//'vs_new.bin', &
          status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      print*,'error opening: ',prname(1:len_trim(prname))//'vs_new.bin'
+    if ( ier /= 0 ) then
+      print*,'error opening "',prname(1:len_trim(prname))//'vs_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%vs_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -279,8 +279,8 @@
     ! vp mesh
     open(unit=27,file=prname(1:len_trim(prname))//'vpv_new.bin',&
           status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      write(IMAIN,*) 'error opening: ',prname(1:len_trim(prname))//'vpv_new.bin'
+    if ( ier /= 0 ) then
+      write(IMAIN,*) 'error opening "',prname(1:len_trim(prname))//'vpv_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%vpv_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -288,8 +288,8 @@
 
     open(unit=27,file=prname(1:len_trim(prname))//'vph_new.bin',&
           status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      write(IMAIN,*) 'error opening: ',prname(1:len_trim(prname))//'vph_new.bin'
+    if ( ier /= 0 ) then
+      write(IMAIN,*) 'error opening "',prname(1:len_trim(prname))//'vph_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%vph_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -298,8 +298,8 @@
     ! vs mesh
     open(unit=27,file=prname(1:len_trim(prname))//'vsv_new.bin', &
          status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      print*,'error opening: ',prname(1:len_trim(prname))//'vsv_new.bin'
+    if ( ier /= 0 ) then
+      print*,'error opening "',prname(1:len_trim(prname))//'vsv_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%vsv_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -307,8 +307,8 @@
 
     open(unit=27,file=prname(1:len_trim(prname))//'vsh_new.bin', &
          status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      print*,'error opening: ',prname(1:len_trim(prname))//'vsh_new.bin'
+    if ( ier /= 0 ) then
+      print*,'error opening "',prname(1:len_trim(prname))//'vsh_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%vsh_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -317,8 +317,8 @@
     ! eta mesh
     open(unit=27,file=prname(1:len_trim(prname))//'eta_new.bin', &
          status='old',action='read',form='unformatted',iostat=ier)
-    if( ier /= 0 ) then
-      print*,'error opening: ',prname(1:len_trim(prname))//'eta_new.bin'
+    if ( ier /= 0 ) then
+      print*,'error opening "',prname(1:len_trim(prname))//'eta_new.bin', '": ', ier
       call exit_MPI(myrank,'error model gll')
     endif
     read(27) MGLL_V%eta_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))
@@ -329,8 +329,8 @@
   ! rho mesh
   open(unit=27,file=prname(1:len_trim(prname))//'rho_new.bin', &
        status='old',action='read',form='unformatted',iostat=ier)
-  if( ier /= 0 ) then
-    print*,'error opening: ',prname(1:len_trim(prname))//'rho_new.bin'
+  if ( ier /= 0 ) then
+    print*,'error opening "',prname(1:len_trim(prname))//'rho_new.bin', '": ', ier
     call exit_MPI(myrank,'error model gll')
   endif
   read(27) MGLL_V%rho_new(:,:,:,1:nspec(IREGION_CRUST_MANTLE))

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_heterogen_mantle.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_heterogen_mantle.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_heterogen_mantle.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -85,7 +85,7 @@
 
   include "constants.h"
 
-  integer i,j
+  integer i,j,ier
 
 ! model_heterogen_m_variables
   type model_heterogen_m_variables
@@ -99,7 +99,11 @@
 
 ! open heterogen.dat
   open(unit=10,file='./DATA/heterogen/heterogen.dat',access='direct',&
-       form='formatted',recl=20,status='old',action='read')
+       form='formatted',recl=20,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "./DATA/heterogen/heterogen.dat": ', ier
+    call exit_MPI(0, 'error model heterogen')
+  endif
 
   j = N_R*N_THETA*N_PHI
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_ppm.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_ppm.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_ppm.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -173,9 +173,9 @@
   ! counts entries
   counter=0
   open(unit=10,file=trim(filename),status='old',action='read',iostat=ier)
-  if( ier /= 0 ) then
-    write(IMAIN,*) ' error count opening: ',trim(filename)
-    call exit_mpi(0,"error count opening model ppm")
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(filename), '": ', ier
+    call exit_mpi(0, "error opening model ppm")
   endif
 
   ! first line is text and will be ignored
@@ -214,7 +214,7 @@
   ! vs values
   open(unit=10,file=trim(filename),status='old',action='read',iostat=ier)
   if( ier /= 0 ) then
-    write(IMAIN,*) ' error opening: ',trim(filename)
+    write(IMAIN,*) ' error opening "', trim(filename), '": ', ier
     call exit_mpi(0,"error opening model ppm")
   endif
   read(10,'(a150)') line   ! first line is text

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s20rts.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s20rts.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s20rts.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -101,7 +101,7 @@
   type (model_s20rts_variables) S20RTS_V
 ! model_s20rts_variables
 
-  integer k,l,m
+  integer k,l,m,ier
 
   character(len=150) S20RTS, P12
 
@@ -109,7 +109,11 @@
   call get_value_string(P12, 'model.P12', 'DATA/s20rts/P12.dat')
 
 ! S20RTS degree 20 S model from Ritsema
-  open(unit=10,file=S20RTS,status='old',action='read')
+  open(unit=10,file=S20RTS,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(S20RTS), '": ', ier
+    call exit_MPI(0, 'error model s20rts')
+  endif
   do k=0,NK_20
     do l=0,NS_20
       read(10,*) S20RTS_V%dvs_a(k,l,0),(S20RTS_V%dvs_a(k,l,m),S20RTS_V%dvs_b(k,l,m),m=1,l)
@@ -118,7 +122,11 @@
   close(10)
 
 ! P12 degree 12 P model from Ritsema
-  open(unit=10,file=P12,status='old',action='read')
+  open(unit=10,file=P12,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(P12), '": ', ier
+    call exit_MPI(0, 'error model s20rts')
+  endif
   do k=0,NK_20
     do l=0,12
       read(10,*) S20RTS_V%dvp_a(k,l,0),(S20RTS_V%dvp_a(k,l,m),S20RTS_V%dvp_b(k,l,m),m=1,l)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s362ani.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s362ani.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s362ani.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -954,6 +954,7 @@
     hsplfile,refmodel,kernstri,desckern)
 
   implicit none
+  include "constants.h"
 
   integer, parameter :: mxhpar=2
   integer, parameter :: mxkern=200
@@ -984,9 +985,10 @@
 
   integer :: ncoef,i,ihor,ifst,ilst,ifst1,ios,lstr,nmodkern,idummy,nhorpar,lmax
 
-  open(lu,file=filename,iostat=ios)
-  if(ios /= 0) then
-  stop 'error opening 3-d model'
+  open(lu,file=filename,status='old',action='read',iostat=ios)
+  if ( ios /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(filename), '": ', ios
+    call exit_MPI(0, 'error model s362ani')
   endif
   do while (ios == 0)
   read(lu,"(a)",iostat=ios) string

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s40rts.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s40rts.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_s40rts.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -106,14 +106,18 @@
   type (model_s40rts_variables) S40RTS_V
 ! model_s40rts_variables
 
-  integer k,l,m
+  integer k,l,m,ier
 
   character(len=150) S40RTS, P12
   call get_value_string(S40RTS, 'model.S40RTS', 'DATA/s40rts/S40RTS.dat')
   call get_value_string(P12, 'model.P12', 'DATA/s20rts/P12.dat')    !model P12 is in s20rts data directory
 
 ! S40RTS degree 20 S model from Ritsema
-  open(unit=10,file=S40RTS,status='old',action='read')
+  open(unit=10,file=S40RTS,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(S40RTS), '": ', ier
+    call exit_MPI(0, 'error model s40rts')
+  endif
   do k=0,NK_20
     do l=0,NS_40
       read(10,*) S40RTS_V%dvs_a(k,l,0),(S40RTS_V%dvs_a(k,l,m),S40RTS_V%dvs_b(k,l,m),m=1,l)
@@ -122,7 +126,11 @@
   close(10)
 
 ! P12 degree 12 P model from Ritsema
-  open(unit=10,file=P12,status='old',action='read')
+  open(unit=10,file=P12,status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "', trim(P12), '": ', ier
+    call exit_MPI(0, 'error model s40rts')
+  endif
   do k=0,NK_20
     do l=0,12
       read(10,*) S40RTS_V%dvp_a(k,l,0),(S40RTS_V%dvp_a(k,l,m),S40RTS_V%dvp_b(k,l,m),m=1,l)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_sea99_s.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_sea99_s.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/meshfem3D/model_sea99_s.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -119,13 +119,17 @@
   type (model_sea99_s_variables) SEA99M_V
   ! model_sea99_s_variables
 
-  integer :: i,ia,io,j
+  integer :: i,ia,io,j,ier
 
 !----------------------- choose input file:  ------------------
 ! relative anomaly
 
 
-  open(1,file='DATA/Lebedev_sea99/sea99_dvsvs')
+  open(1,file='DATA/Lebedev_sea99/sea99_dvsvs',status='old',action='read',iostat=ier)
+  if ( ier /= 0 ) then
+    write(IMAIN,*) 'error opening "DATA/Lebedev_sea99/sea99_dvsvs": ', ier
+    call exit_MPI(0, 'error model sea99_s')
+  endif
 
 !----------------------- read input file:  ------------------
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_receivers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_receivers.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_receivers.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -46,6 +46,8 @@
   include "constants.h"
   include "precision.h"
 
+  integer, allocatable, dimension(:) :: station_duplet
+
   integer NPROCTOT,NCHUNKS
 
   logical ELLIPTICITY,TOPOGRAPHY,RECEIVERS_CAN_BE_BURIED
@@ -143,10 +145,16 @@
   integer, allocatable, dimension(:,:) :: ispec_selected_rec_all
   double precision, dimension(nrec) :: stlat,stlon,stele,stbur
   double precision, allocatable, dimension(:,:) :: xi_receiver_all,eta_receiver_all,gamma_receiver_all
+  double precision, allocatable, dimension(:) :: xi_receiver_subset,eta_receiver_subset,gamma_receiver_subset
 
   character(len=150) OUTPUT_FILES
   character(len=2) bic
 
+  integer nrec_SUBSET_current_size,irec_in_this_subset,irec_already_done
+  double precision, allocatable, dimension(:) :: x_found_subset,y_found_subset,z_found_subset
+  double precision, allocatable, dimension(:) :: final_distance_subset
+  integer, allocatable, dimension(:) :: ispec_selected_rec_subset
+
 ! **************
 
 ! make sure we clean the array before the gather
@@ -185,15 +193,7 @@
           x_found(nrec), &
           y_found(nrec), &
           z_found(nrec), &
-          final_distance(nrec), &
-          ispec_selected_rec_all(nrec,0:NPROCTOT-1), &
-          xi_receiver_all(nrec,0:NPROCTOT-1), &
-          eta_receiver_all(nrec,0:NPROCTOT-1), &
-          gamma_receiver_all(nrec,0:NPROCTOT-1), &
-          x_found_all(nrec,0:NPROCTOT-1), &
-          y_found_all(nrec,0:NPROCTOT-1), &
-          z_found_all(nrec,0:NPROCTOT-1), &
-          final_distance_all(nrec,0:NPROCTOT-1),stat=ier)
+          final_distance(nrec),stat=ier)
   if( ier /= 0 ) call exit_MPI(myrank,'error allocating temporary receiver arrays')
 
   ! read that STATIONS file on the master
@@ -213,6 +213,30 @@
     ! close receiver file
     close(1)
 
+! BS BS begin
+! In case that the same station and network name appear twice (or more times) in the STATIONS
+! file, problems occur, as two (or more) seismograms are written (with mode
+! "append") to a file with same name. The philosophy here is to accept multiple
+! appearences and to just add a count to the station name in this case.
+    allocate(station_duplet(nrec))
+    station_duplet=0
+    do irec = 1,nrec
+      do i=1,irec-1
+        if ((station_name(irec)==station_name(i)) .and. &
+            (network_name(irec)==network_name(i))) then
+
+            station_duplet(i)=station_duplet(i)+1
+            if (len_trim(station_name(irec)) <= MAX_LENGTH_STATION_NAME-3) then
+              write(station_name(irec),"(a,'_',i2.2)") trim(station_name(irec)),station_duplet(i)+1
+            else
+              call exit_MPI(myrank,'Please increase MAX_LENGTH_STATION_NAME by at lease 3')
+            endif
+
+        endif
+      enddo
+    enddo
+! BS BS end
+
     ! if receivers can not be buried, sets depth to zero
     if( .not. RECEIVERS_CAN_BE_BURIED ) stbur(:) = 0.d0
 
@@ -425,9 +449,46 @@
 ! find the best (xi,eta) for each receiver
 ! ****************************************
 
-! loop on all the receivers to iterate in that slice
-  do irec = 1,nrec
+!! loop on all the receivers to iterate in that slice
+!  do irec = 1,nrec
 
+! loop on all the receivers
+! gather source information in subsets to reduce memory requirements
+
+islice_selected_rec(:) = -1
+! loop over subsets of receivers
+  do irec_already_done = 0, nrec, nrec_SUBSET_MAX
+
+! the size of the subset can be the maximum size, or less (if we are in the last subset,
+! or if there are fewer sources than the maximum size of a subset)
+  nrec_SUBSET_current_size = min(nrec_SUBSET_MAX, nrec - irec_already_done)
+
+! allocate arrays specific to each subset
+  allocate(ispec_selected_rec_subset(nrec_SUBSET_current_size), &
+           ispec_selected_rec_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          xi_receiver_subset(nrec_SUBSET_current_size), &
+          eta_receiver_subset(nrec_SUBSET_current_size), &
+          gamma_receiver_subset(nrec_SUBSET_current_size), &
+          xi_receiver_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          eta_receiver_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          gamma_receiver_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          x_found_subset(nrec_SUBSET_current_size), &
+          y_found_subset(nrec_SUBSET_current_size), &
+          z_found_subset(nrec_SUBSET_current_size), &
+          x_found_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          y_found_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          z_found_all(nrec_SUBSET_current_size,0:NPROCTOT-1), &
+          final_distance_subset(nrec_SUBSET_current_size), &
+          final_distance_all(nrec_SUBSET_current_size,0:NPROCTOT-1),stat=ier)
+  if( ier /= 0 ) call exit_MPI(myrank,'error allocating temporary receiver arrays')
+
+! loop over the stations within this subset
+  do irec_in_this_subset = 1,nrec_SUBSET_current_size
+
+! mapping from station number in current subset to real station number in all the subsets
+  irec = irec_in_this_subset + irec_already_done
+
+    ispec_selected_rec_subset(irec_in_this_subset) = ispec_selected_rec(irec)
     ispec_iterate = ispec_selected_rec(irec)
 
 ! use initial guess in xi and eta
@@ -525,36 +586,43 @@
          xix,xiy,xiz,etax,etay,etaz,gammax,gammay,gammaz)
 
 ! store xi,eta and x,y,z of point found
-    xi_receiver(irec) = xi
-    eta_receiver(irec) = eta
-    gamma_receiver(irec) = gamma
+    xi_receiver_subset(irec_in_this_subset) = xi
+    eta_receiver_subset(irec_in_this_subset) = eta
+    gamma_receiver_subset(irec_in_this_subset) = gamma
     x_found(irec) = x
     y_found(irec) = y
     z_found(irec) = z
+    x_found_subset(irec_in_this_subset) = x_found(irec)
+    y_found_subset(irec_in_this_subset) = y_found(irec)
+    z_found_subset(irec_in_this_subset) = z_found(irec)
 
 ! compute final distance between asked and found (converted to km)
     final_distance(irec) = dsqrt((x_target(irec)-x_found(irec))**2 + &
         (y_target(irec)-y_found(irec))**2 + (z_target(irec)-z_found(irec))**2)*R_EARTH/1000.d0
 
-  enddo
+    final_distance_subset(irec_in_this_subset) = final_distance(irec)
 
+  enddo ! end of loop on all stations within current subset
+
 ! for MPI version, gather information from all the nodes
   ispec_selected_rec_all(:,:) = -1
-  call MPI_GATHER(ispec_selected_rec,nrec,MPI_INTEGER,ispec_selected_rec_all,nrec,MPI_INTEGER,0,MPI_COMM_WORLD,ier)
 
-  call MPI_GATHER(xi_receiver,nrec,MPI_DOUBLE_PRECISION,xi_receiver_all,nrec, &
+  call MPI_GATHER(ispec_selected_rec_subset,nrec_SUBSET_current_size,MPI_INTEGER,ispec_selected_rec_all,nrec_SUBSET_current_size, &
+                  MPI_INTEGER,0,MPI_COMM_WORLD,ier)
+
+  call MPI_GATHER(xi_receiver_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,xi_receiver_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
-  call MPI_GATHER(eta_receiver,nrec,MPI_DOUBLE_PRECISION,eta_receiver_all,nrec, &
+  call MPI_GATHER(eta_receiver_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,eta_receiver_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
-  call MPI_GATHER(gamma_receiver,nrec,MPI_DOUBLE_PRECISION,gamma_receiver_all,nrec, &
+  call MPI_GATHER(gamma_receiver_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,gamma_receiver_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
-  call MPI_GATHER(final_distance,nrec,MPI_DOUBLE_PRECISION,final_distance_all,nrec, &
+  call MPI_GATHER(final_distance_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,final_distance_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
-  call MPI_GATHER(x_found,nrec,MPI_DOUBLE_PRECISION,x_found_all,nrec, &
+  call MPI_GATHER(x_found_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,x_found_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
-  call MPI_GATHER(y_found,nrec,MPI_DOUBLE_PRECISION,y_found_all,nrec, &
+  call MPI_GATHER(y_found_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,y_found_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
-  call MPI_GATHER(z_found,nrec,MPI_DOUBLE_PRECISION,z_found_all,nrec, &
+  call MPI_GATHER(z_found_subset,nrec_SUBSET_current_size,MPI_DOUBLE_PRECISION,z_found_all,nrec_SUBSET_current_size, &
                   MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,ier)
 
 ! this is executed by main process only
@@ -564,25 +632,54 @@
     if(any(ispec_selected_rec_all(:,:) == -1)) call exit_MPI(myrank,'gather operation failed for receivers')
 
     ! MPI loop on all the results to determine the best slice
-    islice_selected_rec(:) = -1
-    do irec = 1,nrec
-      distmin = HUGEVAL
+    !do irec = 1,nrec
+    do irec_in_this_subset = 1,nrec_SUBSET_current_size
+
+     ! mapping from station number in current subset to real station number in all the subsets
+     irec = irec_in_this_subset + irec_already_done
+
+     distmin = HUGEVAL
       do iprocloop = 0,NPROCTOT-1
-        if(final_distance_all(irec,iprocloop) < distmin) then
-          distmin = final_distance_all(irec,iprocloop)
+        if(final_distance_all(irec_in_this_subset,iprocloop) < distmin) then
+          distmin = final_distance_all(irec_in_this_subset,iprocloop)
           islice_selected_rec(irec) = iprocloop
-          ispec_selected_rec(irec) = ispec_selected_rec_all(irec,iprocloop)
-          xi_receiver(irec) = xi_receiver_all(irec,iprocloop)
-          eta_receiver(irec) = eta_receiver_all(irec,iprocloop)
-          gamma_receiver(irec) = gamma_receiver_all(irec,iprocloop)
-          x_found(irec) = x_found_all(irec,iprocloop)
-          y_found(irec) = y_found_all(irec,iprocloop)
-          z_found(irec) = z_found_all(irec,iprocloop)
+          ispec_selected_rec(irec) = ispec_selected_rec_all(irec_in_this_subset,iprocloop)
+          xi_receiver(irec) = xi_receiver_all(irec_in_this_subset,iprocloop)
+          eta_receiver(irec) = eta_receiver_all(irec_in_this_subset,iprocloop)
+          gamma_receiver(irec) = gamma_receiver_all(irec_in_this_subset,iprocloop)
+          x_found(irec) = x_found_all(irec_in_this_subset,iprocloop)
+          y_found(irec) = y_found_all(irec_in_this_subset,iprocloop)
+          z_found(irec) = z_found_all(irec_in_this_subset,iprocloop)
         endif
       enddo
       final_distance(irec) = distmin
     enddo
 
+  endif ! end of section executed by main process only
+
+  deallocate(ispec_selected_rec_subset)
+  deallocate(ispec_selected_rec_all)
+  deallocate(xi_receiver_subset)
+  deallocate(eta_receiver_subset)
+  deallocate(gamma_receiver_subset)
+  deallocate(xi_receiver_all)
+  deallocate(eta_receiver_all)
+  deallocate(gamma_receiver_all)
+  deallocate(x_found_subset)
+  deallocate(y_found_subset)
+  deallocate(z_found_subset)
+  deallocate(x_found_all)
+  deallocate(y_found_all)
+  deallocate(z_found_all)
+  deallocate(final_distance_subset)
+  deallocate(final_distance_all)
+
+  enddo ! end of loop over all station subsets
+
+
+! this is executed by main process only
+  if(myrank == 0) then
+
     nrec_found = 0
     do irec=1,nrec
 
@@ -732,14 +829,6 @@
   deallocate(y_found)
   deallocate(z_found)
   deallocate(final_distance)
-  deallocate(ispec_selected_rec_all)
-  deallocate(xi_receiver_all)
-  deallocate(eta_receiver_all)
-  deallocate(gamma_receiver_all)
-  deallocate(x_found_all)
-  deallocate(y_found_all)
-  deallocate(z_found_all)
-  deallocate(final_distance_all)
 
   end subroutine locate_receivers
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_regular_points.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_regular_points.f90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/locate_regular_points.f90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -25,7 +25,7 @@
 !
 !=====================================================================
 
-subroutine read_kl_regular_grid(GRID)
+subroutine read_kl_regular_grid(myrank, GRID)
 
   implicit none
   include 'constants.h'
@@ -45,7 +45,7 @@
 
   type (kl_reg_grid_variables), intent(inout) :: GRID
 
-  integer :: ios,nlayer,i,nlat,nlon,npts_this_layer
+  integer :: myrank,ios,nlayer,i,nlat,nlon,npts_this_layer
 
   ! improvements to make: read-in by master and broadcast to all slaves
   open(10,file=PATHNAME_KL_REG,iostat=ios,status='old',action='read')
@@ -61,7 +61,7 @@
   close(10)
 
   if (nlayer > NM_KL_REG_LAYER) then
-    call exit_MPI('Increase NM_KL_REG_LAYER limit')
+    call exit_MPI(myrank, 'Increase NM_KL_REG_LAYER limit')
   endif
 
   GRID%nlayer = nlayer
@@ -78,7 +78,7 @@
     GRID%npts_before_layer(i+1) = GRID%npts_before_layer(i) + npts_this_layer
   enddo
   if (GRID%npts_total <= 0) then
-    call exit_MPI('No Model points read in')
+    call exit_MPI(myrank, 'No Model points read in')
   endif
 
 end subroutine read_kl_regular_grid
@@ -116,7 +116,7 @@
 
   ! assuming 6 chunks full global simulations right now
   if (NCHUNKS /= 6 .or. NPROC_XI /= NPROC_ETA) then
-    call exit_MPI('Only deal with 6 chunks at this moment')
+    call exit_MPI(0, 'Only deal with 6 chunks at this moment')
   endif
 
   xi_width=PI/2; eta_width=PI/2; nproc=NPROC_XI

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90	2013-06-28 16:11:31 UTC (rev 22440)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/src/specfem3D/specfem3D.F90	2013-06-28 16:17:01 UTC (rev 22441)
@@ -1323,7 +1323,7 @@
   endif
 
   if (SAVE_REGULAR_KL) then
-    call read_kl_regular_grid(KL_REG_GRID)
+    call read_kl_regular_grid(myrank, KL_REG_GRID)
 
     if (myrank==0) then
       allocate(slice_number(KL_REG_GRID%npts_total))
@@ -2410,7 +2410,7 @@
     ! crust mantle
     if (SAVE_REGULAR_KL) then
     call save_regular_kernels_crust_mantle(myrank, &
-                  npoints_slice, hxir_reg, hetar_reg, hgammar_reg, &
+                  npoints_slice, hxir_reg, hetar_reg, hgammar_reg, ispec_reg, &
                   scale_t,scale_displ, &
                   cijkl_kl_crust_mantle,rho_kl_crust_mantle, &
                   alpha_kl_crust_mantle,beta_kl_crust_mantle, &

Copied: seismo/3D/SPECFEM3D_GLOBE/branches/undo_att/yyyy_will_need_to_add_UNDO_ATT_NT_DUMP_to_all_EXAMPLE_Par_files (from rev 22440, seismo/3D/SPECFEM3D_GLOBE/trunk/yyyy_will_need_to_add_UNDO_ATT_NT_DUMP_to_all_EXAMPLE_Par_files)
===================================================================


More information about the CIG-COMMITS mailing list