CVM-T User Guide

From SCECpedia
Revision as of 23:02, 28 October 2010 by Patrices (talk | contribs)
Jump to navigationJump to search

CVM-H

Requirements

Installation

Known Issues

cvm2mesh

Requirements

integer, parameter :: ibig = 10000000
# CVM-4 Makefile
all: cvm4_txt cvm4_bin cvm4_mpi
cvm4_txt: cvm4.f iotxt.f
       gfortran -Wall -O3 cvm4.f iotxt.f -o cvm4_txt
cvm4_bin: cvm4.f iobin.f
       gfortran -Wall -O3 cvm4.f iobin.f -o cvm4_bin
cvm4_mpi: cvm4.f iompi.f
       gfortran -Wall -O3 cvm4.f iobin.f -o cvm4_mpi
clean:
       rm *.o *~ cvm4_txt cvm4_bin cvm4_mpi


Installation

  • If you wish to extract meshes from CVM-4, it must be installed (see requirements).
  • Update ./src/Makefile with paths to the CVM-H library libvxapi.a and system compilers. Execute 'make' to build all meshing executables.


Generating a Mesh

  • Prepatory steps
    • Determine meshing region, projection to use (CMU or UTM), and desired dimensions.
    • Determine if CVM can be pre-staged before the job executes. One copy of each CVM (model, extraction binary) is required per core in the MPI extraction job. Some computing resources (jaguar, kraken, ranger) have a permanent scratch space where these CVMs may be staged before the job executes, while others (USC HPCC) have scratch space that exists only while the job is in progress.
    • If CVM pre-staging is possible and desired, copy N copies of the CVM to your scratch space. Example pbs scripts which perform this task can be found in ./pbs.
  • Create extraction configuration file, that defines the following properties:
    • cvmtype: CVM4 or CVMH
    • cvmdir: Root directory containing pre-staged CVM if using that option, or CVM install directory that mesh-create-MPI will use to stage the data itself
    • spacing: grid spacing in meters
    • proj: UTM or CMU
    • rot: rotation angle in degrees, only used in UTM mode
    • lon: longitude of SW corner of mesh box
    • lat: latitude of SW corner of mesh box
    • dep: starting depth in km from free surface
    • x-size: length along x-axis in km
    • y-size: length along y-axis in km
    • z-size: length along z-axis in km. NOTE: Ensure (z-size/spacing) is equally divisible by your anticipated number of cores
    • vp_min: vp to assign when model vs < vs_min in m/s
    • vs_min: vs to assign when model vs < vs_min in m/s
    • outputfile: Name of final mesh file
    • format: Output format, IJK-12, IJK-20, IJK-32, SORD
# Example cvm2mesh config file for IJK12 CVM4 extraction
cvmtype=CVM4
cvmdir=/lustre/widow1/scratch/spatrick/tmp/cvm4
spacing=80
proj=UTM
rot=-45.42589966
lon=-122.500798753
lat=35.796092162
dep=0
x_size=810
y_size=400
z_size=84.8
vp_min=0
vs_min=0
outputfile=/lustre/widow1/proj/geo008/yfcui/w2w1hz40m_SN_cvmH/input/mesh_m8_cvm4_ijk12_1hz
meshtype=IJK-12
  • Create PBS job submission script
  • Submit extraction job to job scheduler
  • Check mesh for correctness


Known Issues

cvmtest

Requirements

Installation

Known Issues

viz-cvm

The viz-cvm package contains scripts for plotting slices and profiles from either CVM-H, CVM-4, or 3D meshes.


Requirements

integer, parameter :: ibig = 10000000
# CVM-4 Makefile
all: cvm4_txt cvm4_bin cvm4_mpi
cvm4_txt: cvm4.f iotxt.f
       gfortran -Wall -O3 cvm4.f iotxt.f -o cvm4_txt
cvm4_bin: cvm4.f iobin.f
       gfortran -Wall -O3 cvm4.f iobin.f -o cvm4_bin
cvm4_mpi: cvm4.f iompi.f
       gfortran -Wall -O3 cvm4.f iobin.f -o cvm4_mpi
clean:
       rm *.o *~ cvm4_txt cvm4_bin cvm4_mpi


Installation

  • If you wish to plot slices from CVM-H/CVM-4, the CVMs must be installed (see requirements).
  • Within your CVM-4 installation directory, install the following shell script, run_cvm4_gely.sh:
#!/bin/bash
# CVM-4 helper script that abstracts stdin, stdout redirection
IN_FILE=$1
OUT_FILE=$2
CVMBIN=cvm_txt
./${CVMBIN} < ${IN_FILE} > ${OUT_FILE}
if [ $? -ne 0 ]; then
    exit 1
fi
exit 0

An equivalent script for CVM-H is already present in the official CVM-H distribution.

  • Update CVM-H/CVM-4 installation paths in Slice.py
# CVM Constants
cvmh_dir = '/home/rcf-104/patrices/cvmh/trunk/bin'
cvmh_bin = './run_vx_lite.sh'
cvm4_dir = '/home/rcf-104/patrices/utils/cvm4_gely'
cvm4_bin = 'run_cvm4_gely.sh'


Plotting from a CVM

Supported plot types include horizontal slices from either CVM, horizontal difference (CVM-H - CVM-4) slice, and profile slices from either CVM or both.

./Slice.py <map_type> <outfile> <map_parameters>

where:

  • map_type: hor/prof/hordiff
  • outfile: Name of PNG plot
  • hor map_parameters: depth, value_type, source (CVM-H, CVM-4, Both)
  • hordiff map_parameters: depth, value_type
  • prof map_parameters: lon1, lat1, lon2, lat2, value_type, source (CVM-H, CVM-4, Both)
    • value_type: Vp, Vs, Rho, Topo, Vs30, Z2500


Plotting from a mesh

Supported plot types include horizontal slices and profile slices from either SORD or AWP formatted meshes.

./PlotGrid.py <map_type> <mesh_file> <outfile> <title> <map_params>

where:

  • map_type: hor, prof
  • mesh_file: Name of the SORD or AWP formatted mesh.
  • outfile: name of PNG plot
  • title: Title for the plot
  • hor map_parameters: k_offset, imax, jmax, kmax, decimation, source, value_type
  • prof map_parameters: imax, jmax, kmax, p1_x, p1_y, p2_x, p2_y, depth, decimation, source, value_type
    • value_type: Vp, Vs, Rho
    • source: IJK-32, IJK-20, IJK-12, SORD


Known Issues

Small scale slices or highly decimated slices may take on a pixellated look. This is due to a low pixel density in the plots. The work-around is to reduce the decimation factor or increase the size of the slice.