This is the first new release since 2016, and there have been a thousands of lines of code changes under the hood to make this a bump-up to a major release (v3.0.5 –> v3.1.0).
The most significant change has been the addition of support for path-dependent travel-time uncertainties when used with an appropriate model. This version of RSTT is being distributed with a new model, pdu2020012Du.geotess
, which is prefixed with “pdu” to signify that it’s a “path-dependent uncertainty”-type RSTT model. The old model, rstt201404um
, has not yet been removed because it is still used for running tests during the build process.
PDU-type models are automatically detected by RSTT, and calls to get travel-time uncertainty are automatically sent to the new algorithm which computes path-dependent travel-time uncertainty. If an old-style model is used, calls fall back to the old 1D travel-time uncertainty computation. If the user wishes to perform the old 1D travel-time uncertainty computation while using a new PDU-type model, new function calls have been provided with a “1D” suffix (e.g., getTravelTimeUncertainty()
vs. getTravelTimeUncertainty1D()
).
While the number of individual code changes is too large to put in a changelog, a summary of some of the more notable changes are lited below.
Support for PDU-type (path-dependent uncertainty) models
Inclusion of a new PDU-type model (pdu2020012Du.geotess
)
Simple usage examples in each language (C++, C, Java, Fortran)
A revamped README, viewable in HTML or Markdown
Completely rewritten Makefiles and build process, eliminating the need for setting environment variables such as LD_LIBRARY_PATH
Completely updated Doxygen and Javadoc documentation
Updated included version of GeoTess C++ from 2.2.2 to 2.2.3
Elimination of all previous compiler warnings
Many bugfixes and improvements
Changes to allow SLBM to be compiled on the latest version of MAC OSX. Also made model rstt201404um
the default model delivered with the software.
Improved the computational performance of the natural neighbor interpolation algorithm in geotess, which speeds up SLBM as well.
Fixed a bug that prevented SLBM from writing models to disk using file format 3 when the appropriate tessellation directory was not present.
Replaced the grid used in SLBM Version 2 with GeoTess, a general-purpose Earth model parameterization for 2D and 3D Earth models. For more information about GeoTess, visit the website at http://www.sandia.gov/geotess.
The change to GeoTess introduced a couple of new model storage formats which are described in SLBM_Design.pdf
Made modifications to the makefile and minor mods to code in order to get code to compile on Windows (Brian Kraus). Can now build and run the C++, C and Fortran interfaces on Windows using Visual Studio compiler. Java interface does not currently work on windows
No code changes. Added new model while in Vienna delivering to the IDC.
Changed compiler flags for Mac builds so that now SLBM can be built on Macs with the gcc 4.2.1 compiler, which is the version delivered with Mac Xcode. All four SLBM interfaces (C++, C, Fortran and Java) now run on Mac, Linux, and Sun.
Changes to the main make file to facilitate building on Sun using gmake. To build on SunOS computers, users must use gmake, not make.
Renamed the SLBM_User_Guide
to SLBM_Installation_Guide
.
This release involved no changes to the SLBM code or to the RSTT model.
Overhauled the makefiles to make them easier to use and more consistent with each other.
Rewrote the User_Manual
to bring it up to date. Copied the content of the User_Manual
, which is in the doc directory, to a readme.txt file in the main SLBM_Root
directory. Readme.txt
is a simple ascii text file that is very easy to access from the command line.
Removed parameter ‘delta’ from createGreatCircle() in all interfaces, which will break existing code (sorry). This parameter proved to be very confusing to new users.
Added methods getPathIncrement() and setPathIncrement() which allow applications to get/set the step size of nodes along the headwave interface used to integrate travel time. This replaces the ‘delta’ parameter described above.
Changed the default value of MAX_DISTANCE
from 180
to 15
degrees and the default value of MAX_DEPTH
from 9999
to 200
km. SlbmInterface has getters and setters for these parameters if users wish to change the default values.
In the C and Fortran interfaces, but not C++ or Java, there were some inconsistencies in the method calls for getTravelTimeUncertainty() and getSlownessUncertainty(). These have been resolved but may cause issues for C and fortran applications. If old code does not work, see the html documentation for the affected method calls.
Fixed an extremely minor memory leak that occurred only as the program was terminating execution.
Other minor changes to get the code to compile on Mac computers.
The test applications for C++, C and Java, but not Fortran, were expanded with additional functionality. Formerly, these test applications performed only one test, a regression test. They now have an option to accept a model, phase, source position and receiver position and will print out basic information about the travel time, slowness, derivatives, etc. For more information, execute SLBM_Root/bin/slbmtestcc with no parameters.
Fixed some inaccuracies in the documentation.
Made minor code changes to address compiler warnings observed when the compiling the Linux version of the code.
Responded to review by the NEIC. Changed manner in which derivatives of tt with respect to lat, lon are computed.
Removed all derivatives of slowness from all interfaces.
Fixed bug related to computing derivative of tt with respect to depth that happened when depth step spanned the moho.
Changed default step size used to compute horizontal derivatives from .01
to .001
radians. Changed default step size used to compute depth derivatives from 0.01
km to 0.1
km. Added getters and setters for del_distance
and del_depth
, which are the step sizes for calculating horizontal and depth derivatives.
Added methods:
getDistAz()
- distance and azimuth from A to BmovePoint()
- from A, move distance azimuth to BgetPiercePointSource()
getPiercePointReceiver()
getGreatCircleLocations()
- get points along headwave interfacegetGreatCirclePoints()
- get nPoints between A and BgetGreatCirclePointsOnCenters()
- get nPoints between A and BIn the c and fortran interfaces, error codes returned by all the methods have been changed. The methods used to return 0
indicating no error, or 1
indicating an error occurred. The methods still return 0
when no error, but now return positive, non-zero error codes for error conditions.
Replaced all the test programs with new ones that perform a simple regression test. These new test programs are better examples of how to use slbm.
Fixed a bug in java interface that caused a very slow memory leak. Only the java interface is affected.
Added methods to return derivatives of slowness with respect to lat, lon and depth.
Modified SlbmInterface
methods setGridData()
and setActiveNodeData()
so that they now include depth as an argument. This means that it is now possible to change the depths of the tops of the interfaces in a model.
In the fortran interface, all methods used to be mixed case but have all been changed to lower case. This was required for the port to Linux.
Modified method GreatCircle_Xn::mnbrak()
to hopefully prevent infinite loop condition.
Ported all interfaces to Windows and to Linux.
Code changes to remove the discontinuitites from the derivatives of tt with respect to source position and spikes from second derivatives of tt with respect to source position. All derivatives are now smooth.
Sandia now holds the copyright to the code and it has been approved by Sandia for public release under the BSD open source license. There are now copyright notices, license agreements and disclaimers at the top of every source code file.
Made a change to Zhao equations, replacing 1.58e-4
with 1/r
. This dramatically improved the accuracy of the code for mantle events.
Also fixed a bug that generated segmentation faults when source depth was exactly equal to moho depth (to double precision).
Added a software disclaimer at the top of every source code file
Added methods to compute derivatives of travel time with respect to source location. New methods are:
get_dtt_dlat(double& dtt_dlat)
get_dtt_dlon(double& dtt_dlon)
get_dtt_ddepth(double& dtt_ddepth)
getSlowness(double& slowness)
getSlownessUncertainty(double& slownessUncertainty)
Renamed method getUncertainty()
to getTravelTimeUncertainty()
.
I also added methods to compute derivatives of slowness with respect to lat, lon and depth:
get_dsh_dlat(double& dsh_dlat)
get_dsh_dlon(double& dsh_dlon)
get_dsh_ddepth(double& dsh_ddepth)
but then commented them out because they produce slowness derivatives that are invalid. See file SLBM_Root\doc\slbm_derivatives.pdf
(the same directory as this file). I will fix these derivatives in a future version and make these methods available at that time.
All the files specifying travel time uncertainty as a function of distance were renamed. In previous versions, these files were named Uncertainty_[Pn|Sn|Pg|Lg].txt
. They have been renamed Uncertainty_[Pn|Sn|Pg|Lg]_TT.txt
in this release. Files containing slowness uncertainty were added to the same directories with names Uncertainty_[Pn|Sn|Pg|Lg]_Sh.txt
. These files were populated with slowness uncertainty values suggested by Steve Myers in an email to me (SB) on 1-22-2009.
Corrected equation for computing earth radius as a function of latitude. This makes only an insignificantly small difference ( > 0.1
msec).
Fixed bug that caused slbm to occasionally segmentation fault for Pg/Lg calculations when using TaupLoc
. What was happening was that a velocity stack was defined at the receiver with the bottom at the radius of the Moho at the receiver. The Taup model was constructed with only the velocity stack at the receiver. Then a source comes along where the Moho at the source position is deeper than the Moho at the receiver (and hence the bottom of the model). In addition, the source depth is deeper than the bottom of the taup model, causing taup to fail. This was fixed by modifying the way the taup model is built. Now we append a taup layer (in the taup model) that extends from the radius of the Moho at the receiver down to the center of the earth. Thatlayer is assigned the velocity of the lower crust at the receiver.
Note: It has been discovered that the compiler option to turn off name mangling required for use of C++ libraries within C and FORTRAN code prevents the compiler from correctly finding the rand() function in FORTRAN. At this point, this is the only function we have discovered to work this way -but others may be found in the future. At present, the work-around is to manually “decorate” the function call within the FORTRAN code. For example: rand()
function calls would change to rand_()
and rand(seed)
function calls would change to rand_(seed)
.
Added new target (STR) to the makefile to allow rebuilding a 32-bit stand- alone version of the SLBM_Root
from a SNL_Tool_Root
delivery.
Note: SNL_Tool_Root
only uses the core SLBM units (not any other language interfaces) and builds only the libslbm.so
library in 64-Bit mode.
This version contains bug fix to handle cases when the activenode range spans the dateline correctly. Also, includes Jim Hipp’s changes to the uncertainty units for compatibility w/PGL
/UtilLib
.
Made ch_max
(in SLBMInterface
) a static variable and renamed it to CH_MAX
defaulting to .2.
Made the function calls
void setCHMax(double chMax)
void getCHMax(double& chMax)
void setMaxDistance(double maxDistance)
void getMaxDistance(double& maxDistance)
void setMaxDepth(double maxDepth)
void getMaxDepth(double& maxDepth)
all static functions. This was done to allow the locator (LoCOO
) to be able to set the control parameters remotely.
Added defaulted depth dependence (defaults to 0.0
km) for the functions
double getUncertainty(double distance, double depth = 0.0)
double getVariance(double distance, double depth = 0.0)
Added new privated functions to evaluate uncertainty and variance given a depth index, distance index and distance weight.
double getUncertainty(double wdist, int idist, int idepth)
double getVariance(double wdist, int idist, int idepth)
Modified the getIndex(...)
function to return both the index and the weight given the input independent parameter position, x, and the vector containing the independent parameter positions. The input vector can by distance or depth.
void getIndex(double x, const vector& v, int& index, double& w)
Added the parameter vector errDepths to contain the depth positions. This parameter does not require a defintion if the input data is strictly distance dependent.
Modified the parameter vector errVal to a two dimensional vector defined by <vector> errval
. This is so a distance vector can be assigned for each depth defined in errDepths
.
Modified the function readFile(const string& filename)
to look on the first line for both the distance count and the new depth count. If the new depth count is not present it defaults to 1
. Modified the remainder of the function to handle depths if found.
Modified getBufferSize()
, serialize(...)
, and deserialize(...)
functions to output / input the new depth information.
This version contains bug fixes for segmentation faults for events in which the source and receiver coincide with each other, and for Pg events where source-receiver distance is greater than ~13
degrees. The slbmtestc and slbmtestcc test scripts were enhanced to include a stress test of the Pg calculations.
The major change in this release is that the travel time calculations for Pg/Lg phases have been modified to implement the algorithm described by Steve Myers in a memo which is also available on the secure server in Documents/SLBM_PgLgFix_Doc.pdf
.
Added new functions to Grid including
const int getBufferSize()
void loadVelocityModelBinary(util::DataBuffer& buffer)
void saveVelocityModelBinary(util::DataBuffer& buffer)
The first function retrieves the approximate size required of a DataBuffer
object to store the contents of the Grid
object. The next two functions read a Grid
object from an input DataBuffer
and save the contents of the Grid
into an input DataBuffer
object. These functions are required by PGL
to be able to store the SLBM model into an FDB.
Since PGL
really saves the an SLBMInterface
object these same functions were provided in SlbmInterface
to pass-through the request to the Grid object. In SlbmInterface
they are called by the same name. A new function to retreive the model path variable
const string& getModelPath()
was also added to the SlbmInterface
object.
I modified the Grid
object file base read function to extract the DataBuffer
read/write information into separate functions. This avoided duplicating the functionality in the new calls above. The calls separate out the input of geo stacks, layer connectivity and grid connectivity as well as initialization functionality. They are divided into the 4 functions below:
void readGeoStacks(util::DataBuffer& buffer)
void readConnectivity(util::DataBuffer& buffer, int& nNodes, vector& elev, vector& waterThick, vector& stackId)
void readTessellationData(util::DataBuffer& buffer, int nNodes, const vector& elev, const vector& waterThick, const vector& stackId, vector< vector >& triset)
void defineTessAdjacency(int nNodes, const vector< vector >& triset)
Finally, the Uncertainty class was modified so that it could be read from and written to by a DataBuffer
object. This included adding a constructor to serialize from a DataBuffer
, a function to retrieve the necessary buffer size, a function to serialize, and a function to deserialize. These functions are defined by
Uncertainty(util::DataBuffer& buffer)
const int getBufferSize()
void serialize(util::DataBuffer& buffer)
void deserialize(util::DataBuffer& buffer)
Also, I fixed a bug in the Uncertainty file read class where a pth “/” descriptor was missing. And I replaced the getUncertainty(…) functionality with a new implementation that uses a fast binary search to find the bracket values from then input distance.
Modified the way travel time for Pg/Lg phases is calculated. Previously, Pg/Lg travel times were computed with the Headwave method. Starting with this release, Pg/Lg travel times are computed with both the Headwave and TauP methods and the reported travel time is the lesser of the travel times calculated with the two methods. See SLBM_design.pdf
for more details. The SlbmInterface
method
getPgLgComponents(double* tTotal, double* tTaup, double* tHeadwave, double* rBottom)
has been added to all interfaces to facilitate evaluation of this new capability.
Added following methods to the interface(s):
getFractionActive ( double* fractionActive )
setMaxDistance ( const double* maxDistance )
getMaxDistance ( double* maxDistance )
setMaxDepth ( const double* maxDepth )
getMaxDepth ( double* maxDepth )
getPgLgComponents(double* tTotal, double* tTaup, double* tHeadwave, double* rBottom)
Added a section labeld “test_2_3_0_BETA_Changes()
” in each testscript (programming language) to exercise each new method.
Due to function name length limitations in some FORTRAN compilers, renamed all functions calls from “slbm_shell_xxx()
” to “slbm_xxx()
” in the FORTRAN interface. Additionally, further renamed functions:
slbm_getActiveNodeWeightsReceiver()
-> slbm_getActiveNodeWeightsRcvr()
slbm_getActiveNodeWeightsSource()
-> slbm_getActiveNodeWgtsSrc()
Modified the way CrustalProfile
objects are stored. Previously, all CrustalProfile
objects were stored in memory so that if they were called for again they would not have to be recomputed. This was a problem since the number of objects could grow until all available memory was consumed. Starting with this release, the number of source CrustalProfile
objects saved is limited to 10 and the number of receiver CrustalProfile
objects saved is limited to 1000
. When these limits are reached, the least-recently used objects are deleted from memory. These limits are hard-coded in the software but can be modified in the Grid
constructor in Grid.cc
.
Fixed the constructor in GreatCircle_Xg.cc
during the TauPSite
initialization to set the TauPSite
planet radius before setting the receiver depth.
Modified PGL TauP and SLBM code to utilize identical object definitions. This included: a) modifications to SLBM to wrap all of its objects into the single namespace slbm
; b) modifications to PGL/SLBM to wrap all TauP objects into a new namespace taup
; c) modifications to PGL/SLBM to wrap all utility objects used by both applications into a new namespace util
; d) renaming of the SLBM BaseObject.h
include file in SLBM to BaseGlobals.h
; e) splitting of the BaseGlobals.h
class into a non-namespaced basic definition which keeps the BaseGlobals
name and a new SLBMGlobals.h
file containing the specific definitions required by SLBM; f) the renaming of the PGL StandardDefines.h
file to PGLGlobals.h
; g) the removal of base definitions from PGLGlobals.h
and the inclusion of BaseGlobals.h
in PGL; h) a new TauPGlobals.h
file used by the taup
namespace; i) and a new UtilGlobals.h used by the util
namespace.
Each specific XXGlobal.h
file contains a windows definition for the DLL import/export tag along with any specific defintions (beyond BaseGlobals.h
) required by the namespace.
The taup
namespace now includes the objects TPVelocityModels
, TauPSiteFunctionals
, TauPSite
, and TauPModel
(used by PGL only). The util
namespace now includes MD50
, Brents
, and IntegrateFunction
objects. Once the DataBuffer
object in PGL is split into a new DataBufferDB
object and the base functionality included in the SLBM DataBuffer
object, then the low level DataBuffer
object will also become part of the util
namespace.
Converted the model files from ascii to binary format. The binary format is the one specified by AFTAC/QTSI. This change has resulted in a dramatic reduction in the time required to load the velocity models into memory.
The ascii format is still supported but support for ascii will be removed in the next release.
Added setters and getters for CHMax
and average mantle velocities. Added getTessId()
to retrieve tesselation ID of the model in memory. Refer to HTML documentation for further details.
Sandy Ballard, SNL
Added several methods to all the slbm interfaces to facilitate interaction with active nodes. Active nodes are nodes that fall within a user-specified latitud, longitude range. This functionality is really only useful to the tomographers.
Changed the grid from the deformed grid to the global tessellated grid.
Added method getVersion()
to all the interfaces.
Added the following methods to SlbmInterface
to support regularization for tomography applications. See html documentation for more information.
void getNodeNeighbors(const int& nid, int neighbors[], int& nNeighbors)
void getNodeNeighbors(const int& nid, vector& neighbors)
void getNodeNeighborInfo(const int& nid, int neighbors[], double distance[], double azimuth[], int& nNeighbors)
void getNodeSeparation(const int& node1, const int& node2, double& distance)
void getNodeAzimuth(const int& node1, const int& node2, double& azimuth)
void initializeActiveNodes(const double& latmin, const double& lonmin, const double& latmax, const double& lonmax)
void nextActiveNode(int& nodeId)
void getNodeHitCount(const int& nodeId, int& hitCount)
Fixed a bug in the part of the code that computes Pn/Sn travel times for mantle events. The bug caused the code to hang for events just below the Moho and close to the receiver. The test events seemed to return very similar travel times for very small differences in ray parameter. The bug was fixed by simply adding a counter that caused the loop to quit after a specified number of iterations.
Removed a spurious debug print statement that was inadvertently left in the fortran shell interface.
Added tests for ellipticity corrections and elevation corrections. The results of these tests had been distributed previously, but are now part of the official release.
Modified the method where Pn/Sn travel times are computed for mantle events. Basically made the convergence behavior more robust and imposed a criterion that C * H < 0.2
where C
is the Zhao C
parameter and H
is the depth of the ray turning point below the Moho.
Removed criterion that mantle gradients had to be >= 0
and replaced it with criterion that C
and Cm
have to be greater than 1e-6
.
Added 5 accessor methods to SlbmInterface
(in all 4 languages):
getZhaoParameter()
returns several parameters computed during calculation of Pn/Sn travel times, including C
, Cm
, Vm
, H
and udSign
(see documentation for definitions of these parameters).getGridLatMin()
, getGridLatMax()
, getGridLonMin()
and getGridLonMax()
return the valid range of the Earth model loaded with the loadVelocityModel()
call.Fixed a very subtle bug in QueryProfile
. It used to be that interpolation was done on the basis of depth of surrounding grid nodes. Changed so that interpolation is done on the basis of radius, which makes a small difference when the GRS80 ellipsoid is used and Earth radius depends on latitude.
Fixed some bugs having to do with the valid range of the Pn travel time for mantle events.
Changed the algorithm for computing Pg/Lg travel times. Code now returns Pg/Lg travel times for events at any depth in the crust, even events below the top of the middle crust. The algorithm implemented is exactly as described in the requirement document.
Added new SLBMInterface
constructors that take an earth radius in km. When the constructors with no parameters are called, the radius of the earth is assumed to vary as a function of latitude, as described by a GRS80 ellipsoid. When the earth radius is specified in the SLBMInterface
constructor, then earth radius is assumed constant at the specified value. Geographic latitudes are still converted to geocentric latitudes, using GRS80 ellipsoid.
Modified the IASPI91_slbm.txt
model file to have 9
layers instead of 8
.
unified_slbm.txt
) in two ways: (a) the constraint that gradients cannot be negative has been removed from the model input file and is now being imposed in the code. There can now be substantial negative gradients in the input file. (b) There are now 9 layers in the model where there were previously only 8
. The 9
layers are:WATER
SEDIMENT1
SEDIMENT2
SEDIMENT3
UPPER_CRUST
MIDDLE_CRUST_N
MIDDLE_CRUST_G
LOWER_CRUST
MANTLE
The change is that there are now two versions of the MIDDLE_CRUST
. MIDDLE_CRUST_N
is the same as the previous MIDDLE_CRUST
. MIDDLE_CRUST_G
is a new layer that has the same depth as MIDDLE_CRUST_N
but with P wave velocity 6.2
km/sec and S wave velocity of 3.5
km/sec. There are if statements in the code that select MIDDLE_CRUST_N
for phases Pn and Sn and select MIDDLE_CRUST_G
for Pg and Lg.
Changed InterpolatedProfile and all derived classes so that they no longer have to call new to create the data arrays. This involved changing from vector to double[] arrays in many places. Resulted in factor of 3 improvement in execution speed.
Fixed bug that prevented slbm from exiting gracefully when invalid file specified in Grid::loadVelocityModel()
.
Added the following methods to all interfaces:
saveVelocityModel()
- save earth model currently in memory to file.getHeadwaveDistanceKm()
- Retrieve horizontal distance traveled by the ray below the headwave interface, in km.getHeadwaveDistance()
- Retrieve angular distance traveled by the ray below the headwave interface.getSourceDistance()
- returns horizontal offset below the source.getReceiverDistance()
- returns horizontal offset below the receiver.getWeightsSource()
- Retrieve the node IDs and the interpolation coefficients for the source CrustalProfile
.getWeightsReceiver()
- Retrieve the node IDs and the interpolation coefficients for the receiver CrustalProfile
.Fixed many issues with the fortran interface.
Updated all of the html documentation files.
Added a mode of operation to SLBM_test_java
wherein two parameters are specified on the command line. The first is interpreted as the name of the file containing the earth model and the second is interpreted to be the name of a file containing a bunch of source and receiver locations. SLBM_test_java
will compute the total travel time and spew the results to standard out. The input file should contain the following information on each record, separated by spaces:
phase
- one of the following strings: Pn, Sn, Pg or LgsourceLat
- source latitude in degrees.sourceLon
- source longitude in degrees.sourceDepth
- source depth in km.receiverLat
- receiver latitude in degrees.receiverLon
- receiver longitude in degrees.receiverDepth
- receiver depth (negative elevation) in km.