Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
This software was written by David Gill <davidgil@usc.edu>. Any communications
regarding the CCA model or UCVM should be directed to software@scec.org. All
scientific questions regarding this velocity model should be directed to the
following researchers:

- En-Jui Lee <enjuilee@usc.edu>
All communication regarding using ALBACORE or UCVM should be directed to
software@scec.org. Any scientific questions regarding this model should
be directed to the researchers behind this model.

En-Jui Lee <enjuilee@usc.edu>

The data and code for this model is based off of the following paper:

Small, P., Gill, D., Maechling, P. J., Taborda, R., Callaghan, S., Jordan,
T. H., Ely, G. P., Olsen, K. B., & Goulet, C. A. (2017). The SCEC Unified
Community Velocity Model Software Framework. Seism. Research. Lett., 88,
1539-1552, doi:10.1785/0220170082'
18 changes: 13 additions & 5 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
CCA Alpha (March 2015):
Includes the central California inversions from En-Jui Lee's full 3D
tomographic improvements. This model does not include a GTL. Further
information regarding this model can be found at:
http://scec.usc.edu/scecpedia/CCA
## 2023-02-15 Mei-Hui Su <mei@usc.edu>
* Brad Aagaard modifications to upgrade to PROJ and eliminate the
the need for utm_geo.f90 code
This version only works UCVM 23_4+

## 201X-01-00 David Gill - SCEC
* Convert to a plugin-module for UCVM

## 2015-03-00 CCA Alpha
* Includes the central California inversions from En-Jui Lee's full 3D
tomographic improvements. This model does not include a GTL. Further
information regarding this model can be found at:
http://scec.usc.edu/scecpedia/CCA
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# GNU Automake config
SUBDIRS = data src tests
INCLUDES = $(default_includes)
SUBDIRS = data src
INCLUDES = $(default_includes)

ACLOCAL_AMFLAGS = -I m4
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CCA-06

