Difference between revisions of "UCVM User Guide"
Line 351: | Line 351: | ||
|- | |- | ||
| ucvm | | ucvm | ||
− | | USGS NED 1 arcsec DEM, and Wills-Wald Vs30 | + | | USGS NED 1 arcsec DEM, and Wills-Wald Vs30 (default) |
|- | |- | ||
| yong | | yong |
Revision as of 18:41, 18 August 2011
Contents
- 1 Overview
- 2 Requirements
- 3 Installation
- 4 Configuration
- 5 Framework Description
- 6 Extracting Values from UCVM
- 7 History of UCVM Releases
- 8 Acknowledgements and Contact Info
- 9 References
- 10 Miscellaneous Technical Notes
- 11 License and Disclaimer
Overview
UCVM is a software framework for creating and distributing a state-wide California velocity model.
Requirements
The system requirements are as follows:
- UNIX operating system (Linux, Solaris, MacOS)
- GNU gcc/gfortran compilers (MPI wrappers such as mpicc are OK)
- tar for opening the compressed files
- Euclid Etree library Euclid Etree
- Proj.4 projection library Proj.4
Installation
Download
- Start at SCEC website: http://scec.usc.edu/scecpedia/UCVM
- Navigate to the Downloads section of the UCVM web page.
- Click the download link to download the latest source code distribution file and any listed dependencies. This is typically posted as a tar and gzipped file (tgz format). The source code distribution file is large (280 Mb), so the download make take awhile.
CheckSum Test
Not currently implemented.
Basic Install
The general steps for installing UCVM are:
- Install Etree and Proj.4 packages
- Install one or more velocity models
- Define environment variables describing where Etree/Proj.4/models are located
- Run the UCVM installer
First, install the Etree and Proj.4 packages which are required by UCVM. The INSTALL/README instructions in each distribution describe how to install them,
but generally:
For the Euclid Etree library:
% tar xvf euclid-latest.tar % cd ./euclide-3.12/libsrc % make all
If installing the Etree library on a Lustre filesystem (NICS Kraken, TACC Ranger, NCCS Jaguar), you must enable IOBUF. Please see Cvmbycols#Technical_Note_for_Lustre_Filesystems for special installation instructions.
For the Proj.4 library:
% tar xvf proj-4.7.0.tar % cd proj-4.7.0 % ./configure --prefix=<your desired install directory> % make; make install
Be sure to note where you installed these two packages. You will need this information later in the installation process.
Then, install the velocity models that you wish to use with UCVM. Ensure they are compiled with gcc/gfortran.
For the SCEC CVM-H model:
% tar xvf cvmh-11.9.0.tgz % cd cvmh % make all
For the SCEC CVM-S model:
% tar xvf cvms-11.9.0.tgz % cd cvms/src % make all
Again, be sure to note where you installed the community velocity models.
Declare environment variables with the paths to the Etree library, Proj.4 library, and velocity models that you previously installed.
ETREE_DIR=<Etree install path> PROJ4_DIR=<Proj.4 install path> CVMH_DIR=<CVM-H install path> CVMS_DIR=<CVM-S install path>
In a bash shell, for example, the ETREE_DIR environment variable can be declared with the command:
% ETREE_DIR=/opt/etree;export ETREE_DIR
In a csh shell:
% setenv ETREE_DIR /opt/etree
Now unpack the UCVM software distribution:
% tar zxvf ucvm-11.9.0.tar.gz
The build configuration differs slightly depending on where you wish to run UCVM. On a standard Linux system with gcc, run the following commands to build the software with CVM-H and CVM-S enabled:
% cd ucvm-11.9.0 % ./configure --prefix=${UCVM_INSTALL_DIR} --with-etree-include-path="${ETREE_DIR}/libsrc" --with-etree-lib-path="${ETREE_DIR}/libsrc" --with-proj4-include-path="${PROJ4_DIR}/include" --with-proj4-lib-path="${PROJ4_DIR}/lib" --with-cvmh-include-path="${CVMH_DIR}/include" --with-cvmh-lib-path="${CVMH_DIR}/lib" --with-gctpc-lib-path="${CVMH_DIR}/gctpc/lib" --with-cvms-include-path="${CVMS_DIR}/include" --with-cvms-lib-path="${CVMS_DIR}/lib" --with-cvmh-model-path="${CVMH_DIR}/bin" --with-cvms-model-path="${CVMS_DIR}/src" % make
Where "${UCVM_INSTALL_DIR}" is the target install directory of your choice. You may define it as an enviroment variable or just specify it directly as the argument to prefix. The above example used CVM-H and CVM-S but any of the following models may be enabled: SCEC CVM-H, SCEC CVM-S, SCEC CVM-SI, USGS CenCalVM, and WFCVM. For each velocity model you want to use, the configure script needs to know where to find the velocity model's library files (.a or .so), header files (.h), and model files so that they can be linked into UCVM.
Check that the package was built correctly with the following command:
% make check
Verify that all unit tests and acceptance tests pass.
Install the software to the desired target location with the following command:
% make install
A full list of supported standard velocity models and options can be listed with the command
% ./configure --help
Advanced Install
Additional options must be passed to the ./configure script on a more exotic Linux system, such as a host that requires static linking (NICS Kraken), or has a Lustre high-performace filesystem (TACC Ranger). The following example shows how to enable static linking and IOBUF buffering:
% cd ucvm-11.9.0 % module add iobuf % ./configure --prefix=${UCVM_INSTALL_DIR} --enable-static --enable-iobuf --with-etree-include-path="${ETREE_DIR}/libsrc" --with-etree-lib-path="${ETREE_DIR}/libsrc" --with-proj4-include-path="${PROJ4_DIR}/include" --with-proj4-lib-path="${PROJ4_DIR}/lib" --with-cvmh-include-path="${CVMH_DIR}/include" --with-cvmh-lib-path="${CVMH_DIR}/lib" --with-gctpc-lib-path="${CVMH_DIR}/gctpc/lib" --with-cvms-include-path="${CVMS_DIR}/include" --with-cvms-lib-path="${CVMS_DIR}/lib" --with-cvmh-model-path="${CVMH_DIR}/bin" --with-cvms-model-path="${CVMS_DIR}/src" CC=cc % make; make check; make install
A few notes:
- Some systems require applications to be linked statically (example above).
- Lustre filesystems require linking with IOBUF module (NICS Kraken example above).
- The configure script needs to be told where to find the library file(s), the header file(s), and the model files for each velocity model that you wish to enable. The configure script will check that the libraries and headers are present, and it will setup UCVM with that model enabled and properly configured.
- The script will attempt to auto-detect a GNU compliant compiler. If an MPI wrapper is found, the MPI version of UCVM is compiled, otherwise the serial version is built. The compiler may be overridden with the option 'CC="mpicc"' for example.
- Additional compiler flags and linker flags may be passed to ./configure with the CFLAGS and LDFLAGS options. Generally, this is not needed but allows the package to be built on platforms with specific compiling/linking requirements.
The full list of options follows:
--enable-static enable static linking --enable-iobuf enable IOBUF module --with-etree-include-path location of the Etree headers --with-etree-lib-path location of the Etree libraries --with-proj4-include-path location of the Proj.4 headers --with-proj4-lib-path location of the Proj.4 libraries --with-cencal-include-path location of the USGS CenCalVM headers --with-cencal-lib-path location of the USGS CenCalVM libraries --with-cencal-model-path location of the USGS CenCalVM high-rez etree --with-cencal-extmodel-path location of the USGS CenCalVM extended etree --with-cvmh-include-path location of the SCEC CVM-H headers --with-cvmh-lib-path location of the SCEC CVM-H libraries --with-cvmh-model-path location of the SCEC CVM-H model files --with-gctpc-lib-path location of the CVM-H GCTPC libraries --with-cvms-include-path location of the SCEC CVM-S headers --with-cvms-lib-path location of the SCEC CVM-S libraries --with-cvms-model-path location of the SCEC CVM-S model files --with-cvmsi-include-path location of the SCEC CVM-SI headers --with-cvmsi-lib-path location of the SCEC CVM-SI libraries --with-cvmsi-model-path location of the SCEC CVM-SI model files --with-wfcvm-include-path location of the WFCVM headers --with-wfcvm-lib-path location of the WFCVM libraries --with-wfcvm-model-path location of the WFCVM model files
Unit Tests
Unit tests may be executed with the command:
% make check
All tests should result in a PASS.
Acceptance Tests
Acceptance tests may be executed with the command:
% make check
All tests should result in a PASS.
Configuration
The UCVM installer sets up the configuration file (./conf/ucvm.conf) automatically. Yet there are a number of situations where you will want to modify this file, such as to add a new model.
Application Configuration ./conf/ucvm.conf
The following is an example configuration:
# UCVM config file # UCVM model path # # Change to reflect UCVM installation directory. # ucvm_modelpath=/home/scec-00/USER/opt/aftershock/ucvm-11.9.0/model/ucvm # Pre-defined models # # SCEC CVM-S cvms_modelpath=/home/scec-00/USER/opt/aftershock/cvms/src # # SCEC CVM-H cvmh_modelpath=/home/scec-00/USER/opt/aftershock/cvmh/bin # # USGS Bay Area high-rez and extended etrees cencal_modelpath=/home/scec-00/USER/opt/etree/USGSBayAreaVM-08.3.0.etree cencal_extmodelpath=/home/scec-00/USER/opt/etree/USGSBayAreaVMExt-08.3.0.etree # # SCEC CVM-SI cvmsi_modelpath=/home/scec-00/USER/opt/aftershock/cvmsi/model # # Wasatch Front CVM wfcvm_modelpath=/home/scec-00/USER/opt/aftershock/wfcvm/src # # Lin-Thurber Statewide lin-thurber_modelpath=/home/scec-00/USER/opt/aftershock/ucvm-11.9.0/model/lin-thurber # # Cape Mendocino RG cmrg_modelpath=/home/scec-00/USER/opt/aftershock/ucvm-11.9.0/model/cmrg # User-defined models # # Change to reflect paths to user model files # # Current supported interfaces: model_etree, model_patch # #user1_interface=model_etree #user1_modelpath=/home/username/model_etree/user1.etree #user2_interface=model_patch #user2_modelpath=/home/username/model_patch/user2.conf # User-defined maps # # Change to reflect paths to user map files # # Current supported interfaces: map_etree # # Optional Yong-Wald vs30 map yong_interface=map_etree yong_mappath=/home/scec-00/USER/opt/aftershock/ucvm-11.9.0/model/ucvm/ucvm_yong_wald.e # Model flags # #cvmh_param=USE_1D_BKG,True
The following table describes each configuration item, where "*" indicates the model/map label. Model/map labels can be predefined strings such
as "cmvh" for CVM-H, or any arbitrary string label for the case of a user-defined model.
Key | Value(s) | Description |
---|---|---|
ucvm_modelpath | ${UCVM_INSTALL_DIR}/model/ucvm | Directory containing the default projection specification and UCVM DEM/Vs30 Etree map. |
*_modelpath | A directory, URL, or file | String identifying location of model's primary or high-rez data |
*_extmodelpath | A directory, URL, or file | String identifying location of model's extended data (required for USGS CenCalVM extended Etree). |
*_interface | Models: model_etree, model_patch Maps: model_map |
The interface code needed to parse this user-defined model/map. |
*_mappath | A directory, URL, or file | String identifying location of user-defined map Etree |
*_param | Flag,Value | Set a model-specific configuration Flag to Value. The only defined flag currently is USE_1D_BKG for CVM-H, for toggling the 1D background model. |
Supported Standard Velocity Models
UCVM has built-in support for a number of standard community velocity models (CVMs). These standard models are referenced in ucvm_query and the API by their string labels. The following table lists the labels for these predefined CVMs. These are reserved labels and cannot be used for a user-defined model.
Note that "predefined" does not necessarily mean "installed". These are models that UCVM can query if it is linked with that model's libraries at install time. Some are pre-linked, such as lin-thurber and cmrg, the rest must be explicitly linked at install.
Label | Model |
---|---|
cvmh | SCEC CVM-H |
cvms | SCEC CVM-S |
cencal | USGS Bay Area CenCalVM |
cvmsi | SCEC CVM-SI |
wfcvm | Wasatch Front CVM (Utah) |
lin-thurber | Lin-Thurber California Statewide (included in UCVM and pre-linked) |
cmrg | Cape Mendocino Rob Graves (included in UCVM and pre-linked) |
Supported Standard Maps
UCVM has built-in support for a number of standard maps for California. These standard maps contain elevation data (DEM) and Vs30 data for the region and are referenced in ucvm_query and the API by their string labels. The following table lists the labels for these predefined maps. These are reserved labels and cannot be used for a user-defined map.
Label | Map |
---|---|
ucvm | USGS NED 1 arcsec DEM, and Wills-Wald Vs30 (default) |
yong | USGS NED 1 arcsec DEM, and Yong-Wald Vs30 |
Adding New Velocity Models
Enabling Another Standard Velocity Model After Installation
If after installation you wish to link in another standard velocity model, you must re-install UCVM using the process described in UCVM_User_Guide#Installation. Add the configure options appropriate for the new model you wish to link into UCVM.
Upgrading the Version of a Standard Velocity Model After Installation
Generally, UCVM must be recompiled and re-installed using the new model libraries and headers. However, if you are certain that only the model files have changed (and the query interface has NOT changed), you can simply update that model's modelpath configuration in ${UCVM_INSTALL_DIR}/conf/ucvm.conf to reference the new files.
Using Multiple Versions of a Supported Velocity Model Simultaneously
Not supported.
Adding a User-defined Velocity Model
UCVM may be extended to support any user-defined velocity model. The simplest way to add a new model is to store that model as a SCEC Etree or Patch Model, and update ${UCVM_INSTALL_DIR}/conf/ucvm.conf with the model interface andpath. For example:
For SCEC Etrees:
user1_interface=model_etree user1_modelpath=/home/username/model_etree/user1.etree
For Patch models:
user2_interface=model_patch user2_modelpath=/home/username/model_patch/user2.conf
SCEC Etrees can be created with the ./bin/ucvm2etree utility. Patch models can be created with the ./bin/patchmodel utility.
For other models that either are represented by tables, or have their own native API, UCVM may be extended to query from these models. However, this requires code modifications to the core UCVM library located in ./src/ucvm and recompilation. The general steps are:
- Define new model label UCVM_MODEL_MODELNAME in ucvm_dtypes.h
- Create ucvm_model_modelname.h/.c containing the glue code that links the UCVM query interface to the native model interface
- Modify ./src/ucvm/ucvm.c:
- Add ucvm_model_modelname.h include at top
- Add model lookup to ucvm_add_model() function
- Modify ./src/ucvm/Makefile.am:
- Add ucvm_model_modelname.o to list of libucvm.a dependencies
- Reconf Makefiles with ./scripts/autoconf/reconf.sh
- Recompile UCVM, passing the following options to configure:
- Path to the native model header files with: CFLAGS='-I<hdr_path>'
- Path to the native model library files with: LDFLAGS='-L<lib_path> -l<libname>"
Adding a User-defined Map
Update ${UCVM_INSTALL_DIR}/conf/ucvm.conf with the map interface and Etree path:
usermap1_interface=map_etree usermap2_mappath=/home/username/maps/usermap1.e
User-defined maps can be created with the ./bin/grd2etree utility.
Framework Description
Utilities
ucvm_query
ucvm2etree
grd_query
grd2etree
patchmodel
ecompact
ecoalesce
C Application Programming Interface
A detailed description of the API can be found in UCVM API.
Extracting Values from UCVM
Two methods are provided for extracting material properties from UCVM: command-line tools, and a C API. These are described in the sections below. The following table summarizes the model features supported by each interface:
Extracting Values on the Command Line
The ucvm_query utility is provided for querying a set of community velocity models. Points may either be input interactively or via a text file, and can be either (lon, lat, elevation) or (lon, lat, depth).
The following output shows an interactive example on three points (followed by a Cntl-D to terminate input) using the CVM-S model. Starting in the UCVM installation directory, enter these commands:
% cd bin % ./ucvm_query -m cvms -f ../conf/ucvm.conf Using Geo Depth coordinates as default mode. -118.0 34.0 0.0 -118.0 34.0 100.0 -118.0 34.0 1000.0 <Cntrl-D> -118.0000 34.0000 0.000 295.679 390.000 cvms 696.491 213.000 1974.976 none 0.000 0.000 0.000 crust 696.491 213.000 1974.976 -118.0000 34.0000 100.000 295.679 390.000 cvms 1683.174 603.470 2130.773 none 0.000 0.000 0.000 crust 1683.174 603.470 2130.773 -118.0000 34.0000 1000.000 295.679 390.000 cvms 3660.809 2056.628 2443.042 none 0.000 0.000 0.000 crust 3660.809 2056.628 2443.042
Similarly, here is an example for the CVM-H model:
% cd bin % ./ucvm_query -m cvmh -f ../conf/ucvm.conf Using Geo Depth coordinates as default mode. -118.0 34.0 0.0 -118.0 34.0 100.0 -118.0 34.0 1000.0 -118.0000 34.0000 0.000 295.679 390.000 cvmh 824.177 195.000 1084.062 none 0.000 0.000 0.000 crust 824.177 195.000 1084.062 -118.0000 34.0000 100.000 295.679 390.000 cvmh 2371.500 727.748 2051.320 none 0.000 0.000 0.000 crust 2371.500 727.748 2051.320 -118.0000 34.0000 1000.000 295.679 390.000 cvmh 2616.063 1082.813 2127.783 none 0.000 0.000 0.000 crust 2616.063 1082.813 2127.783
Extracting Values in a C Program
Described in UCVM API.
History of UCVM Releases
Acknowledgements and Contact Info
Support for the development and maintenance of the CVM-H model has been provided by the Southern California Earthquake Center (SCEC). SCEC is funded by NSF Cooperative Agreement EAR-0106924 and USGS Cooperative Agreement 02HQAG0008.
Contributions to this manual were made by: Patrick Small, and Philip Maechling.
Please email software@scec.org for help on downloading and using UCVM, and for any suggestions for the delivery of the code or for this manual.
Please reference at least Small et al (2011) if you use this software framework; other references should be considered, depending on the purpose.
References
- Ely, G., T. H. Jordan, P. Small, P. J. Maechling (2010), A Vs30-derived Near-surface Seismic Velocity Model Abstract S51A-1907, presented at 2010 Fall Meeting, AGU, San Francisco, Calif., 13-17 Dec. [Ely2010-AGU.pdf]
- Graves, R. (1994), Rupture History and Strong Motion Modeling of the 1992 Cape Mendocino Earthquake, USGS External Grant Report
- Lin, G., C. H. Thurber, H. Zhang, E. Hauksson, P. Shearer, F. Waldhauser, T. M. Brocher, and J. Hardebeck (2010), A California statewide three-dimensional seismic velocity model from both absolute and differential Times, Bull. Seism. Soc. Am., 100, in press. supplemental
- Small, P., P. Maechling, T. Jordan, G. Ely, and R. Taborda (2011), SCEC UCVM - Unified California Velocity Model, in 2011 Southern California Earthquake Center Annual Meeting, Proceedings and Abstracts, vol. TBD, p. TBD.
- Taborda R., López J., O'Hallaron D., Tu T. and Bielak J. (2007), A review of the current approach to CVM-Etrees, SCEC Annual Meeting, Palm Springs, CA, USA, September 8–12. [1]
- Wald, D. J., and T. I. Allen (2007), Topographic slope as a proxy for seismic site conditions and amplification, Bull. Seism. Soc. Am., 97 (5), 1379-1395, doi:10.1785/0120060267.
- Wills, C. J., and K. B. Clahan (2006), Developing a map of geologically defined site-condition categories for California, Bull. Seism. Soc. Am., 96 (4A), 1483-1501, doi:10.1785/0120050179.
- Yong, A., Hough, S.E., Iwahashi, J., and A. Braverman (2012), A terrain-based site conditions map of California with implications for the contiguous United States, Bull. Seism. Soc. Am., accepted.
Miscellaneous Technical Notes
License and Disclaimer
License
Copyright (c)2011 Southern California Earthquake Center (SCEC) and the University of Southern California (USC). This copyright applies to the UCVM codebase as a whole, or any individual distributed applications. The individual contributions of government employees, which may be identified on a per-file basis using Subversion (SVN) (see developer site), are in the public domain.
The software and content provided on this website are made available under the terms of the Apache License, Version 2.0. A copy of the License is provided by the Apache Software Foundation (http://www.apache.org/licenses/LICENSE-2.0).
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Disclaimer
THIS SOFTWARE AVAILABLE ON THE UCVM WEBSITE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE SOUTHERN CALIFORNIA EARTHQUAKE CENTER (SCEC), THE UNIVERSITY OF SOUTHERN CALIFORNIA (USC), OR ANY OF THEIR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Without limiting the foregoing, SCEC and USC make no warranty that:
1. The software will meet your requirements.
2. The software will be uninterrupted, timely, secure or error-free.
3. The results that may be obtained from the use of the software will be effective, accurate or reliable.
4. The quality of the software will meet your expectations.
5. Any errors in the software obtained from the UCVM web site will be corrected.
Software and its documentation made available on the UCVM web site:
6. Could include technical or other mistakes, inaccuracies or typographical errors. UCVM contributors may make changes to the software or documentation made available on its web site.
7. May be out of date and SCEC, its contributors, and USC make no commitment to update such materials.
SCEC, its contributors, and USC assume no responsibility for errors or
omissions in the software or documentation available from the UCVM web site.
In no event shall SCEC, its contributors, or USC be liable to you or any third parties for any special, punitive, incidental, indirect or consequential damages of any kind, or any damages whatsoever, including, without limitation, those resulting from loss of use, data or profits, whether or not SCEC, its contributors, or USC has been advised of the possibility of such damages, and on any theory of liability, arising out of or in connection with the use of this software.
The use of the software downloaded through the UCVM site is done at your own discretion and risk and with agreement that you will be solely responsible for any damage to your computer system or loss of data that results from such activities. No advice or information, whether oral or written, obtained by you from SCEC, the UCVM website, its contributors, or USC shall create any warranty for the software.