function [sa, sigma] = C_1997_vert(M, R, T, Fault_Type, Soil, D)
% by Jack Baker, 2/1/05
% Stanford University
% bakerjw@stanford.edu
%
% Compute the Campbell attenuation prediction for vertical motions (1997
% Seismological Research Letters, Vol 68, No 1, p128).
%
% Note that this function makes a call to the external function
% "campbell_atten" to compute the horizontal attenuation prediction. Make
% sure that you have this function located in a directory accessible to
% Matlab.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% INPUT
%
% M = earthquake magnitude
% R = closest distance to fault rupture
% T = period of vibration
% Fault_Type = 0 for strike-slip fault
% = 1 for reverse, thrust, reverse-oblique, and thrust-oblique fault
% Soil = 0 for soil
% = 1 for soft rock
% = 2 for hard rock
% D = depth to basement bedrock (km)
%
% OUTPUT
%
% sa = median spectral acceleration prediction
% sigma = logarithmic standard deviation of spectral acceleration
% prediction FOR AN ARBITRARY OR AVERAGE COMPONENT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% interpolate between periods if neccesary
period = [0.05, 0.075, 0.10, 0.15, 0.20, 0.30, 0.50, 0.75, 1.00, 1.50, 2.00, 3.00, 4.00];
if (length(find(period == T)) == 0)
index_low = sum(period