[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

![GitHub repo size](https://img.shields.io/github/repo-size/sceccode/cca)
[![cca-ucvm-ci Actions Status](https://github.com/SCECcode/cca/workflows/cca-ucvm-ci/badge.svg)](https://github.com/SCECcode/cca/actions)

Expand All @@ -9,7 +10,6 @@ tomographic inversion, using the USGS Bay Area (v8.3.0), CVM-S4.26, and Lin-Thur
starting models.  6 iterations were performed on a 500m-resolution mesh, down to a minimum Vs
of 900 m/s, to generate the final model.  This model includes an optional Ely-Jordan GTL.


## Installation

This package is intended to be installed as part of the UCVM framework,
Expand Down
293 changes: 233 additions & 60 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,64 +1,237 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(CCA, 1.0, davidgil@usc.edu)
AC_CONFIG_SRCDIR([src])
AM_INIT_AUTOMAKE()
AC_PREREQ(2.59)
AC_INIT(CCA, 1.1.0, software@scec.org)
AC_CONFIG_AUX_DIR([./aux-config])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE(foreign tar-pax)

dnl
dnl Dependencies
dnl

dnl Etree (Euclid)
AC_ARG_ENABLE([etree],
[AC_HELP_STRING([--enable-etree],
[install Etree library @<:@default=yes@:>@])],
[if test "$enableval" = yes ; then install_etree=yes; else install_etree=no; fi],
[install_etree=yes])
AM_CONDITIONAL([INSTALL_ETREE], [test "$install_etree" = yes])
AC_ARG_WITH([etree-incdir],
[AS_HELP_STRING([--with-etree-incdir], [directory containing Etree header files])],
[with_etree_incdir="$withval"],
[with_etree_incdir=no])
AC_SUBST(with_etree_incdir)
AC_ARG_WITH([etree-libdir],
[AS_HELP_STRING([--with-etree-libdir], [directory containing Etree library])],
[with_etree_libdir="$withval"],
[with_etree_libdir=no])
AC_SUBST(with_etree_libdir)

dnl SQLITE
AC_ARG_ENABLE([sqlite],
[AC_HELP_STRING([--enable-sqlite],
[install Sqlite @<:@default=no@:>@])],
[if test "$enableval" = "yes" ; then install_sqlite=yes; else install_sqlite=no; fi],
[install_sqlite=no])
AM_CONDITIONAL([INSTALL_SQLITE], [test "$install_sqlite" = yes])
AC_ARG_WITH([sqlite-incdir],
[AC_HELP_STRING([--with-sqlite-incdir],
[location of sqlite header files @<:@default=no@:>@])],
[with_sqlite_incdir=$withval],
[with_sqlite_incdir=no])
AC_SUBST(with_sqlite_incdir)
AC_ARG_WITH([sqlite-libdir],
[AC_HELP_STRING([--with-sqlite-libdir],
[location of sqlite library @<:@default=no@:>@])],
[with_sqlite_libdir=$withval],
[with_sqlite_libdir=no])
AC_SUBST(with_sqlite_libdir)

dnl TIFF
AC_ARG_ENABLE([tiff],
[AC_HELP_STRING([--enable-tiff],
[install Tiff @<:@default=no@:>@])],
[if test "$enableval" = "yes" ; then install_tiff=yes; else install_tiff=no; fi],
[install_tiff=no])
AM_CONDITIONAL([INSTALL_TIFF], [test "$install_tiff" = yes])
AC_ARG_WITH([tiff-incdir],
[AC_HELP_STRING([--with-tiff-incdir],
[location of tiff header files @<:@default=no@:>@])],
[with_tiff_incdir=$withval],
[with_tiff_incdir=no])
AC_SUBST(with_tiff_incdir)
AC_ARG_WITH([tiff-libdir],
[AC_HELP_STRING([--with-tiff-libdir],
[location of tiff library @<:@default=no@:>@])],
[with_tiff_libdir=$withval],
[with_tiff_libdir=no])
AC_SUBST(with_tiff_libdir)

dnl PROJ
AC_ARG_ENABLE([proj],
[AC_HELP_STRING([--enable-proj],
[install Proj @<:@default=yes@:>@])],
[if test "$enableval" = "yes" ; then install_proj=yes; else install_proj=no; fi],
[install_proj=yes])
AM_CONDITIONAL([INSTALL_PROJ], [test "$install_proj" = yes])
AC_ARG_WITH([proj-incdir],
[AC_HELP_STRING([--with-proj-incdir], [directory containing Proj header files @<:@default=no@:>@])],
[with_proj_incdir="$withval"],
[with_proj_incdir=no])
AC_SUBST(with_proj_incdir)
AC_ARG_WITH([proj-libdir],
[AC_HELP_STRING([--with-proj-libdir], [directory containing Proj library @<:@default=no@:>@])],
[with_proj_libdir="$withval"],
[with_proj_libdir=no])
AC_SUBST(with_proj_libdir)


##check optional large data path
if test x"$CVM_LARGEDATA_DIR" != x; then
# test directory existence
CCA_LARGEDATA_DIR=$CVM_LARGEDATA_DIR/model/cca_i06
if test x"$CVM_IN_DOCKER" != x; then
AM_CONDITIONAL([WITH_CCA_LARGEDATA_DIR], true)
AC_SUBST(CCA_LARGEDATA_DIR)
else
AC_CHECK_FILE([$CCA_LARGEDATA_DIR/density.dat],
[AM_CONDITIONAL([WITH_CCA_LARGEDATA_DIR], true) AC_SUBST(CCA_LARGEDATA_DIR)],
[AM_CONDITIONAL(WITH_CCA_LARGEDATA_DIR, false)])
fi
else
AM_CONDITIONAL(WITH_CCA_LARGEDATA_DIR, false)
fi

dnl
dnl Command line tools
dnl

# Checks for programs.
AC_PROG_CC
AC_PROG_FC

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

# Checks for library functions.
AC_ARG_WITH([etree-include-path],
[AS_HELP_STRING([--with-etree-include-path],
[location of the Etree headers])],
[ETREE_INCL="-I$withval"],
[ETREE_INCL=""])
AC_ARG_WITH([etree-lib-path],
[AS_HELP_STRING([--with-etree-lib-path], [location of the Etree libraries])],
[ETREE_LIB="-L$withval -letree"],
[ETREE_LIB="-letree"])

# Get required Proj.4 library and include locations
AC_ARG_WITH([proj4-include-path],
[AS_HELP_STRING([--with-proj4-include-path],
[location of the Proj.4 headers])],
[PROJ4_INCL="-I$withval"],
[PROJ4_INCL=""])
AC_ARG_WITH([proj4-lib-path],
[AS_HELP_STRING([--with-proj4-lib-path], [location of the Proj.4 libraries])],
[PROJ4_LIB="-L$withval -lproj -pthread"],
[PROJ4_LIB="-lproj -pthread"])

# Check required ETREE installation
CFLAGS="$ETREE_INCL $CHECK_CFLAGS"
LDFLAGS="$CHECK_LDFLAGS $ETREE_LIB"
AC_CHECK_LIB(etree, etree_open, [AC_CHECK_HEADER([etree.h], [], [AC_MSG_ERROR(["Etree headers not found in $ETREE_INCL; use --with-etree-include-path"])], [AC_INCLUDES_DEFAULT])],[AC_MSG_ERROR(["Etree library not found; use --with-etree-lib-path"])])

# Check required PROJ4 installation
CFLAGS="$PROJ4_INCL $CHECK_CFLAGS"
LDFLAGS="$CHECK_LDFLAGS $PROJ4_LIB"
AC_CHECK_LIB(proj, pj_init_plus, [AC_CHECK_HEADER([proj_api.h], [], [AC_MSG_ERROR([Proj4 header not found in $PROJ4_INCL; use --with-proj4-include-path"])
], [AC_INCLUDES_DEFAULT])],[AC_MSG_ERROR(["Proj4 library not found; use --with-proj4-lib-path"])], [-pthread -lm])

# Set final CFLAGS and LDFLAGS
CFLAGS="$CHECK_CFLAGS $ETREE_INCL $PROJ4_INCL"
LDFLAGS="$CHECK_LDFLAGS $ETREE_LIB $PROJ4_LIB"
LDFLAGS="$LDFLAGS -lm"

AC_CONFIG_FILES([Makefile
data/Makefile
src/Makefile
tests/Makefile])
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_RANLIB
AC_PROG_LN_S

dnl CURL (used to download model files)
AC_PATH_PROG(CURL, curl)
if test -z "$CURL" ; then
AC_MSG_FAILURE([cannot find 'curl' program.])
CURL=`echo "Error: curl is not installed." ; false`
fi

dnl TAR
AC_PATH_PROG(TAR, tar)
if test -z "$TAR" ; then
AC_MSG_FAILURE([cannot find 'tar' program.])
TAR=`echo "Error: tar is not installed." ; false`
fi

dnl
dnl Setup environment so dependencies are used in build
dnl

CFLAGS="$CFLAGS"
CPPFLAGS="-I$prefix/include $CPPFLAGS"
LDFLAGS="-L$prefix/lib -L$prefix/lib64 $LDFLAGS"

dnl
dnl Verify configuration
dnl

dnl ETREE (required)
if test "$install_etree" = yes ; then
ETREE_INCLUDES=""
ETREE_LDFLAGS="-letree"
else
SCEC_ETREE_HEADER
SCEC_ETREE_LIB
fi
if test "$with_etree_incdir" != no ; then
ETREE_INCLUDES="-I$with_etree_incdir"
fi
if test "$with_etree_libdir" != no ; then
ETREE_LDFLAGS="-L$with_etree_libdir -letree"
fi

AC_SUBST(ETREE_INCLUDES)
AC_SUBST(ETREE_LDFLAGS)

dnl proj (required)
if test "$install_proj" = yes ; then
dnl sqlite (required by proj)
if test "$install_sqlite" = yes ; then
SQLITE3_INCLUDES="-I$prefix/include"
SQLITE3_LDFLAGS="-L$prefix/lib"
else
if test "$with_sqlite_incdir" != no; then
SQLITE3_INCLUDES="-I$with_sqlite_incdir"
fi
if test "$with_sqlite_libdir" != no; then
SQLITE3_LDFLAGS="-L$with_sqlite_libdir"
fi
SCEC_SQLITE3_HEADER
SCEC_SQLITE3_LIB
fi
AC_SUBST(SQLITE3_INCLUDES)
AC_SUBST(SQLITE3_LDFLAGS)

dnl tiff (required by proj)
if test "$install_tiff" = yes ; then
TIFF_INCLUDES="-I$prefix/include"
TIFF_LDFLAGS="-L$prefix/lib"
else
if test "$with_tiff_incdir" != no; then
TIFF_INCLUDES="-I$with_tiff_incdir"
fi
if test "$with_tiff_libdir" != no; then
TIFF_LDFLAGS="-L$with_tiff_libdir"
fi
SCEC_TIFF_HEADER
SCEC_TIFF_LIB
fi
AC_SUBST(TIFF_INCLUDES)
AC_SUBST(TIFF_LDFLAGS)

PROJ_INCLUDES="-I$prefix/include"
PROJ_LDFLAGS="-L$prefix/lib"
else
SCEC_PROJ_HEADER
SCEC_PROJ_LIB
fi
if test "$with_proj_incdir" != no ; then
PROJ_INCLUDES="-I$with_proj_incdir"
fi
if test "$with_proj_libdir" != no ; then
PROJ_LDFLAGS="-L$with_proj_libdir -lproj"
fi
AC_SUBST(PROJ_INCLUDES)
AC_SUBST(PROJ_LDFLAGS)




AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)

AC_CONFIG_FILES([
Makefile
src/Makefile
dependencies/Makefile
data/Makefile
])

AC_OUTPUT

AM_CONDITIONAL([BUILD_SHARED_LIBRARY], [test "$enable_shared" = yes])
if test "$enable_shared" = yes; then
AC_MSG_NOTICE([Building shared libraries. UCVM must be built with shared libraries for plugins to work.])
else
AC_MSG_WARN([Building static libraries. Shared libraries are not enabled.])
fi


dnl End of file
30 changes: 26 additions & 4 deletions data/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,30 @@ AM_CFLAGS = ${CFLAGS}
AM_FCFLAGS = ${FCFLAGS}
AM_LDFLAGS = ${LDFLAGS}

all:
if WITH_CCA_LARGEDATA_DIR
echo "USING WITH_CCA_LARGEDATA_DIR in cca"
else
./make_data_files.py
endif

install:
mkdir -p ${prefix}/data
cp ./config ${prefix}/data
cp -R ./i* ${prefix}/data
chmod +x ${prefix}/data/i06
if WITH_CCA_LARGEDATA_DIR
if [ ! -d "${prefix}/data/i06" ]; then \
$(MKDIR_P) ${prefix}/data; \
$(LN_S) -f $(CCA_LARGEDATA_DIR) ${prefix}/data/i06; \
echo "USING WITH_CCA_LARGEDATA_DIR in cca"; \
fi
cp config ${prefix}/data
else
if [ ! -d "${prefix}/data/i06" ]; then \
$(MKDIR_P) ${prefix}/data; \
mv i06 ${prefix}/data; \
$(LN_S) -f ${prefix}/data/i06 .; \
fi
cp config ${prefix}/data
endif

clean:
echo "clean"

Loading