Index: issm/trunk-jpl/externalpackages/petsc/install-3.12-linux.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.12-linux.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.12-lonestar.sh	(revision 27202)
@@ -1,8 +1,12 @@
 #!/bin/bash
 set -eu
+
 
 ## Constants
 #
 VER="3.12.3"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
@@ -13,16 +17,16 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
-#configure
-cd src
+# Configure
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
-	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-mpi-dir="/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/" \
 	--with-blas-lapack-dir="$TACC_MKL_LIB" \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.12-mac.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.12-mac.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.12-mac.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.12-win-msys2-gcc-msmpi.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.13-pleiades.sh	(revision 27202)
@@ -20,5 +20,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-discover.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-discover.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-discover.sh	(revision 27202)
@@ -3,15 +3,13 @@
 
 
-# NOTE: There is a single difference between the Linux and macOS 
-#		configurations, which is the addition of the -static-libgfortran 
-#		option to FFLAGS on the macOS static configurations. For the sake of 
-#		consistency, we maintain separate files for each, respective Linux and 
-#		macOS configuration.
-
-# Constants
+## Constants
+#
 VER="3.14.6"
 
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -19,17 +17,17 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
 	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-debugging=0 \
 	--with-valgrind=0 \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-greenplanet.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-greenplanet.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-greenplanet.sh	(revision 27202)
@@ -2,24 +2,34 @@
 set -eu
 
-#WARNING: make sure you have the right mpi
 
-#Some cleanup
-rm -rf install petsc-3.14.0 src
-mkdir install src
+# WARNING: Make sure you have the right MPI
 
-#Download from ISSM server
-$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.14.0.tar.gz' 'petsc-3.14.0.tar.gz'
+## Constants
+#
+VER="3.14.0"
 
-#Untar and move petsc to install directory
-tar -zxvf  petsc-3.14.0.tar.gz
-mv petsc-3.14.0/* src/
-rm -rf petsc-3.14.0
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
 
 #configure
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
 	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="$ISSM_DIR/externalpackages/petsc/install" \
-	--PETSC_DIR="$ISSM_DIR/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-blas-lapack-dir="/sopt/INTEL/compilers_and_libraries_2018.3.222/linux/mkl/" \
 	--with-mpi-dir="/sopt/OpenMPI/3.1.2/intel-2018.3-slim/" \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-linux.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-linux.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-linux.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-mac-nohdf5.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-mac-nohdf5.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-mac-nohdf5.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-mac.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-mac.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-mac.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-pleiades.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-pleiades.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-pleiades.sh	(revision 27202)
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-tetralith.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-tetralith.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-tetralith.sh	(revision 27202)
@@ -3,12 +3,10 @@
 
 
-# NOTE: There is a single difference between the Linux and macOS 
-#		configurations, which is the addition of the -static-libgfortran 
-#		option to FFLAGS on the macOS static configurations. For the sake of 
-#		consistency, we maintain separate files for each, respective Linux and 
-#		macOS configuration.
+## Constants
+#
+VER="3.14.6"
 
-# Constants
-VER="3.14.6"
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
@@ -19,17 +17,17 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
 	COPTFLAGS="-g -O2" CXXOPTFLAGS="-g -O2" FOPTFLAGS="-g -O2" \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-debugging=0 \
 	--with-valgrind=0 \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.14-win-msys2-mingw-msmpi.sh	(revision 27202)
@@ -32,5 +32,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.15-babylon.sh	(revision 27202)
@@ -11,5 +11,5 @@
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -18,5 +18,5 @@
 # Cleanup
 rm -rf ${PREFIX} ${PETSC_DIR}
-mkdir ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
Index: issm/trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.15-discovery.sh	(revision 27202)
@@ -3,8 +3,12 @@
 
 ## Constants
+#
 VER="3.15.3"
 
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -12,16 +16,17 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
-cd src
+# Configure
+cd ${PETSC_DIR}
 ./config/configure.py \
 	COPTFLAGS="-g -O3" CXXOPTFLAGS="-g -O3" FOPTFLAGS="-g -O3" \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-make-np=20 \
 	--with-blas-lapack-dir=$MKL_ROOT \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.15-pleiades.sh	(revision 27202)
@@ -14,20 +14,21 @@
 
 # Unpack source
-tar -zxvf petsc-3.15.0.tar.gz
+tar -zxvf petsc-${VER}.tar.gz
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
-mv petsc-3.15.0/* src/
-rm -rf petsc-3.15.0
-
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
 
 # Configure
 #
-# NOTE: Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables; look for CONFIGURE_OPTIONS
+# NOTE:
+# - Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables (look 
+#	for CONFIGURE_OPTIONS)
 #
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
 	--prefix="${PREFIX}" \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.16-linux.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.16-linux.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.16-linux.sh	(revision 27202)
@@ -3,4 +3,5 @@
 
 ## Constants
+#
 VER="3.16.0"
 
@@ -9,5 +10,5 @@
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -15,16 +16,16 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
-mv petsc-${VER}/* src/
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
 # Configure
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	-COPTFLAGS="-g -O2" -CXXOPTFLAGS="-g -O2" -FOPTFLAGS="-g -O2" \
 	--with-debugging=0 \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.16-mac.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.16-mac.sh	(revision 27202)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.16-mac.sh	(revision 27202)
@@ -0,0 +1,60 @@
+#!/bin/bash
+set -eu
+
+
+## Constants
+#
+VER="3.16.6"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
+# Download source
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+
+# Unpack source
+tar -zxvf petsc-${VER}.tar.gz
+
+# Cleanup
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
+
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
+rm -rf petsc-${VER}
+
+# Configure
+#
+# NOTE:
+# - Added -Wno-error=implicit-function-declaration to CFLAGS for Clang >= 12. 
+#	(may need to remove it for earlier versions not using the C99 standard).
+# - Added -fallow-argument-mismatch to FFLAGS in order to clear,
+#
+#		error: The Fortran compiler gfortran will not compile files that call 
+#		the same routine with arguments of different types.
+#
+#	for gfortran 10 or later (may need to remove it for earlier versions).
+#
+cd ${PETSC_DIR}
+./config/configure.py \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
+	--CFLAGS="-Wno-error=implicit-function-declaration" \
+	--FFLAGS="-fallow-argument-mismatch" \
+	--with-debugging=0 \
+	--with-valgrind=0 \
+	--with-x=0 \
+	--with-ssl=0 \
+	--with-pic=1 \
+	--download-fblaslapack=1 \
+	--download-mpich=1 \
+	--download-metis=1 \
+	--download-parmetis=1 \
+	--download-scalapack=1 \
+	--download-mumps=1 \
+	--download-zlib=1 \
+	--download-hdf5=1
+
+# Compile and install
+make
+make install
Index: issm/trunk-jpl/externalpackages/petsc/install-3.16-pleiades.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.16-pleiades.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.16-pleiades.sh	(revision 27202)
@@ -17,9 +17,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
 # Move source to $PETSC_DIR
-mv petsc-${VER}/* src/
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
@@ -27,7 +27,9 @@
 # Configure
 #
-# NOTE: Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables; look for CONFIGURE_OPTIONS
+# NOTE:
+# - Based on /nasa/petsc/3.7.5/intel_mpt/lib/petsc/conf/petscvariables (look 
+#	for CONFIGURE_OPTIONS)
 #
-cd src
+cd ${PETSC_DIR}
 ./config/configure.py \
 	--prefix="${PREFIX}" \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-intel.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-intel.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-intel.sh	(revision 27202)
@@ -2,9 +2,14 @@
 set -eu
 
+
 ## Constants
-VER="3.17.1"
+#
+VER="3.17.4"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -12,15 +17,16 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
-cd src
+# Configure
+cd ${PETSC_DIR}
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-debugging=0 \
 	--with-valgrind=0 \
@@ -34,7 +40,9 @@
 	--download-scalapack=1 \
 	--download-mumps=1 \
-	--download-zlib=1 
+	--download-zlib=1 \
+	--download-hdf5=1
 
 # Compile and install
 make
 make install
+
Index: issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-m1-static.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-m1-static.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-m1-static.sh	(revision 27202)
@@ -2,9 +2,14 @@
 set -eu
 
+
 ## Constants
-VER="3.17.1"
+#
+VER="3.17.4"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -12,9 +17,9 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
@@ -34,8 +39,8 @@
 #
 #	for gfortran 10 or later (may need to remove it for earlier versions).
-cd src
-./configure \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+cd ${PETSC_DIR}
+./config/configure.py \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--LDFLAGS="-Wl,-no_compact_unwind" \
 	--with-shared-libraries=0 \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-m1.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-m1.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.17-mac-m1.sh	(revision 27202)
@@ -4,8 +4,12 @@
 
 ## Constants
-VER="3.17.0"
+#
+VER="3.17.4"
+
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
 
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -13,15 +17,16 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
-cd src
-./configure \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+# Configure
+cd ${PETSC_DIR}
+./config/configure.py \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--LDFLAGS="-Wl,-no_compact_unwind" \
 	--with-debugging=0 \
Index: issm/trunk-jpl/externalpackages/petsc/install-3.17-pleiades.sh
===================================================================
--- issm/trunk-jpl/externalpackages/petsc/install-3.17-pleiades.sh	(revision 27192)
+++ issm/trunk-jpl/externalpackages/petsc/install-3.17-pleiades.sh	(revision 27202)
@@ -2,9 +2,14 @@
 set -eu
 
+
 ## Constants
+#
 VER="3.17.4"
 
+PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" # DO NOT CHANGE THIS
+PREFIX="${ISSM_DIR}/externalpackages/petsc/install" # Set to location where external package should be installed
+
 # Download source
-$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/petsc-lite-${VER}.tar.gz" "petsc-${VER}.tar.gz"
 
 # Unpack source
@@ -12,16 +17,22 @@
 
 # Cleanup
-rm -rf install src
-mkdir install src
+rm -rf ${PREFIX} ${PETSC_DIR}
+mkdir -p ${PETSC_DIR}
 
-# Move source to 'src' directory
-mv petsc-${VER}/* src/
+# Move source to $PETSC_DIR
+mv petsc-${VER}/* ${PETSC_DIR}
 rm -rf petsc-${VER}
 
-#options from cat /nasa/petsc/3.14.5_toss3/lib/petsc/conf/petscvariables | grep CONF
-cd src
+# Configure
+#
+# NOTE:
+# - Options from,
+#
+# 		cat /nasa/petsc/3.14.5_toss3/lib/petsc/conf/petscvariables | grep CONF
+#
+cd ${PETSC_DIR}
 ./configure \
-	--prefix="${ISSM_DIR}/externalpackages/petsc/install" \
-	--PETSC_DIR="${ISSM_DIR}/externalpackages/petsc/src" \
+	--prefix="${PREFIX}" \
+	--PETSC_DIR="${PETSC_DIR}" \
 	--with-blas-lapack-dir="/nasa/intel/Compiler/2018.3.222/compilers_and_libraries_2018.3.222/linux/mkl" \
 	--with-scalapack-include="/nasa/intel/Compiler/2018.3.222/mkl/include" \
