Professional Documents
Culture Documents
Other Docs
Known Problems
Contents2
System Architecture 52
Headers and Global Variables 53
Input Tools 54
Re-entrancy 55
Common Blocks and Parms Structures 56
Executive Functions 57
Communication between Tools 58
OPF Database 59
Make System 61
Working with ProMAX Systems 62
Getting Started 63
System Administrator Setup 63
User Setup 65
Converting to the New System 69
Understanding the Directory Structure 70
$PROMAX_HOME/port/include/make/ 70
$PROMAX_HOME/port/bin/ 73
$PROMAX_HOME/sys/bin/ 74
$PROMAX_HOME/port/src/exe/exec/ 76
Customizing the System 77
Toggling Products: .promax 78
Adding a New Tool 81
Making Your New Executable 84
Incorporating New Functionality 87
Creating Menus 88
Adding a ProMAX Menu 89
Changing Files 91
Understanding the Makefile System 94
C++ Template Instantiation 94
Terms and Variable Descriptions 95
Makefile Techniques 117
Directory Structure 121
Directory Hierarchy 122
Machine-dependent Directories 125
Directory Naming Conventions 126
Product-dependent Subdirectories 127
Third-party Software 128
Recompilation - GNU Make 129
Makefile Rules 130
Makefile Options 131
User and Master Versions 132
Master Versions for Landmark Clients 134
C Environment 135
Other Docs
Known Problems
Contents3
Known Problems
Contents4
Known Problems
Contents5
Known Problems
Contents6
amp_ratio.f 360
ampRatio.c 367
Appendix: Ensemble Tool Examples 375
AVO Ensemble Tools 376
avo.menu 377
avo.inc 378
avo.f 379
avoC.c 383
Trace Interpolation Tools 388
prestk_interp.menu 389
prestk_interp.inc 390
prestk_interp.f 391
prestk_interp.c 393
Appendix: Panel Tool Examples 397
panel_test.menu 398
panel_test.inc 399
panel_test.f 400
panelTest.c 402
Appendix: Single Buffer Tool Examples 405
ens_define.menu 406
ens_define.inc 407
ens_define.f 408
interp_sb.menu 412
interp_sb.c 413
Appendix: Double Buffer Tool Examples 417
semblance.menu 418
semblance.inc 420
semblance.f 421
interp_db.menu 427
interp_db.c 428
Appendix: Complex Tool Examples 433
transform.menu 434
transform.inc 435
transform.f 436
transform.c 439
Appendix: Input Tool Examples 445
sine_wave.menu 446
sine_wave.inc 448
sine_wave.f 449
sineWave.c 455
Other Docs
Known Problems
Contents7
Known Problems
Contents8
Known Problems
Contents9
Index 651
Other Docs
Known Problems
Introduction
Organization
We divided this manual into chapters and sections that discuss
the key processes of the ProMAX system. In general, this
consists of:
Documentation Conventions
We use the following documentation conventions in this
manual:
Other Docs
Courier
Known Problems
Other Docs
Known Problems
Quick Start
Other Docs
Known Problems
the menu
the program
the helpfile
The menu is the window that the User Interface pops up to let a
user enter parameters for your program. The program is the
code that actually runs. The helpfile hopefully tells people how
to use your process without them having to call you too much.
There are two classes of ProMAX programs: inline flow tools
and stand-alones. Inline flow tools process data as it streams by
in a flow; examples are AGC, FK filter, and migrations. Inline
flow tools do not contain an asterisk in the Processes list. Standalone tools either read their own data, as occurs with random
data access, or do not need data, as occurs with velocity
manipulation. Stand-alone tools include such processes as the
interactive velocity editor, interactive velocity analysis, and
some of the statics programs. These tools do contain an asterisk
in the Processes list.
There are two types of inline flow tools: IPC tools and executive
tools. IPC tools used to be called socket tools. This Quick Start
chapter will only show you how to write an IPC tool. This is a
relatively new approach which we recommend for many
applications, especially if you are just getting started.
Developing IPC tools is significantly quicker and simpler than
developing non-IPC tools, at little performance cost. If you are
an expertfor example, if you have taken a ProMAX
programming courseyou may decide to write inline flow tools
using executive tools.
Other Docs
Known Problems
Other Docs
Known Problems
Writing a Menu6
Writing a Menu
The menu file is an ASCII file that is interpreted on the fly by
the User Interface. Writing a menu is simple enough that you
should be able to do this using the ProMAX menu files
delivered with your system as examples. The menus are in
$PROMAX_HOME/port/menu/promax. A good example to
start with is vdatum.menu; see also EXAMPLE.menu.
vdatum.menu is an example of a menu for a an IPC tool. Most
menus in the system, such as agc.menu, are for inline flow tools
that are non-IPC tools. The only difference between these two
menus occurs at the beginning of the exec_data section of the
menu. You should be able to tell the minor differences between
a IPC tool and a non-IPC tool, so you can still use all the menus
as examples.
An example of a menu of for a stand alone module is
autostat.menu. Again, the only difference between this type of
menu and others occurs at the beginning of the exec_data
portion of the menu.
We recommend that you write your menu in your mirror of
$PROMAX_HOME/port/menu/promax under your home
directory; that is, under
~/$PROMAX_HOME/port/menu/promax.
Menus are actually written in Lisp. If you write menus often,
you will notice that you are starting to learn Lisp. For more
information on writing menus, refer to the Menus chapter. To
test the menus you write, use the pwin program which is in
$PROMAX_HOME/sys/bin. If you are an emacs user, type
pwin my.menu and you should be in familiar surroundings. If
you are not an emacs user, type pwin my.menu t and bring up
your favorite editor in another window; you can create, debug,
and edit the menu using your editor. After you write your edits
to disk, click with the mouse in the pwin window and you will
see the sample menu updated to reflect your changes. If you
have syntax errors in your menu, pwin will generally print the
line number containing the syntax error.
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
which should compile and link the sample code. The executable
produced by this make will reside in
~/$PROMAX_HOME/rs6000/exe. For more information on the
Make System, refer Make System chapter. For more description
on IPC tools or stand-alone programs, see the Tool Types
chapter.
If you copy this directory and start making modifications to the
code, you will need to change the name in the Makefile to
match the name of your directory.
You can change your product file to include your home
directory in the search path for ProMAX executables. See the
description in the product file.
If you install your working source code under the
$PROMAX_HOME tree, you can do a gmake there and your
executable will be placed under the standard ProMAX
executable path, $PROMAX_HOME/sys/exe. You could do
your development under the $PROMAX_HOME directory tree
rather than in your home directory, but we discourage this. It
will become a maintenance hassle when many developers work
in that area.
Other Docs
Known Problems
or
aman f_promax
Other Docs
Known Problems
Writing Helpfiles12
Writing Helpfiles
Documentation is an important part of the ProMAX system.
You should write a helpfile for your new process if it is going to
be used in a production processing environment. At Landmark,
we use Adobe FrameMaker to generate and edit most of our
online and printed software documentation. For more
information, see the Helpfiles chapter, or contact any member
of the Documentation Department for assistance.
Other Docs
Known Problems
13
Self-guided Tutorial
Support Documentation
System Overview
Your Development Directory
Tool Anatomy
Programming Exercises: Simple Tools (amp_ratio)
Debugging
C Programming Environment
Tool Types
Programming Exercise: Ensemble Tools (AVO_exer)
Programming Exercise: Panel Tools
Programming Exercise: Input Tools
Programming Exercise: IPC Tools
Other Docs
Known Problems
14
To use this tutorial, simply read through each section and follow
the reading and programming exercise assignments. The
specific reading and exercise assignments are highlighted as
follows:
Now do this.
Before you get started, please note that this chapter refers to the
environmental variable $PROMAX_HOME, which is the path
name of the directory under which ProMAX is installed. Ask
your system administrator for help in setting up your ProMAX
environment if he or she has not already done so.
Other Docs
Known Problems
Support Documentation15
Support Documentation
The online C or FORTRAN Programmers Reference Manual
contains documentation on hundreds of subroutines that are
available in the ProMAX system. We have summarized these
subroutines in the C Library Summary and FORTRAN Library
Summary appendices..
from the command line of the computer. Your path must include
$PROMAX_HOME/port/bin.
To see a name and short description of all table routines, type
aman -k tbl
Other Docs
Known Problems
Support Documentation16
Other Docs
Known Problems
System Overview17
System Overview
The primary function of ProMAX is to create, modify, and
execute processing flows. A flow is a sequence of processes
which are used to manipulate seismic data. Flows are built by
selecting processes from a Processes List. A typical flow
contains an input process, one or more data manipulation
processes, and a display and/or output process.
Some of the chapters in this manual provide basic information
on how the system components work together and introduce
ideas that are present throughout the rest of this tutorial. Others
describe the specific processes of the ProMAX system. Because
you will be writing new menus which appear as part of the User
Interface, you should have a basic familiarity with the selection
of menu parameters at the User Interface level.
Other Docs
Known Problems
Read the Make System chapter. Complete the Makeadvance exercise in the User Setup section; be sure you can complete the Makeexec exercise. Contact your system administrator if the computer
refuses to allow you to complete everything discussed in the chapter.
Be sure to read the Adding A New Tool section of the Tool Types
chapter. This section provides a recap of the critical components of
a new processing tool and shows how they work together.
Other Docs
Known Problems
Tool Anatomy19
Tool Anatomy
Before you actually get started on the programming exercises,
you first need to understand the structure of the ProMAX tools.
Read the Executive Tools section of the Tool Types chapter. You do
not need to read beyond this section, since the remainder of the
chapter will be assigned later in the tutorial.
This assigned reading section provides an overview of the
structure of most ProMAX processes, including the processes in
the programming exercises in this tutorial.
Other Docs
Known Problems
Other Docs
Known Problems
Next you will need to copy the menu files into your personal menu
directory. To do this, go to your own menu directory by typing:
cd ~/$PROMAX_HOME/port/menu/promax
Set the permissions so that you can edit the files by typing:
chmod 644 *.menu
If you do not know how to compile and link the code into a new
exec.exe, review the Make System chapter.
Try your new program!
Remember to add the path to amp_ratio1.menu to your
Processes list. Review the Make System chapter if necessary.
Also remember that you need to have a .promax file set up in
your directory in order to tell ProMAX where to look for your
Processes file and where to find the executable code that you
have created. The .promax file is also discussed in the Make
System chapter.
Other Docs
Known Problems
Menus
A ProMAX menu is a file which controls how menu parameters
appear to the user.
Use the pwin program described in the Menus chapter to experiment with menu parameters in EXAMPLE.menu.
Global Parameters
There are many numerical variables that are related to a dataset,
such as the number of samples per trace and the number of trace
headers that exist for each trace. ProMAX has a global include
file that you can access to easily get this information.
Other Docs
Known Problems
Read the Parameter Tables chapter. You can find additional information can be found in a chapter with the same name in the ProMAX
Reference Manual.
Other Docs
Known Problems
Debugging24
Debugging
Most full-time programmers find that use of a debugger speeds
up their code development. Use of the program dbx with
ProMAX requires a few special considerations, primarily
related to the packet.job file.
Read the Debugging with dbx chapter. Practice using the debugger
on one of the amp_ratio or ampRatio routines.
Other Docs
Known Problems
C Programming Environment25
C Programming Environment
The system level code of ProMAX is largely written in
FORTRAN, although most new ProMAX module development
is now in C and C++. The C programming environment actually
lies on top of the FORTRAN environment; therefore, there are a
few things that the C programmer should know about, including
some conveniences that have been developed for programming
in C.
Other Docs
Known Problems
Tool Types26
Tool Types
Before you continue on with other programming examples, you
need to know about other kinds of processing tools. As you
learned earlier in this chapter, the program amp_ratio is an
example of a simple tool, which is a processing tool that only
processes one data trace at a time. There are several other types
of tools that make handling multiple traces very convenient.
Read the Tool Types chapter. Pay particular attention to the responsibilities that each tool has in both the init and exec subroutines,
such as setting global variables and trace header values that the
trace executive uses.
Other Docs
Known Problems
Offset
Least Squares fit line through Amplitude versus Offset Data
A single data trace is output for each CDP gather that is input to
the routine. The sample value at time T on an output trace is
either the slope or the zero-offset intercept of the least squares
curve shown in the figure above. A menu parameter allows the
user to select either slope or intercept as the output.
Other Docs
Known Problems
Note that the tool type is panel. This is because ensemble tools
have the same calling arguments as panel tools and are inserted
in the same part of the toolcall.f file.
A further example of an ensemble tool is in
$PROMAX_HOME/port/src/lib/maxtool/prestk_interp, which
outputs more traces in an ensemble than are input.
Other Docs
Known Problems
Go to your maxtool directory and copy the panel directory from the
main system maxtool directory via the following commands:
cd ~/$PROMAX_HOME/port/src/lib/maxtool
cp -r $PROMAX_HOME/port/src/lib/maxtool/panel .
Also remember to change your Processes file before starting ProMAX so that the new menu will be read.
Other Docs
Known Problems
Copy the sine_wave directory to your own maxtool directory (see the
previous examples on how to copy a directory). Edit sine_wave1.f or
sineWave1.c and fill in the missing code where the comments indicate code needs to be added.
The entry in the tools_to_add file looks like this:
SINE_WAVE same complex
Other Docs
Known Problems
Make the IPC tool by simply typing gmake in the directory where
Makefile resides. Run the program by putting an entry in the Processes file for the path to the menu.
You can see another example of an IPC tool in
$PROMAX_HOME/port/src/exe/ampRatio for C programmers,
or in $PROMAX_HOME/port/src/exe/amp_ratio for
FORTRAN programmers. These examples show the amp_ratio
program in the form of IPC tools. The Makefiles and menus are
included and can be compiled and used in a processing flow.
Other Docs
Known Problems
Other Docs
Known Problems
33
System Overview
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Menu Files37
Menu Files
In order for the flow builder to know how to present parameters
to the user, it must read menu specification files, which are also
called menu files. Menu files are closely integrated with the
underlying processing tools; both are usually written by the
same author. Within the menu files, programmers specify what
parameters should exist, what their properties aresuch as
parameter type, default value, and descriptionand how they
interrelate. Experience has shown that good menu parameter
specification evolves to the point of approaching a language; at
Landmark, we use Lisp, a language with suitable features. The
resulting menu specification is extremely well-suited to
handling traditional problems, such as context-sensitive hiding
of unused parameters, and is clearly one of the cornerstones of
ProMAXs success. Please refer to the Menus chapter for
further discussion of ProMAX menu specifications.
Other Docs
Known Problems
Flow Execution38
Flow Execution
When a user clicks on the Execute button on the Flow Menu,
the first step that the flow builder performs is to write all of the
parameters to disk in the form of a packet file. A packet file is
analogous to the ASCII job deck that existed in older systems,
except that it is binary in form and cannot be modified by any
editor except the flow builder. This protects the integrity of the
contents. The flow builder writes the packet file into the flow
directory that was created when the user constructed a new flow
or copied an existing flow. After the flow builder writes the
packet file, it executes the following shell command:
super_exec.exe packet_file host_name
Super Executive
The preceeding shell command launches the Super Executive,
or super exec for short. The flow builder executes this Super
Executive shell immediately, unless the job was submitted to a
queue. The Super Executive supplies the command line with the
path to the packet file and the name of the host on which the
flow builder is running. The Super Executive is, in a sense,
similar to the flow builderit is restricted in purpose and has no
notion of geophysics built into it. It is responsible for seeing
that the intended processing actually happens so the flow
builder can go off and do something else, like build another
flow.
The Super Executive first checks for the presence of multiple
tasks within the packet file. For example, if there are multiple
serial input steps in a flow, the Super Executive subdivides the
packet file and executes the separate jobs sequentially. In
addition, the Super Executive checks to see if a job should be
run on another host. It also performs other tasks, such as
expanding certain macrosfor example, the Parameter Test
in what we could loosely describe as filtering the packet file.
The Super Executive knows how to do most of these things
because it receives instructions from programmers via special
parameters that are included in the menu files, and are therefore
included in the packet file.
Some of the functionality within the Super Executive could be
included in the flow builder without changing the behavior of
Other Docs
Known Problems
Flow Execution39
Executive
The preceeding command launches the Executive, or exec for
short. The Executive supplies the command line with the path to
the packet file, the name of the host on which the flow builder is
running, and the process ID of the Super Executive. If the
processing flow contains stand-alone or other special tools, the
correct path to the process which was specified in the menu file
is substituted for exec.exe. The full path to the process can vary
with release and may also be controlled by the user via the
Alternate Executive directive.
The Executive includes the actual processing tools, such as
gain, decon, filter, etc. Ordinary processing tools are not
separate programs, but are rather a set of routines that are linked
together in the Executive. Tools can be single trace input and
output types or one of a number of multi-trace types (see the
Processing Pipeline illustration at the end of this chapter). The
primary function of this document is to provide you with
information on how to add functionality to the Executive.
You will see the terms exec and Executive used frequently in
this document. They are often used interchangeably, but we will
restrict the term exec to refer literally to the program named
exec.exe, and the term Executive to refer to the body of
software that surrounds the actual processing tools and handles
the flow of data within the pipeline.
Other Docs
Known Problems
Flow Execution40
Each processing tool that is linked into the Executive must have
two parts: an initialization routine and an execution routine. The
initialization routine checks the input parameters for validity,
sets global parameters (if appropriate), creates header entries,
allocates memory, and other miscellaneous tasks that must be
performed before traces can be processed. The execution
routine is ideally a narrow-minded routine that simply processes
the traces and headers. Both routines are surrounded by the
Executive, which does everything it can to make life easy for
the initialization and execution routines.
Other Docs
Known Problems
Flow Execution41
$PROMAX_HOME
/sys
/bin
promax
promax3d
promaxvsp
/frame
/exe
/sdi
exec.exe
super_exec.exe /(3rd party softwar
*.exe
/plot
/lib
lib*.a
/help
promax2d.ps
promax3d.ps
promaxvsp.ps
(Manuals)
/port
/promax
*.lok (Frame helps
*.help (ASCII help
/promax3d
/promaxvsp
/menu
promax
promax3d
promaxvsp
/misc
*.rgb (colormaps)
ProMAX defaults
/etc
config_file
product
pvmhosts
qconfig
/scratch
/queues
/area1
/data
(or $PROMAX_DATA_HOME)
/line1
Other Docs
Known Problems
Flow Execution42
PROMAX_DATA_HOME
Area
/data
/area1
DescName
Project
Parameter Tables
Trace Headers
Line
/line1
DescName
12345678CIND
12345678CMAP
17968042TVEL
317490267TGAT
22783694TFBP
36247238TMUT
/12345678
HDR1
HDR2
TRC1
TRC2
/flow1
DescName (ASCII)
TypeName (ASCII)
job.output (ASCII)
packet.job (Binary)
job.output (Binary)
/flow2
Flow
/OPF.CDP (CDP)
#s0_OPF_CDP.GEOMETRY.C_S
#s0_OPF_CDP.GEOMETRY.ELE
Ordered Parameter
Files database
/OPF.CHN (Channel)
OPF60_CHN
OPF60_CHN.GEOMETRY.FOLD
OPF60_CHN.GEOMETRY.SLOOKUP
/OPF.ILN (Inline-3D)
/OPF.LIN (Line)
/OPF.OFB
/OPF.PAT (Pattern)
/OPF.SIN (Source)
/OPF.SRF (Surface Station)
/OPF.TRC (Trace)
/OPF.XLN (Crossline)
/OPF.XLN (Crossline-3D)
Other Docs
Known Problems
Flow Execution43
Traces
Trace
Headers
Misc.
Map
Dataset Components
Line
Units
X Ref
Y Ref
Lo Cut
Hi Cut
Total # of CDPs
etc.
Source
X Coord
Y Coord
Chans
Uphole
Static
Elevation
etc.
Trace
FB Pick
Offset
Static
etc.
Surface Location
Fold
X Coord
Y Coord
Static
Datum Vel
etc.
Channel
Static
Amplitude Com
etc.
CDP
Fold
X Coord
Y Coord
Elev
Nearest SRF
Elev Static
etc.
Other Docs
Offset
Bin Center
Mean Offset
etc.
Known Problems
Flow Execution44
Mutes
Gates
Surg Mutes
Kills
Reversals
Horizons
Velocities
Etc....
Flow
Directory
Packet File
(packet.job)
Job Output
(job.output)
DescName
TypeName
Flow Components
Other Docs
Known Problems
Flow Execution45
Job Builder
(promax.exe)
Batch
Queue
Super Executive
(super_exec.exe)
Stand-alone
Programs
Executive
(exec.exe)
Tool Caller
AGC
Diskread
NMO
Line Database
Information
(datasets, parameter tables,
ordered database files, etc.)
Mute
Filter
Packet File
System Overview
Other Docs
Known Problems
Flow Execution46
Other Docs
Known Problems
Flow Execution47
Windows
Overlap
Area: XXXXXX
Line: YYYYYY
Flow: ZZZZZZ
Edit Flow
Seismic Datasets
Other Docs
Processes
Window
Overlay
Parameter Tables
Known Problems
Flow Execution48
Flow Builder
Other Docs
Known Problems
Flow Execution49
Input
Data
FK Filter
Gain
Running Mix
Mute
Stack
NMO
Output
Data
Multi-Trace Processes
Processing Pipeline
Other Docs
Known Problems
Flow Execution50
Other Docs
Known Problems
51
Executive
Other Docs
System Architecture
Headers and Global Variables
Input Tools
Re-entrancy
Common Blocks and Parms Structures
Executive Functions
Communication between Tools
OPF Database
Known Problems
System Architecture52
System Architecture
The ProMAX Executive is a pipeline system. In this system,
traces are dropped into the flow one at a time by the input tool
(see the Processing Pipeline illustration at the end of the System
Overview chapter). Individual traces continue to drop through
the flow until they encounter a multi-trace processing tool. The
trace executive collects all of the necessary traces for the
multi-trace processing tool and returns the traces back to the
flow when the tool is finished.
There are a variety of tool types; each type is designed to
minimize the coding required to implement the necessary trace
handling. These tool types range from simple, single-trace
input/output tools, to multi-trace input/output tools of a variety
of natural trace groupings, and finally to complex tools that
facilitate the ultimate user control of trace buffering. Please see
the Tool Types chapter for a description of each tool.
The Executive creates an essentially isolated environment for
each tool. It manages most of the tedious duties of trace and
trace header I/O, data buffering, initialization of global
variables, and other miscellaneous tasks. The following sections
describe these duties.
Other Docs
Known Problems
Other Docs
Known Problems
Input Tools54
Input Tools
The primary responsibility for setting the globals and
establishing the current header list is assigned to the first tool in
the flow, which by definition is an input tool. All input tools
must retrieve the current state of headers and run time variables
from the input ProMAX dataset and must make these available
to subsequent tools. The input tool must also retrieve the
remaining static global variables from the Ordered Parameter
Files (geometry). If your input tool is reading a non-ProMAX
(foreign) dataset or creating data, you are responsible for
retrieving the necessary data from whatever source and creating
all possible header and global values. See the Input Tool
Examples in the Appendix for code examples.
Other Docs
Known Problems
Re-entrancy55
Re-entrancy
Another related issue that the Executive manages is the issue of
re-entrancy. As mentioned above, the Executive attempts to
isolate each tool in such a way that the programmer codes his
tool as if it is the only one in the flow. There is no need to worry
about a ProMAX user putting your tool in the flow multiple
times, which could create confusion over which set of
parameters goes with which instance of the tool. Nor is there
need to worry about two tools coincidentally sharing identical
menu parameters or internal local variables. The Executive
assures that each tool can only access menu parameters from its
corresponding menu in the flow; it offers protection for
duplicate variables.
Other Docs
Known Problems
Other Docs
Known Problems
Executive Functions57
Executive Functions
The exec routine does the actual trace processing. The
Executive passes traces and headers to the exec routine in
buffers and expects the processed traces to be in the same
buffers when exiting the routine. If the tool is a multi-trace type,
the Executive will allocate the memory necessary to accumulate
the proper trace grouping, then free the memory after that group
of traces is processed and passed to the next tool. This memory
management is done automatically without any coding at the
tool level. Often you will need to dynamically allocate
additional memory within the tool to hold temporary results.
This is supported both in FORTRAN and C, but it is assumed
that such memory will be de-allocated upon exiting the exec
routine. Remember that many tools could comprise a flow: your
tool could be repeated many times. After exiting your
multi-trace exec routine, it might be some time before the
remaining flow is executed and traces are again accumulated
and passed to your exec routine. This is another situation where
you must consider the entire flow instead of simply your
application. It is assumed system-wide that two ensembles will
fit comfortably in memory. However, tools that require many
ensembles, multiple copies of ensembles, or large collections of
stacked traces should buffer traces on disk or process panels of
traces.
Other Docs
Known Problems
Other Docs
Known Problems
OPF Database59
OPF Database
The Ordered Parameter Files database is another form of
inter-tool communication. Refer to the Ordered Parameter Files
chapter for a definition of this database. It is typically used to
communicate information that is global to all datasets within
the line; field geometry data is a good example. Convenience is
a governing factor in choosing the form of communication that
is used. For example, geometry information that is placed in the
Ordered Parameter Files database can be conveniently accessed
by stand-alone programs that do not wish to read trace data.
Other Docs
Known Problems
OPF Database60
Other Docs
Known Problems
61
Make System
Other Docs
Known Problems
Other Docs
Known Problems
Getting Started63
Getting Started
The following sections describe the System Administrator and
User setup.
2.
Other Docs
Known Problems
Getting Started64
crayymp
rs6000
sgimips
sgimips4
solaris
Solaris Users
If your target development machine type is solaris, each
development machine should have a symbolic link from /bin/cc
to the location of your companys C compiler. This is used by
the gmake system to figure out what platform you are on; it
determines this via the extra DEFINES that each platforms C
compiler sends in by default.
To get the C compiler to be recognized on Solaris, you need to
create the following symbolic link:
ln -s /opt/SUNWspro/bin/cc /bin/cc
$(atopdir); /bin/pwd)
Other Docs
Known Problems
Getting Started65
User Setup
The following sections describe the User setup.
2.
Other Docs
Known Problems
Getting Started66
3.
Ksh/sh/zsh users:
alias gmake='$PROMAX_HOME/sys/bin/gmake \
-I$PROMAX_HOME/port/include/make'
alias Makeexec='$PROMAX_HOME/port/bin/Makeexec \
-I$PROMAX_HOME/port/include/make'
Other Docs
4.
5.
6.
Known Problems
Getting Started67
When you run Makeexec the first time, the Makefile in your
~/$PROMAX_HOME/port/src/exe/exec/ directory finds the
Makefile in your ~/$PROMAX_HOME/port/src/lib/maxtool/,
cds to that directory, and does a gmake. Because you do not
have any of the libmaxtool*.a or libmaxtool*.so libraries in
your User version of ~/$PROMAX_HOME/, the Makefile in
~/$PROMAX_HOME/port/src/lib/maxtool/ will create these
libraries for you. This is the time-consuming part of running
Makeexec the first time: the libmaxtool* libraries are big and
you do not have them yet.
First-time compilation
Unlike the Master version of
$PROMAX_HOME/port/src/lib/maxtool/, your User version
does not (yet) contain any source code. Therefore, the Makefile
simply copies the libraries
Other Docs
Known Problems
Getting Started68
Nth-time compilation
You can run Makeexec from anywhere within your
~/$PROMAX_HOME/port/src/ hierarchy. In particular, you
can run it inside your
~/$PROMAX_HOME/port/src/lib/maxtool/xxx/ directory,
where you have just finished modifying the source code for
your latest and greatest new tool.
For new exec tools, you must specify the source files for each
new tool in the newsrcs variable in your
~/$PROMAX_HOME/port/src/maxtool/Makefile.
Other Docs
Known Problems
Other Docs
Known Problems
$PROMAX_HOME/port/include/make/
$PROMAX_HOME/port/bin/
$PROMAX_HOME/sys/bin/
$PROMAX_HOME/port/src/exe/exec
$PROMAX_HOME/port/include/make/
This directory contains the makefile header files which are used
to set up for various possible configurations. It also contains
sample makefiles for a library or stand-alone executables. The
following table summarizes these files.
$PROMAX_HOME/port/include/make/ Files
File
Description
master.make
This is the file which is responsible for setting up the basic variable structures
representing the clients directory structure. This file can be included instead
of advance.make if all you need from your makefile include are variables
containing paths to advance things. In this respect, it serves as a lightweight
header include.
advance.make
This header file includes master.make and sets up anything which is constant
among all platforms such as Canned Command Sequences. It also includes
$machtype.make to import its platform dependent information.
$machtype.make
This represents the header file containing the platform dependent information
such as preprocessing, compiling, and link commands. As this varies
dramatically from system to system, Landmark provides some reasonable
defaults. Even so, clients installing ProMAX will probably need to modify
this file to reflect their particular system setup.
simple.make
A simple makefile used to compile one or more executables into the current
directory.
compile.test
libmaxtool.example
An example user makefile for the maxtool[1-3] libraries. This file is used by
Makeadvance to create a user environment.
Other Docs
Known Problems
Description
exec.example
stand_alone1.example
stand_alone2.example
maxprog.make
maxprog++.make
Makefile_example_*
Sample makefiles for creating new modules under the bin, exe, and lib user
port/src development subdirectories.
Example: simple.make
This makefile example uses simple.make to compile into the
current directory.
1.
cd $HOME
2.
mkdir simpletest
3.
cd simpletest
4.
5.
Other Docs
Known Problems
6.
7.
8.
9.
Example: compile.test
This makefile example uses compile.test.
1.
cd $HOME
2.
mkdir compiletest
3.
cd compiletest
4.
5.
6.
Other Docs
Known Problems
Example: maxprog.make
For this makefile example, maxprog.make might look like:
include
include
include
include
include
include
include
include
include
include
advance.make
exe_setup.make
exe_top.make
depend.make
exe_link.make
exe_f77_compile.make
exe_ansic_compile.make
exe_cxx_compile.make
exe_clean.make
phony.make
$PROMAX_HOME/port/bin/
This directory contains portable scripts which can be run from
the command line. The following table summarizes these
scripts.
$PROMAX_HOME/port/bin/ Files
Script
Description
Auto_test
Makeadvance
Makeexec
Setqueues
A script which allows users to toggle between NQS and LPD queues.
adoc
aman
Promax
makewhatis
A script which is used to make the whatis/windex for man pages. Must be
executed from the man directory.
checkin2
A script which is used to check in a previously checked out Landmark sccs file.
checkout2
Other Docs
Known Problems
Description
testFlows
buildtoolcall
app
pvmcleanup
pvmdbx.sh
Makelink
A script which is used to create a link from a file in a users directory to the
corresponding file in the $PROMAX_HOME directory.
Nmgrep
Fid
$PROMAX_HOME/sys/bin/
This directory contains non-portable scripts which can be run
from the command line. The following table describes these
scripts.
$PROMAX_HOME/sys/bin/ Files
Script
Description
amakedepend
aviewer
copycat
A program which runs every 1/2 hour and takes the tape catalog files and copies
them to another directory. It ensures that there is always an uncorrupted version
of the tape catalog database handy.
ctags
ctar
emacs
etags
Other Docs
Known Problems
Description
gmake
ll
AKA lisp listener. A lisp interpreter implementing Landmarks lisp. Useful for
rule writers wanting to check syntax.
lmdown
lmgrd
lmreread
lmstat
nmapmgr
nqs_promax
perl
pixmap
A program used to build pixmaps. Useful if you are using the agX libraries.
pkt_dump
promax
Landmarks 2D GUI.
promax3d
Landmarks 3D GUI.
promaxvsp
ptt
pwin
qdel
qdev
qjob
qlimit
qmgr
qpr
qstat
qsup
tamsh
A tcl/motif interpreter/shell. This allows the creation of tcl scripts which contain
motif widgets. This is a powerful homegrown version based upon Jan
Newmarchs TclMotif.
Other Docs
Known Problems
Description
tcat
tcatd
tclsh
A tcl interpreter/shell.
tkperl
Perl 5.000 with the Tk and ReadLine extensions. This version of perl allows
users to create scripts which have graphical user interfaces.
ttp
$PROMAX_HOME/port/src/exe/exec/
The directory contains the executives makefile as well as
listings of base tools, tools to add, and tools to delete. The
following table summarizes this directorys contents.
$PROMAX_HOME/port/src/exe/exec/ Files
Item
Description
Makefile
tools.db
A base listing of inline tools which will be incorporated into the executive.
tools_to_add
A listing of inline tools to add to the executive. Users may, and should, have a
personalized version of this file.
tools_to_delete
A listing of inline tools to delete from the executive. Users may streamline their
personal version of the executive with this file.
Other Docs
Known Problems
Other Docs
PROMAX_HOME
PROMAX_DATA_HOME
PROMAX_PORT_MENU_HOME
PROMAX_PORT_MENU_PROCESSES_HOME
PROMAX_SYS_EXE_HOME
PROMAX_ETC_CONFIG_FILE_HOME
PROMAX_QUEUES_HOME
PROMAX_ETC_PVMHOSTS_HOME
PROMAX_SCRATCH_HOME
PROMAX_SCRATCHX1_HOME
PROMAX_SCRATCHX2_HOME
...
Known Problems
This entry will cause a search of your exe directory for exec.exe
(or other executables) and the system exe directory next. For
this specific case you could use:
"~/[$PROMAX_HOME]/rs6000/exe/:."
Other Docs
Known Problems
or
"~/[$PROMAX_HOME]/port/menu/promax/:promax"
Other Docs
Known Problems
This entry will cause a search of your help directory for custom
helps and the system help directory next.
Entry7 is the absolute or relative pathname to the directory
containing the misc files. If specified as a relative pathname, it
will be appended to $PROMAX_PORT_MISC_HOME. As with the
executable directory, there is no product level subdivision of
misc files. The misc/ level files control configuration aspects
such as color tables and are rarely redirected. However, if
desired, search path control is done in the same manner as that
for the executables, Entry3, above.
Entry8 is the absolute or relative pathname to the directory
containing the primary data storage files. If specified as a
relative pathname, it will be appended to
$PROMAX_DATA_HOME. The data directory is also not divided
by products, nor is a search path supported in the .promax file.
The following examples demonstrate product stanzas in the
.promax file:
Standard:
(:product ("P" "ProMAX" "" "promax" "promax/Processes"\
"promax" "" "" t)
("v" "ProMAXVSP" "" "promaxvsp" "promaxvsp/Processes"\
"promaxvsp" "" "" t) )
Custom:
(:product ("P" "ProMAX" "/disk2/exe" "promax"\
"promax/Process" "promax" "" "" t)
("p" "Prospector" "" "prospector" "/home/joe/processes"\
"prospector" "" "/advance/mydata" t) )
Other Docs
Known Problems
The following steps outline the process for adding a new tool,
using the amp_ratio tool as an example.
1.
Other Docs
Known Problems
2.
3.
4.
5.
or
% Makeexec language=C (Builds toolcall.c.\
Compiles it)
% cd ~/$PROMAX_HOME/rs6000/exe
% ls -l (File called exec.exe should now exist)
6.
Other Docs
Known Problems
7.
8.
Other Docs
Known Problems
2.
Note that the source code file name, amp_ratio1.f, and the
subroutine name, amp_ratio, may be different. Be sure the
name listed in the tools_to_add file truly reflects the name
of the init and exec phases.
3.
Other Docs
Known Problems
Search for newsrcs and add another line listing the new
.f file so that the file looks like this (do not forget the
backslash continuation mark):
newsrcs := \
amp_ratio/amp_ratio1.f
4.
or:
% Makeexec language=C(build
or .c)
The Details
The following things happened when you typed Makeexec:
Other Docs
1.
2.
~/$PROMAX_HOME/port/src/exe/exec/Makefile
included the master version of this Makefile to be executed.
This ensures that your local Makefile always reflects the
changes made to the master version
$PROMAX_HOME/port/src/exe/exec/Makefile.
3.
$PROMAX_HOME/port/src/exe/exec/Makefile decides
that this is a User make. It checks the following directories
Known Problems
~/$PROMAX_HOME/port/src/lib/maxtool
~/$PROMAX_HOME/port/src/lib/maxutil
~/$PROMAX_HOME/port/src/lib/maxexec
~/$PROMAX_HOME/port/src/lib/uiutils
~/$PROMAX_HOME/port/src/lib/agfc
Other Docs
Known Problems
Other Docs
Known Problems
Creating Menus88
Creating Menus
The User Interface looks at the setting of the environment
variable new_menu to determine the menu init behavior. If
new_menu=t, then the User Interface will re-initialize the menu
every time it is displayed. If new_menu=f, then the flow builder
will only read files once. This means if you modify the
processes file or a menu file after starting the flow builder, it
will not see your changes. Furthermore, if you add a tool to a
flow, the corresponding menu file will be saved with the flow,
and the menu file will not be read again when the flow is
accessed again. Setting new_menu=t is a big help in testing
menus and should be part of the ProMAX programmers
environment. This setting slows down the User Interface
because the menu files are reread; therefore, it is not the default
setting for the typical production processing environment.
The menu file contains the description of parameters and rules
that control what the User Interface presents. Menu files are
written in Lisp and are interpreted at run time (no compilation is
necessary). No Lisp programming experience is necessary,
however. The syntax is simple and there are abundant examples
in the directory $PROMAX_HOME/port/menu (see files
ending with the extension .menu). In most cases, it is easiest to
find existing parameters in the system that are similar to those
that you wish to use, and then cut and paste them into a new file.
While you are creating the new menu file, it is a good idea to
use an editor that has parentheses checking, since mismatched
parentheses are the most common source of errors.
A utility program called promenu exists for debugging menu
files. After the menu file is near completion, use promenu to
adjust cosmetic features and to test the menu rules (if they exist
in your menu file). The program promenu takes the menu file as
a command line argument; therefore, if your menu file is named
testtool.menu, the command would be:
% $PROMAX_HOME/sys/bin/promenu testtool.menu
Other Docs
Known Problems
2.
3.
Other Docs
Known Problems
6.
7.
Other Docs
Known Problems
Changing Files91
Changing Files
Several things must be done each time a new tool is added to the
ProMAX system. The following illustrations show files within
the ProMAX directory tree that need to be changed when a new
tool is added. The files that are changed frequently during the
development of a new tool are circled with a solid line; files that
are changed infrequently are circled with a dotted line. Other
files are shown, but if they are not circled you do not change
them. For example, the source code for an inline tool is found in
the directory path:
~/$PROMAX_HOME/port/src/lib/maxtool/your_tool
and the .c and/or .f files found in this directory are changed
frequently during development. The .promax file found in the
home directory is changed infrequently.
The first illustration shows files that need to be changed or
added when an inline tool (linked to the trace executive) is
added. The second illiustration shows files that must be changed
or added when a stand-alone or IPC (socket) tool is added to the
system. These charts have proven to be very useful when used
as a reminder of the file changes that are needed for a new tool.
Other Docs
Known Problems
Changing Files92
lib
maxtool
exe
exec
your_tool
.c, .f
src
port
tools_to_add
menu
~/ $PROMAX_
HOME
promax
Processes
your_menu.menu
*.exe
exe
rs6000
lib
Other Docs
Known Problems
Changing Files93
. promax
exe
src
.c, .f
your_stand_alone
port
menu
~/ $PROMAX_
HOME
Makefile
promax
Processes
your_menu.menu
exe
* .exe
rs6000
lib
Other Docs
Known Problems
Other Docs
Known Problems
Description
Canned Command
Sequence
Rule
A set of targets, dependencies and commands which describe how to create the
target(s). The make will look up and evaluate the rules for each of the
dependencies before evaluating the commands which the target(s) depend(s) on.
For a more detailed explanation of this, please refer to the GNU Make document
by Richard M. Stallman and Roland McGrath.
Example:
foo : bar1.o bar2.o
$(CC) $^ -o $@
Variable
Boolean Variable
A variable which may contain the string yes or no. It is used to figure out
exactly how the user wants certain things to be made.
Command Variable
Library Variable
A variable which contains the path to a library. The path may vary depending on
the context of the make.
Directory Variable
Makefile Variable
Other Docs
Known Problems
Terms (Continued)
Term
Description
CCS Function
Variable
A canned command sequence which returns a value. It may also assume that
certain values were set prior to calling the CCS Function Variable. These can be
thought of as the function arguments. For example:
function_results :=\ $(CCS_FUNCTION_VARIABLE)
Recursively
Expanded Variable
Simply Expanded
Variable
$(foo) $(bar)
$(foo) $(bar)
FOOBAR1: $(foobar1)
FOOBAR2: $(foobar2)
Other Docs
Known Problems
Terms (Continued)
Term
Description
Command Line
Overridable Variable
Variables are by default, command line overridable. This means that when a
variable is set from the command line, it takes the command line value and
ignores the makefiles attempts to initialize or augment it. Unless stated
otherwise, it can be assumed that any given variable is command line
overridable.
Example: The Makefile:
# var is a simply expanded command line
# overwritable variable.
var := $(var) Makefile Value
all:
@echo VAR: $(var)
Command Line
Augmentable
Variable
A variable which will be augmented instead of overridden when set from the
command line.
Example:
# var is a simply expanded, command line
# augmentable variable.
override var := $(var) Makefile Value
all:
@echo VAR: $(var)
Conventions
The following list describes Makefile conventions.
Other Docs
1.
2.
Known Problems
3.
4.
5.
6.
7.
Other Docs
Known Problems
8.
Other Docs
Known Problems
Meaning
KRC
CXX
LEX
AMD
Other Docs
Known Problems
Variables
The following table describes the important makefile variables.
Makefile Variables
Variable
Type
Explanation
debug
Boolean Variable.
profile
Boolean Variable.
quantify
Boolean Variable.
purify
Boolean Variable.
[KRC|C|CXX|F|AMD|] INCPATH
Variables.
[KRC|C|CXX|F|] DEFINES
Variables.
[KRC|C|CXX|F|AMD|] PPFLAGS
Variables.
[KRC|C|CXX|F|]
OPTIONS
Variables.
[KRC|C|CXX|F|]
OPTIMIZATION
Variables.
Other Docs
Known Problems
Type
Explanation
[KRC|C|CXX|F|AMD|Y|]FLAGS
Variables.
[KRC|C|CXX|F|]
LDFLAGS
Variables.
[KRC|C|CXX|F|]LIBS
Variables.
[KRC|C|CXX|F|]
PRECOMPILE
Variables.
KRCC
Command Variable.
CC
Command Variable.
CXX
Command Variable.
FC
Command Variable.
CPP
Command Variable.
FPP
Command Variable.
SYSLIBS
Command Line
Augmentable Variable.
SYSXXLIBS
Command Line
Augmentable Variable.
Other Docs
Known Problems
Type
Explanation
XLIBS
Variable.
XMLIBS
Variable.
cxxlink
Boolean Variable.
shared_libs
Boolean Variable.
lib_suf
Variable.
master
Boolean Variable.
GET
Command Variable.
ctopdir
Directory Variable.
utopdir
Directory Variable.
atopdir
Directory Variable.
topdir
Directory Variable.
loadmap
Boolean Variable.
Other Docs
Known Problems
Type
Explanation
mtopdir
Directory Variable.
AR
Command Variable.
ARCHIVE_REPLACE_FLAGS
Command Flags
Variable.
ARCHIVE_CREATE_FLAGS
Command Flags
Variable.
AS
Command Variable.
RANLIB
Command Variable.
RANLIB_TARGET
CXXTEMPLATES
Variable (SunOs,
Solaris, IRIX).
Other Docs
Known Problems
Type
Explanation
CXX_LINK
Command Variable.
Other Docs
Known Problems
Type
CXX_LINK (continued)
Explanation
(continued)
5. If uobjlist contains one or more
files, take the first object file and
replace the filename.o portion with
templates and prepend -ptr to the
string. Add this to the tail end of
our CXX_LINK canned command
sequence. Repeat this step with
mobjlist and aobjlist (in that order).
Thus, user directories get first
crack and being the read/write
template repository, then master
directories and advance directories
get last crack. Also note that if you
have object files coming from more
than one location in your user
directory, the object file listed first
in the dependency list will be the
one whose path is inherited by the
repository.
Thus, in cases such as this, list
object files which reside in the
location where you want the
template repository first.
CXX_LINK -> (CXX,
CXXPPFLAGS, CXXTEMPLATES
CXXLDFLAGS)
INSTANTIATE_CXX_TEMPLATES
Other Docs
Known Problems
Type
Explanation
COPY_CXX_TEMPLATES
Other Docs
Known Problems
Type
COPY_CXX_TEMPLATES
(continued)
Explanation
(continued) If it does not, the
master template directory is
scanned for it. If the master
contains this template object file,
the master template repository path
is prepended to the base object
filename. Otherwise, the advance
template repository path is
prepended to the base template
object file. Thus we ensure that we
have a singular list of template
object files in which the users
directory overrides the master,
which in turn overrides the
advance definitions. At this point,
the object files are copied into the
temporary template directory
under the names Template1.o
Template2.o etc... and are archived
into the users personal library as
described in the master context.
ARCHIVE_CXX_LIB
ARCHIVE_CXX_LIBNS
machtype
Variable.
[a|m|]sysdir
Directory Variable.
$path/sys.
Other Docs
Known Problems
Type
Explanation
[a|m|]bindir
Directory Variable.
$path/sys/bin/.
[a|m|]aexedir
Directory Variable.
$path/sys/exe/.
[a|m|]libdir
Directory Variable.
$path/sys/lib/.
[a|m|]objdir
Directory Variable.
$path/sys/obj/.
[a|m|]objbindir
Directory Variable.
$path/sys/obj/bin/.
[a|m|]objexedir
Directory Variable.
$path/sys/obj/exe/.
[a|m|]objuidir
Directory Variable.
$path/sys/obj/ui/.
[a|m|]objlibdir
Directory Variable.
$path/sys/obj/lib/.
[a|m|]portdir
Directory Variable.
$path/port/.
[a|m|]incdir
Directory Variable.
$path/port/include/.
[a|m|]srcdir
Directory Variable.
$path/port/src/.
[a|m|]srcbindir
Directory Variable.
$path/port/src/bin/.
Other Docs
Known Problems
Type
Explanation
[a|m|]srcexedir
Directory Variable.
$path/port/src/exe/.
[a|m|]srclibdir
Directory Variable.
$path/port/src/lib/.
libmaxexec
libmaxtool1
libmaxtool2
libmaxtool3
libmaxutil
libuiutils
libmaxui
libagfc
libpar
libagX
libagXi
Other Docs
Known Problems
Type
Explanation
libagC
libagCi
Library Variable.
$path/sys/lib/libagCi.a.
libeispack
libGeom
libpagefile
libgeoquest
libpvm
libXpm
Library Variable.
libpsplot
Library Variable.
libpp
Library Variable.
AGCLIBS
Collection of Libraries.
MAXTOOLLIBS
Collection of libraries.
libmaxtoolmake
Makefile Variable.
libmaxutilmake
Makefile Variable.
libmaxexecmake
Makefile Variable.
libuiutilsmake
Makefile Variable.
Other Docs
Known Problems
Type
Explanation
libmaxuimake
Makefile Variable.
libagfcmake
Makefile Variable.
libagXmake
Makefile Variable.
libagXimake
Makefile Variable.
libagCmake
Makefile Variable.
libeipackmake
Makefile Variable.
libGeommake
Makefile Variable.
libpagefilemake
Makefile Variable.
libpvmmake
Makefile Variable.
libXpmmake
Makefile Variable.
libpsplotmake
Makefile Variable.
libppmake
Makefile Variable.
report
Boolean Variable.
BACKUP
CCS Variable.
BACKUP_ON_ERROR
ERROR_HANDLER
Other Docs
Known Problems
Type
Explanation
define_usrcs
define_asrcs
define_uobjs
Other Docs
Known Problems
Type
Explanation
define_aobjs
AMAKEDEPEND
AMAKEDEPEND_TO_STDOUT
ANSIC_COMPILE
KRC_COMPILE
define_ugincs
Other Docs
Known Problems
Type
Explanation
CXX_LINK
Command Variable.
CXX_COMPILE
F_COMPILE
YACC_COMPILE
LEX_COMPILE
Other Docs
Known Problems
Type
Explanation
AS_COMPILE
COPYFILE
LINKFILE
COPYLIB
ARCHIVE_REPLACE
ARCHIVE_CREATE
MAKETARGETDIR
Other Docs
Known Problems
Type
Explanation
UPDATE_[libname]
UPDATE_LIBRARIES
cleanlib
Rule.
cleanexe
Rule.
cleanobjs
Rule.
Makefile Techniques
The following tips illustrate how the makefile system can be
used to solve common problems.
Other Docs
Known Problems
This will cause the C only toolcall to be created and link via the
C compiler.
gmake clink:=yes
This is how you can make from here on out. The utc is
necessary the first time only.
gmake utc
Other Docs
Known Problems
This causes your make to output what it would have done to the
file file. You can now edit this file, adding and deleting
options to help figure out just why your make is failing.
Edit the compile/linking options to include the -v option
for verbosity.
This option may be -show in the latest SGI compilers. This will
cause the compiler/linker to go verbose helping you isolate
exactly which phase is going wrong.
You can add print statements to your makefile by doing
something like this:
foo := $(shell echo>&2 My Variable = $(My_Var))
Other Docs
Known Problems
Nmgrep
Other Docs
Known Problems
121
Directory Structure
Other Docs
Directory Hierarchy
Machine-dependent Directories
Directory Naming Conventions
Product-dependent Subdirectories
Third-party Software
Recompilation - GNU Make
Makefile Rules
Makefile Options
User and Master Versions
Master Versions for Clients
Known Problems
Directory Hierarchy122
Directory Hierarchy
Everything we need to build our products, except for standard,
vendor-supplied software such as ANSI C include files, goes
under the single directory $PROMAX_HOME. For example, if
we need the latest X11R4 (or X11R5, ...) include files, and these
files are not supplied with all machine types we support, then
we put them in $PROMAX_HOME/port/include/X11/, instead
of /usr/local/include/X11/. Having everything under a single
directory makes it easier to find things during development and
maintenance, to build distribution tapes, and to save/recover
new/old releases of the software.
The next level of the hierarchy contains several directories
named after machine types, such as rs6000/. These directories
contain machine-dependent object code, libraries, and
executable programs. Software that does not depend on
machine type goes in port/. port/ contains everything necessary
to port our software to a new machine type.
The etc/ directory contains configuration files (such as the
ProMAX config_file) that may vary from machine to machine,
even when the machines are of the same type. Many sites will
also put their ProMAX data/ and scratch/ directories just
beneath $PROMAX_HOME, although these locations may
vary.
A listing of some of the more important, higher level directories
of theProMAX hierarchy follows. You may also refer to the
Expanded Directory Structure appendix.
$PROMAX_HOME
Other Docs
bin/
exe/
lib/
obj/
bin/
Known Problems
Directory Hierarchy123
exe/
lib/
nodist/
lib/
.
decmips/ (sys/ -> decmips/ on DEC MIPS Rx000
machines)
Other Docs
port/
bin/
misc/
menu/
promax/
prospector/
promaxvsp/
promax3d/
help/
promax/
prospector/
promaxvsp/
promax3d/
man/
Known Problems
Directory Hierarchy124
Other Docs
include/
src/
bin/
exe/
lib/
nodist/
etc/
data/
scratch/
include/
Known Problems
Machine-dependent Directories125
Machine-dependent Directories
Machine-dependent directories, such as rs6000/ (for IBMs
RS/6000) and decmips/ (for DECs MIPS-based machines) are
used for two reasons:
1.
2.
Other Docs
Known Problems
Other Docs
Known Problems
Product-dependent Subdirectories127
Product-dependent Subdirectories
Some files with the same names are different for different
products. For example, the menu and help files for ProMAX
2D, Prospector, ProMAX VSP, and ProMAX 3D differ. To
distinguish among different files for different products, the last
subdirectory sometimes reflects the product name. For example,
agc.menu appears in menu/promax/, menu/prospector/,
menu/promaxvsp/, and menu/promax3d/. The ProMAX flow
builder takes advantage of this structure to find and use the
appropriate files, depending on which product is being used.
The lib/ directories contain libraries (.a archives) of .o files that
are used to build executables. The following table describes
some of the more important libraries.
Libraries
File
Description
libmaxtool*
libmaxexec.*
ProMAX utility functions called by tools and exec.exe only (formerly known as
exec.a). Link with this and you will get an executable as big as the exec.exe.
libmaxutil.*
libmaxui.*
libagfc.*
X11/libXaw.a
X11/libXhp.a
Other Docs
Known Problems
Third-party Software128
Third-party Software
Third-party software requires special handling because third
parties are unlikely to organize their files in the same way that
Landmark does. Two or more vendors may choose the same
name for different files. Some vendors permit Landmark to
distribute their software and some do not. Today, no two sets of
third-party software can be handled in exactly the same way.
When a third party permits Landmark to distribute its software,
we simply install it in the usual place in the
$PROMAX_HOME hierarchy, except that we put it inside a
subdirectory that reflects the vendors name. An example is the
golden.a library from Golden Geophysical, which goes in
$PROMAX_HOME/sys/lib/golden/golden.a. We distribute this
library because Golden uses hooks into our licensing system
that force users of Goldens software to obtain a license from
Golden. Another example of software that Landmark distributes
is SDIs viewer (in $PROMAX_HOME/sys/exe/sdi/sdi_view)
for CGM metafiles, which has its own security/licensing
scheme.
All third-party software is installed (or symbolically linked) in
the $PROMAX_HOME directory tree with a unique directory
name corresponding to the vendor. For example, inside
$PROMAX_HOME/port/include/ are geoquest/ and sdi/
directories. These vendor-specific directories minimize file
name collisions. (Note that both geoquest/ and sdi/ have a
portable.h file.) Software that includes portable.h should do so
with #include geoquest/portable.h or #include sdi/portable.h,
depending on which portable.h is needed. In some cases both
may be included, so the vendor-specific directory name is
important. As always, full pathnames should not and need not
be specified in these #include statements.
Other Docs
Known Problems
Other Docs
Known Problems
Makefile Rules130
Makefile Rules
Each developer of a library or executable program must provide
a Makefile to build it on all machine types supported by
Landmark. Most programmers will never have to write a
Makefile from scratch because there are several examples in the
src/ directories. However, if you write or modify Makefiles, be
sure the Makefile does not reference anything outside of the
$PROMAX_HOME directory tree. This simple rule:
Known Problems
Makefile Options131
Makefile Options
To make a program or library, just cd to the directory containing
the source code for the program or library, and type gmake.
All Makefiles that include advance.make provide two important
command line options. The first is for debugging. Typing
gmake debug=yes turns on debugging and turns off optimization.
The default is debug=no. Another useful command line option
for gmake is gmake clean, which deletes libraries and objects in
your personal directories, or gmake clearlibs, which only
deletes libraries.
Other supported options are purify=yes (Sun only),
quantify=yes, and loadmap=yes. purify=yes will try to run the
commercial Purify package on compiled code in order to find
memory leaks. quantify=yes will try to run the commercial
Quantify package on compiled code in order to profile the code.
(This assumes that Purify and/or Quantify are loaded on your
system.) loadmap=yes is an IBM option which will create a
loadmap file, which will report the source of undefines and/or
multiple defines in your code.
An executable shell, $PROMAX_HOME/port/bin/Makeexec, is
provided to make it easy to build any variant of exec.exe. This
shell simply cds to the exec source directory and runs gmake
with the command line arguments provided to Makeexec. For
example, typing
Makeexec debug=yes
Other Docs
Known Problems
2.
This algorithm ensures that Dean always has the latest tools that
have been installed in the Master versions, while enabling him
to have his own User version for development.
An important difference between User and Master versions of
$PROMAX_HOME is that a User version need not contain
everything that is in the Master version. Typically,
/home/larry/$PROMAX_HOME might contain subdirectories
for only those tools on which Larry is working, plus the
subdirectories necessary for his own version of exec.exe. When
Larry links his User versions of exec.exe, the exec Makefile will
ensure that any prerequisite libraries found in Larrys
$PROMAX_HOME directory tree are up-to-date. Any
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
135
C Environment
Other Docs
Known Problems
C Process Components136
C Process Components
The components of a ProMAX process written in the C
programming language are as follows:
a menu
an init_ subroutine
an exec_ subroutine
included files
an entry in the toolcall source file (toolcall.c or toolcall.f)
an entry in the Processes list
Other Docs
Known Problems
Note that:
Other Docs
Known Problems
In other words, the _ must follow the tool name and all
arguments must be pointers. In this example, the exec_ calling
arguments are for a simple tool.
Other Docs
Known Problems
Global Parameters139
Global Parameters
The cglobal.h file (listed in the C Programming Examples
appendix) provides the facilities for accessing the ProMAX
external global common blocks using C structures. In
FORTRAN, common blocks are stored in a format similar to
structures in C. For example, using cglobal.h, the C variable
globalRuntime->samprat
Other Docs
Known Problems
Global Parameters140
Re-Entrancy
ProMAX modules handle re-entrancy by putting the permanent
variables in structure called parms by using the following
syntax. ProMAX FORTRAN modules handle re-entrancy by
keeping permanent variables in the common block
SAVED_PARMS. The Executive copies the variables out of
SAVED_PARMS to a private storage area after each routine is
called to avoid a conflict between variables of two separate calls
of the same module in a flow. The variables are then copied
back before the routine is called again.
BEGINPARMS
int int1, anotherInt;
float aFloat, anotherFloat;
Tbl *vel_tbl;
ENDPARMS(parms);
Other Docs
Known Problems
141
Tool Types
Executive Tools
Simple Tools
Ensemble Tools
Panel Tools
Complex Tools
Stand-alone Tools
IPC Tools
Other Docs
Known Problems
Executive Tools142
Executive Tools
The Executive supports six varieties of tools: simple, ensemble,
panel, single buffer, double buffer, and complex (with the input
tool being special case of the complex tool). Each of these tool
types is designed to expedite the coding of typical trace
handling situations that arise in seismic processing. The
Executive attempts to do as much as possible to simplify data
management and the development environment (see the
Executive chapter).
Each of the Executive tools require a subroutine known as the
init phase and another subroutine known as the exec phase. The
name of an init or exec subroutine is dictated by ProMAX. The
name of the init routine is the tool name preceded by INIT_.
The name of the exec phase is the tool name preceded by
EXEC_. The Executive uses the tool name found in the
exec_data portion of each menu in the flow (see the Menu
chapter) pre-pended with init or exec to call the appropriate
tool.
The following sections describe the purpose and general
structure of the init and exec subroutines, and the mechanism by
which processing parameters are passed between the routines.
The buffered tools (single and double buffered tools) also
require a subroutine called the flow routine, which is discussed
later in the buffered tools sections.
init Subroutine
The init routines are responsible for:
Other Docs
Known Problems
Executive Tools143
reserving any memory that would be held for the entire job.
For example, memory buffers of the size of a few traces
would be considered too small to bother allocating and deallocating in the exec phase. Buffers the size of a shot
gather would normally be allocated in the exec phase and
de-allocated after each group of traces exited the tool.
In short, the init subroutine does things that need to be done just
once during the execution of a particular processing tool.
The final and important responsibility of the init subroutine is to
set the values of the init subroutine return arguments called
LEN_SAV and ITOOLTYPE. The LEN_SAV parameter is the
number of memory words allocated to keep re-entrant
parameters and variables. ITOOLTYPE is a integer variable
indicating the tool type. The tool types are defined in the global
parameter include files global.inc for FORTRAN and cglobal.h
for C. Both of these variables must be set prior to exiting the init
routine.
The init phase routine for all tool types has the same calling
arguments, those of LEN_SAV and ITOOLTYPE. The
following is the subroutine definition for the Amp Ratio
exercise (see Simple Tool Examples appendix).
SUBROUTINE INIT_AMP_RATIO( LEN_SAV, ITOOLTYPE )
Other Docs
Known Problems
Executive Tools144
exec Subroutine
The exec subroutine is the subroutine that actually processes
data. The processing parameters are passed to the subroutine
through the saved parameters. The exec subroutine is normally
called multiple times within a processing flow since it processes
a natural grouping of traces and then passes those traces along
to tools that are further down the flow. The exec subroutine of a
band-pass filter program, for example, would be called each
time a new trace is passed down the pipeline to be filtered.
Since the exec routine is called multiple times, it is good
programming practice to deallocate memory that is allocated
within the exec subroutine before the routine returns control to
the trace executive.
A feature common to all exec tools is the cleanup condition.
After the last trace has passed through a tool in the flow (the rest
of the flow may have been executing for some time), the
Executive will call that routine one more time with the global
runtime ICLEANUPz set to true(=1). In C this value is in
globalRuntime->cleanup. This gives the tool an opportunity to
release any allocated memory, flush buffers of data, etc., and
signals the Executive not to call this portion of the flow again.
Other Docs
Known Problems
Executive Tools145
Simple Tools
Simple tools are designed for those numerous seismic data
processing tools that only require a single trace at a time.
Scaling, bandpass filtering, spiking decon, NMO correction,
static shifting, and geometry installation are all examples. The
simple tool assumes a single trace will be input, the tool will
process the trace, and then output the processed trace to be
picked up by the trace executive routine. No buffering or special
directives to the Executive are required.
The amp_ratio example module makes an approximate first
break pick by finding the maximum of the ratio of a pair of
adjacent sliding time windows. After making the pick, the user
optionally stores the results in the trace headers and TRC
Ordered Database. The program also demonstrates the use of
interpolated time gates to limit the pick search range. This
example can be found in the Simple Tool Examples appendix.
Before leaving the init phase of amp_ratio, or any simple tool,
ITOOLTYPE must be set to ISIMPLEpz.
Other Docs
Known Problems
Executive Tools146
The exec phase routine for the Amp Ratio simple tool has the
following calling arguments:
SUBROUTINE EXEC_AMP_RATIO( TRACE, ITHDR, RTHDR )
Other Docs
Known Problems
Executive Tools147
Ensemble Tools
The next most common bundle size for traces is an ensemble,
where data is collected as shots, CDPs, receivers, offsets, etc.
Ensemble tools pass an ensemble of traces in and out of the
exec routines. Two dimensional filtering, such as FK, is a good
example of such processing. An ensemble tool must input and
output one ensemble in each call of the exec routine; however,
the number of traces in the output ensemble can be different
than the input.
Refer to the Ensemble Tool Examples appendix for examples of
an ensemble tool. The AVO attribute analysis creates either a
zero offset or gradient stack of incoming ensembles, and
provides an example of fewer traces in the output ensemble than
the input. In the prestack trace interpolation example, more
traces are output than were input.
Before leaving the init phase of an ensemble tool, ITOOLTYPE
must be set to IENSEMBLEpz in FORTRAN or IENSEMBLE
in a module written in C.
The exec phase of a FORTRAN ensemble tool has the
following calling arguments:
SUBROUTINE EXEC_AVO( TRACES, ITHDRS, RTHDRS, NSTORED )
The input trace and header arrays are two dimensional in the
sense that there are multiple traces and headers in each array. A
FORTRAN program can dimension the TRACES array as
REAL TRACES( NUMSMPz, MAXDTRz)
Other Docs
Known Problems
Executive Tools148
Panel Tools
Panel tools are designed to handle situations in which a 2D
processing step is to be applied to a dataset but there is not
Other Docs
Known Problems
Executive Tools149
Other Docs
Known Problems
Executive Tools150
Other Docs
Known Problems
Executive Tools151
Note that the mix traces are a subset of the panel edge;
therefore, the number of mix traces must be less than or equal to
the number of edge traces. If the init subroutine of a panel tool
does not call EX_PANEL_PARMS, then the tool defaults to an
ensemble tool and the advantages of the panel tool are lost.
The exec phase routine for a panel tool has the same calling
arguments as the ensemble tool:
SUBROUTINE EXEC_PANEL_TEST( TRACES, ITHDRS, RTHDRS,
NSTORED )
for C.
The NSTORED argument passes the number of traces found in
the current panel. NSTORED will be equal to the panel size in
traces specified in the init phase, except when the last trace in
the panel is at the end of a datasets or is at the end of an
ensemble that was not large enough to fill out the panel.
Other Docs
Known Problems
Executive Tools152
Other Docs
Known Problems
Executive Tools153
traces
Time padding
A padded 2D array
In FORTRAN programs it is vital to dimension the input trace
array to the exec routine as being NUMSMPz + the number of
padding samples. Therefore, the number of padding samples
must be sent to the exec routine from the init routine through
the SAVED_PARMS common block. Panel modules written in
C must also handle the extra trace length. See the example
programs in both C and FORTRAN in the panel test sections of
the Panel Tool Examples appendix.
Known Problems
Executive Tools154
Input arguments
Input arguments consist of:
TRACES: the 2D array of input accumulated traces
ITHDRS: the 2D array of trace accumulated headers
equivalenced to RTHDRS
NSTORED: number of traces currently stored in TRACES
IFOUND_EOJ: flag to indicate if the EOJ trace has been
encountered (1=true). Since you are accumulating traces,
you may hit the end of the dataset prior to reaching your
Other Docs
Known Problems
Executive Tools155
criteria
for processing. In that case, you will be given the last trace
again,
without incrementing NSTORED, and must react
accordingly.
Output arguments
Output arguments consist of:
NOUTPUT: number of traces that the tool will output from the
exec
subroutine. This argument must be set to a value of 1 or
greater for
the exec subroutine to be called.
NOVERLAP: number of input traces to include in the next
buffer that
is accumulated. The last NOVERLAP traces in the current
buffer
will be the first NOVERLAP traces in the next buffer that
is
accumulated in the flow routine.
The exec phase routine for an single buffer tool has the
following calling arguments in FORTRAN:
SUBROUTINE EXEC_ENS_DEFINE( TRACES, ITHDRS, RTHDRS,
NTR_BUFF )
This is the same as ensemble and panel tools, with the addition
of the parameter NTR_BUFF. NTR_BUFF is the size, in traces,
of the TRACES buffer and is set to the maximum of NSTORED
or NOUTPUT. If the number to be output is greater than the
number of traces stored, then the number of data traces that are
actually in the buffer to be processed must be sent to the exec
subroutine via the saved parameters.
Like ensemble tools, the number output can be larger (or
smaller) than the number accumulated. This could get tricky
with trace overlapping. Remember that NSTORED minus
NOVERLAP traces will be dropped from the first portion of the
Other Docs
Known Problems
Executive Tools156
buffer, and that the next NOVERLAP traces are saved at the
beginning of the buffer to start the next call of the flow routine.
When the flow tool is called again, the buffer will have the
NOVERLAP saved traces plus the next trace coming down the
pipe.
Other Docs
Known Problems
Executive Tools157
Complex Tools
If none of the of the multi-trace tool types handle your needs for
trace bundling, you must finally resort to the complex tool
which offers the ultimate in multi-trace I/O flexibility. This
flexibility comes at a price. You must now handle trace
buffering and block your code into logical units for buffer filling
and flushing. Most tasks can be accomplished without resorting
to complex tools, but, if the need arises, this style of multi-trace
processing is only slightly more difficult.
Please refer to the Complex Tool Examples appendix for an
exercise example of a complex tool. This example process
transforms a shot ensemble so that the time axis is replaced by
the space axis. In other words, the shot is turned on its side.
Before leaving the init phase of a complex tool, ITOOLTYPE
must be set to ICOMPLEXpz in FORTRAN and ICOMPLEX
in a module written in C. The exec phase calling arguments of
complex tools is identical to simple tools:
SUBROUTINE EXEC_TRANSFORM( TRACE, ITHDR, RTHDR )
Like simple tools, one trace is input or output from the exec
routine at a time. Unlike simple tools, complex tools can declare
their state to be filling (only receiving), flushing (only giving),
or both (pipe: input and output in same call, same as a simple
Other Docs
Known Problems
Executive Tools158
tool). The exec phase of complex tools must declare their state
prior to exiting the routine. The options are described in the
following table:
Complex Tool Options
Option
Description
FILL
Set by a call to EX_FILLMODE. This tells the Executive that the tool is not supplying a trace
upon exit, but that it expects to receive one on the next call. Presumably you are filling a buffer
of traces for future processing. Note that in the very first call to the exec routine, a trace is
passed in and either kept or output depending on the mode (FILL, etc) set before exit. One
slight quirk of the system is that there is no mechanism to know if the trace you just received
and stored is the last trace to be input to the flow. If the trace is the last input trace and the tool
remains in fill mode, the Executive will pass the tool a dummy trace in the next call that has
the trace header entry EOJ set to 1. The tools cleanup flag will not be set (which terminates
the tool from the flow) because the Executive knows that traces are buffered and will be
released later. You are responsible for checking this flag and responding by processing the
traces that have been saved in the routine and then outputting them, primarily by using
FLUSH mode. The EOJ flag appears only ONCE when a tool is in FILL mode, so if there are
traces to dump after the EOJ trace appears, it is a good idea to keep a saved parameter stating
that the EOJ trace has been seen.
FLUSH
Set by a call to EX_FLUSHMODE. This tells the Executive that the tool is supplying
(outputting) traces to the flow upon exit, one trace per call, and that it will not receive a new
trace on the next call. This mode is for flushing traces from a buffer after processing.
PIPE
Set by a call to EX_PIPEMODE. This tells the Executive that a trace will be supplied to the
flow upon exit, and that a trace is expected to be input on the next call. If the last valid trace
has been input to a tool and it asks for another trace in pipe mode, the Executive sets the
cleanup flag to TRUE which terminates the flow for this tool. A complex tool that is always in
pipe mode behaves as a simple tool; in other words, the Executive assumes that the trace being
input is the same trace that is being output and that there are no traces buffered within the tool.
This is not always a valid assumption; however, EX_PUSHMODE alleviates this problem.
When shifting from fill to flush modes, there will be a single call to pipe mode when you are
flushing the last trace in a buffer and expect to start filling the buffer again on next call.
Other Docs
Known Problems
Executive Tools159
Description
PUSH
Set by a call to EX_PUSHMODE. Push mode behaves exactly like pipe mode except for the
important difference that the EOJ trace is input to the tool. Recall that when a tool is in pipe
mode, the Executive does not pass the EOJ flag to the tool. The ability to see the EOJ flag
allows the tool to flush traces that may be stored in a buffer internal to the routine. If a tool has
more traces to flush after the EOJ flag has been found, it goes into flush mode until all of the
traces have been dumped into the processing flow, at which point the tool sets itself to pipe
mode to trip the cleanup flag. The general logic is as in the following pseudo-code for the exec
subroutine.
if( trace header has end of job flag (EOJ) )
set a saved variable that indicates the EOJ trace has
been seen
have_seen_EOJ_flag = TRUE
endif
if( have_seen_EOJ_flag is TRUE )
move trace and header from buffer to output trace
if( the trace being dumped is the last to dump )
set to pipe mode to trigger cleanup mode on next call
else
set to flush mode to continue outputting traces
endif
else
set to push mode, output this trace, accept the next
input trace on next call
endif
A very important point regarding the EOJ flag is that only ONE trace will be passed to the
exec_ subroutine in which the EOJ trace header is set to 1; thus, the have_seen_EOJ_flag
variable is set in the preceeding pseudo-code.
QUIT
Set by a call to EX_QUITMODE. This tells the Trace Executive that the exec subroutine
flushed the last trace in the flow on the previous call to the exec subroutine by using
EX_FLUSHMODE. EX_QUITMODE is called when the exec subroutine is called and:
- it finds that it has no more traces to pass to the trace executive,
- there are no more traces to come, and
- it is time to set the cleanup flag and have the flow terminated for this tool
This is appropriate for the case where the entire stack line was filled, processed, and flushed.
You know you are done when the last trace in the buffer is gone.
Other Docs
Known Problems
Executive Tools160
Other Docs
Known Problems
Stand-alone Tools161
Stand-alone Tools
There are certain situations to which the pipeline model of trace
flow is not well suited. Modules that need to randomly access
traces off the disk many times are such examples. In these cases
a stand-alone tool that does its own trace I/O may be the answer.
(Executive multiple iteration tools have largely eliminated the
need for stand-alone tools that handle data traces. Refer to the
preceeding discussion in the Complex Tools section of this
chapter.)
ProMAX supports stand-alone executables for data input only.
These executables are launched by the Super Executive just as
the Executive. However, the menu for a stand-alone tool must
supply the executable name in a special section in the exec_data
portion of the menu. The tool is declared a stand-alone type to
the super exec in the same section. The TOOLTYPE and
PATHNAME parameters pass on this information to the super
exec, for example:
exec_data: (STAND_ALONE
(SPECIAL
(TOOLTYPE
implicit: STAND_ALONE)
(PATHNAME
implicit:
/usr/dave/poststack.exe)
)
(GENERAL
(LABEL
implicit: (value LABEL))
)
)
Known Problems
Stand-alone Tools162
Other Docs
Known Problems
IPC Tools163
IPC Tools
IPC tools are a relatively new way of programming a ProMAX
process. We recommend this approach to people for starting to
program in ProMAX. If you are an experienced ProMAX
programmer, note that IPC tools used to be called socket tools.
While most inline flow tools reside in a giant program called the
executive, IPC tools are separate programs that pass data via
sockets. As traces come down the processing flow, they are sent
at the appropriate place from the Executive to the IPC tool.
After the processing of each individual trace or group of traces,
the IPC tool sends them back into the Executive where they
continue down the flow. All the communication and associated
bookkeeping is hidden by input and output routines. To the
programmer, this tool is compiled similar to a stand alone
program. To the user, the IPC tool looks like any ProMAX tool.
The main advantages of this method of incorporating modules
into ProMAX are:
Other Docs
Known Problems
IPC Tools164
module. IPC tools are also easy to trade since you do not need
to trade the entire executive.
On the downside, the IPC tool is less efficient that a normal
tool because of the overhead of data transfer; however, this
overhead is generally very small. And, at present, IPC tools can
only run on the same machine as the executive.
The best approach for understanding IPC tools is to examine the
example programs in the IPC Tool Examples appendix. The
comments in the code describe the steps. The user does not have
to alter the Executive or toolcall source code. The proper subset
of the packet file from the menu is transferred to the the IPC
tool. You can have repeated instances of the same IPC tool in a
flow. And, the IPC tool can access the data base and use other
ProMAX features, just as any normal stand alone program can.
Note, however, that all header routines must be preceded with
an st for C (stHdrAdd instead of hdrADD) and ST_ for
FORTRAN (ST_HDR_ADD instead of HDR_ADD). The same
is true for the Executive error routines.
The IPC tool is designed mainly for C programs but can be used
with FORTRAN programs. Some wrappers for the C routines
may need to be written.
Other Docs
Known Problems
IPC Tools165
Other Docs
Known Problems
IPC Tools166
Other Docs
Known Problems
167
Global Parameters
Other Docs
Known Problems
Other Docs
Known Problems
Description
GLOBAL_CHARcz (FORTRAN)
globalChar (C)
GLOBAL_RUNTIMEcz (FORTRAN)
globalRuntime (C)
Other Docs
Known Problems
Description
GLOBAL_GEOMcz (FORTRAN)
globalGeom (C)
GLOBAL_MISCcz (FORTRAN)
globalMisc (C)
GLOBAL_COORDcz (FORTRAN)
globalCoord (C)
GLOBAL_AQUIScz (FORTRAN)
globalAcquis (C)
Other Docs
Known Problems
171
Other Docs
Known Problems
LIN (line)
SIN (source index number)
SRF (surface location)
CDP (Common Depth Points)
CHN (channel)
TRC (trace)
OFB (offset bin)
ILN (3D inline number)
XLN (3D crossline number)
Other Docs
Known Problems
....
....
PARM 1
PARM 2
PARM 3
PARM 4
PARM 5
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Standard Orders176
Standard Orders
The following table describes the nine standard orders.
Standard Orders
Order
Description
LIN Order
The LIN Order contains information that is unique to the LINE, such as:
Geometry:
EXDATUMz - Final datum elevation (if not variable)
IUNITSz - Type of units
ISRCTYPz - Source type
NSHOTSz - Total number of live shots
NUMCDPz - Total number of CDPs
Etc.
TRC Order
The TRC Order contains information that is unique to each trace, such as:
Geometry:
SIN - Shot index numbers of every trace
SRF - Receiver surface location number of every trace
CDP - CDP bin number of every trace
CHN - Channel number of every trace
OFFSET - Source-receiver offset of every trace
SIN_LTBL - SIN look-up table
SRF_LTBL - Receiver surface location look-up table
OFB_LTBL - OFB look-up table
CDP_LTBL - CDP look-up table
ILN_LTBL - ILN look-up table
XLN_LTBL - XLN look-up table
User parameters:
First break pick times
Trim statics
Source-receiver offsets
Etc.
Other Docs
Known Problems
Standard Orders177
Description
SIN Order
The SIN Order contains information that is unique to each source, such as:
Geometry:
NCHANS - Number of channels in each source
X_COORD - X coordinate of every source
Y_COORD - Y coordinate of every source
ELEV - Elevation of every source
SRF - Nearest surface location number of every source
SOURCE - Live source number of every source
PATTERN - Pattern number of every source
PATT_REF - Pattern reference surface location of every source
DEPTH - Hole depth of every source
UPHOLE - Uphole time of every source
SLOOKUP - Starting address in SIN look-up table for every source
User parameters:
Source statics
Etc.
Source index numbers are unique sequential numbers that are assigned to all of the
records that exist in the dataset that is used to initialize the database. They include
records that are not live sources. Live sources are therefore a subset of shot index
numbers and not a suitable order.
SRF Order
The SRF Order contains information that is unique to each surface location, such as:
Geometry:
FOLD - Receiver fold of every surface location
X_COORD - X coordinate of every surface location
Y_COORD - Y coordinate of every surface location
ELEV - Elevation of every surface location
SLOOKUP - Starting address in SRF look-up table for every surface location
Plus user parameters:
Surface location statics
Etc.
Surface locations are surveyed positions where either a shot or receiver may be placed.
For 2D data, surface locations are generally equivalent to stations. However, 3D data
generally have separate locations for shots and receivers resulting in stations locations
being the super-set of all shot and receiver positions. Receiver locations are therefore
subset and not a suitable order.
Other Docs
Known Problems
Standard Orders178
Description
CDP Order
The CDP Order contains information that is unique to each CDP bin, such as:
Geometry:
FOLD - Fold of every CDP
X_COORD - X coordinate of every CDP
Y_COORD - Y coordinate of every CDP
ELEV - Elevation of every CDP
SRF - Nearest surface location to every CDP
SLOOKUP - Starting address in CDP look-up table for every CDP
Plus user parameters:
CDP statics
Etc.
ILN Order
The ILN Order contains information that is unique to each ILN bin, such as:
Geometry:
FOLD - Fold of every ILN
SLOOKUP - Starting address in ILN look-up table for every ILN
XLN Order
The XLN Order contains information that is unique to each XLN bin, such as:
Geometry:
FOLD - Fold of every XLN
SLOOKUP - Starting address in XLN look-up table for every XLN
OFB Order
The OFB Order contains information that is unique to each OFB bin, such as:
Geometry:
OFB_CNTR - Offset bin center
MEAN_OFF - Mean offset within the bin
FOLD - Fold of every OFB
SLOOKUP - Starting address in OFB look-up table for every OFB
Plus user parameters:
Offset amplitude adjustment
Etc.
CHN Order
The CHN Order contains information that is unique to each channel, such as:
Channel gain constants
Channel statics (if appropriate)
Etc.
Other Docs
Known Problems
179
Trace Headers
Other Docs
Known Problems
Other Docs
Known Problems
in a prior flow. But any tool can create new trace header entries.
The decision to create a new header entry is left entirely in the
hands of the applications programmers whenever some piece of
information should be passed downstream in the processing
flow to other tools.
Trace headers are passed from tool to tool in an array, but the
format of the individual entries can vary. Currently supported
formats are integer, real, double precision real (seldom used),
logical (seldom used), and character (stuffed into integers).
Each header entry can actually be an array of values, although
the length must be a whole number of words. Complicated
entities such as C structures can also be included in the trace
headers.
For convenience, the trace header is presented in the calling
arguments of the execution routine of every tool in both integer
AND real format to avoid the need for juggling the formats of
common trace header entries (the integer and real array are
equivalent within the toolcall routine and therefore occupy the
same memory).
Any tool may access the trace header entries that were added by
tools that occur earlier in the flow, but first the tool must know
where to find the entries and what their lengths and formats are.
This information is provided by the routine HDR_NAMINFO
(or hdrInfo in C), which returns the description, length, format,
and index of a trace header entry that was specified by name.
The routine HDR_INDINFO (or hdrIndexInfo in C) returns the
name, description, length, and format of a trace header entry
that was specified by index.
For programmers to communicate via trace headers, there must
be some agreement on what the names and definitions of
headers are. A standard list can be found in the file
$PROMAX_PORT_MISC/header.list. It is important to note
that this is not the list of headers that WILL exist during any
given flow, it is just a list of what certain headers will look like
if they DO exist. It is also important to remind yourself that the
order of the headers may be different between any two flows
and has nothing to do with the order that they appear in
header.list. The strict definition and use of all of the standard
header entries is presented in at the end of this chapter.
There is a subset of the standard trace header entries known as
the guaranteed headers that are always guaranteed to exist in a
Other Docs
Known Problems
Description
Initial Values
SEQNO
(variable)
END_ENS
End-of-ensemble flag.
(variable)
EOJ
End-of-job flag.
(variable)
TRACENO
(INULLpz)
TRC_TYPE
(ILIVEpz)
TLIVE_S
(0.0)
TFULL_S
(0.0)
TFULL_E
(end of trace)
TLIVE_E
(end of trace)
LEN_SURG
(0.0)
TOT_STAT
(0.0)
NA_STAT
(0.0)
AMP_NORM
(1.0)
TR_FOLD
(1.0)
SKEWSTAT
(0.0)
LINE_NO
LSEG_END
(NLASTpz)
LSEG_SEQ
(1)
The initial values are the values to which the headers are
initialized before some tool in the flow changes them. The
initial values for other (non-guaranteed) header entries must be
explicitly set in the execution phase by the tool that created
them. If the tool does not supply values, the Executive will
insert system-wide null values (INULLpz or RNULLpz in
FORTRAN and INULL and RNULL in C). This does not
necessarily indicate that a bug is present. For example, if new
header entries are created in one side of a branched flow, the
header entries will be defined in the other side of the flow, but
their values will be null.
In most cases, tools call HDR_NAMINFO (hdrIndex in C)
simply to find out where a standard header entry can be found
Other Docs
Known Problems
during the current flow. Since this use is widespread, the indices
of the standard headers is placed in a C structure or FORTRAN
COMMON block for easy access. Use of any of these function
requires inclusion of header.inc or cglobal.h. C programmers
should note that the array index values provided for the standard
headers in cglobal.h point to the same place in memory as the
FORTRAN common block and that the array index values are
appropriate for FORTRAN. A value of 1 must therefore be
subtracted from a standard header index value to be correctly
used in a ProMAX module written in C. The following macro is
defined in cpromax.h to aid in making code clear when using
standard headers in C:
#define STDHDR(x) ( (stdHdr->x)-1)
Other Docs
Known Problems
FB_PICK (64)
OFFSET (41)
SOU_H2OD (37)
AOFFSET (42)
FFID (19)
PR_STAT (62)
FK_WAVEL (71)
PS_STAT (61)
SOU_STAT (58)
FK_WAVEN (70)
REC_DEP (48)
SOU_X (31)
CDP( 22)
FNL_STAT (55)
REC_ELEV (30)
SOU_Y (32)
CDP_ELEV (40)
FRN_TRNO (8)
REC_H2OD (36)
CDP_NFLD (23)
FT_FREQ (72)
REC_NFLD (26)
SR_AZIM (49)
CDP_SLOC (27)
GEO_COMP (45)
REC_SLOC (24)
TFULL_E (67)
CDP_X (38)
ILINE_NO (50)
REC_STAT (57)
TFULL_S (66)
Other Docs
Known Problems
LAST_TRC (4)
REC_X (28)
TLIVE_E (68)
CHAN (20)
LEN_SURG (69)
REC_Y (29)
TLIVE_S 965)
CR_STAT (60)
LINE_NO (7)
REPEAT (6)
TOT_STAT (53)
CS_STAT (59)
LSEG_END (9)
SEQNO (2)
TRACENO (5)
DEPTH (34)
LSEG_SEQ (10)
SEQ_DISK (17)
TRC_TYPE (12)
DISKITER (15)
NA_STAT (52)
SIN (11)
TRIMSTAT (63)
DMOOFF (73)
NCHANS (21)
SKEWSTAT (56)
TR_FOLD (14)
DS_SEQNO (16)
NMO_STAT (54)
SOURCE (18)
UPHOLE (35)
END_ENS (1)
OFB_CNTR (44)
SOU_COMP (46)
XLINE_NO (51)
EOJ (3)
OFB_NO (43)
SOU_ELEV (33)
Header
Name
Type
Description
END_ENS
End-of-ensemble
flag*
integer
SEQNO
Sequence number in
ensemble
integer
Other Docs
Known Problems
Header
Name
Type
Description
EOJ
integer
TRACENO
Trace number in
seismic line*
integer
REPEAT
REPEATED data
copy number
integer
LINE_NO
integer
FRN_TRNO
integer
Used to store trace numbers from nonProMAX sources (such as the GeoQuest
IES System) to distinguish between traces
with a common LINE_NO.
Other Docs
Known Problems
Header
Name
Type
Description
LSEG_END
integer
LSEG_SEQ
Line segment
sequence number*
integer
10
SIN
integer
11
TRC_TYPE
integer
Other Docs
Known Problems
Header
Name
Type
Description
12
AMP_NORM
Amplitude
normalization factor
real
13
TR_FOLD
real
Header
Name
Type
Description
14
DISKITER
integer
15
DS_SEQNO
Input dataset
sequence number*
integer
16
SEQ_DISK
Trace sequence
number from disk
integer
Other Docs
Known Problems
Header
Name
Type
Description
17
SOURCE
integer
18
FFID
integer
19
CHAN
Recording channel
number
integer
20
NCHANS
Number of channels
of source
integer
21
CDP
integer
22
CDP_NFLD
Number of traces in
CDP bin
integer
Other Docs
Known Problems
Header
Name
Type
Description
23
REC_SLOC
Receiver index
number (internal)*
integer
24
SOU_SLOC
External source
location number
integer
25
SRF_SLOC
External receiver
location number
integer
26
REC_NFLD
Receiver fold
integer
27
CDP_SLOC
External CDP
location number
integer
28
REC_X
Receiver X
coordinate
real
29
REC_Y
Receiver Y
coordinate
real
30
REC_ELEV
Receiver elevation
real
Other Docs
Known Problems
Header
Name
Type
Description
31
SOU_X
Source X coordinate
real
32
SOU_Y
Source Y coordinate
real
33
SOU_ELEV
Source elevation
real
34
DEPTH
Source depth
real
35
UPHOLE
real
36
REC_H2OD
Water depth at
receiver
real
37
SOU_H2OD
real
38
CDP_X
X coordinate of CDP
real
39
CDP_Y
Y coordinate of CDP
real
40
CDP_ELEV
Elevation of CDP
real
41
OFFSET
real
Other Docs
Known Problems
Header
Name
Type
Description
42
AOFFSET
Absolute value of
offset
real
43
OFB_NO
integer
44
OFB_CNTR
real
Header
Name
Type
Description
45
GEO_COMP
Geophone
component (x,y,z)
integer
46
SOU_COMP
Source component
(x,y,z)
integer
47
SRC_DEP
real
48
REC_DEP
real
49
SR_AZIM
Source to receiver
azimuth
real
Other Docs
Known Problems
Header
Name
Type
Description
50
ILINE_NO
3D inline number
integer
51
XLINE_NO
3D crossline number
integer
Header
Name
Type
Description
52
NA_STAT
real
53
TOT_STAT
real
54
NMO_STAT
real
Other Docs
Known Problems
Header
Name
Type
Description
55
FNL_STAT
Static to move to
final datum
real
56
SKEWSTAT
real
57
REC_STAT
real
58
SOU_STAT
real
59
CS_STAT
Corr. autostatics
source static
real
60
CR_STAT
Corr. autostatics
recvr static
real
61
PS_STAT
Power autostatics
source static
real
62
PR_STAT
Power autostatics
recvr static
real
63
TRIMSTAT
Trim static
real
64
FB_PICK
real
Other Docs
Known Problems
Header
Name
Type
Description
65
TLIVE_S
real
66
TFULL_S
real
67
TFULL_E
real
68
TLIVE_E
real
69
LEN_SURG
Length of surgical
mute taper
real
Other Docs
Known Problems
Header
Name
Type
Description
70
FK_WAVEN
Wavenumber of F-K
domain trace
real
71
FK_WAVEL
Wavelength of F-K
domain trace
real
72
FT_FREQ
Frequency of F-T
domain trace
real
73
DMOOFF
real
Header
Name
Type
Description
74
AS_STAT
Autostatics source
static
real
75
AR_STAT
Autostatics receiver
static
real
Other Docs
Known Problems
197
Parameter Tables
Table Rules
Table Interpolation
X Values in Tables
Table Extrapolation
Other Docs
Known Problems
X1
X2
P
Other Docs
Known Problems
Surface locations of
CDP bins
X2
Y
Marks a time at which a velocity is stored
Other Docs
Known Problems
Table Rules
Some important rules about the structure of tables are as
follows:.
Table Interpolation
The following figure shows a set of scattered points in the
X1, X2 plane of a ProMAX table. These points might be
surface locations in a 3D seismic survey or points in any other
reference frame that is appropriate for a ProMAX table.
Assume that a set of parameters have been picked for each of
these points; in other words, there are Z values stored at Y
locations at each point in the plane. Also in the plane is a point
marked P, which is at coordinates (X1p, X2p). No parameters
have been picked at P; the goal of interpolation will be to
approximate values for Z(X1p, X2p, Y) based on the points that
are near to P. The question that is then raised is, Which of the
points that are near to P should be used for the interpolation?
Other Docs
Known Problems
X1
P(X1p, X2p)
X2
Other Docs
Known Problems
X1
X2
Other Docs
Known Problems
X1
B
X2
P
A
(X1a, X2a, Y)
Other Docs
Known Problems
X1
B
X2
P
A
(X1a, X2a, Z)
X Values in Tables
The primary use of tables is for interpolation of parameters in
2D and 3D seismic data processing. The parameters that are
interpolated are frequently associated with some integer
ensemble number, such as CDP bin number or Source Index
Number (SIN). Both CDP and SIN can be associated with
spatial locations on the ground such as the CDP bin location or
the source location.
When there is a 1-to-1 mapping between ensemble number and
spatial coordinates, ProMAX table information can be referred
to by either ensemble number or by the X1, X2 coordinates. For
example, interpolation of parameters can be done with the
subroutine tblInterpXY using just the ensemble number, which
is referred to as X in the calling arguments. The interpolation
Other Docs
Known Problems
can also be done with the routine tblInterpZ which uses X1, X2
pairs to describe the location at which interpolation is to be
done. Tables can be built and used via either or both methods. In
the internals of the code, the tables are referenced by the X1, X2
values, so mapping goes on between X and X1, X2.
Table Extrapolation
The preceeding discussion of value interpolation assumed that
there were points bracketing the location for which
interpolation was being done. In cases where a value is beyond
the limit of known table values, the new value must be
extrapolated from values within the table.
Extrapolation in the X1, X2 plane: The rules for extrapolation
in the X1, X2 plane are simple. If interpolation is requested for
an X1, X2 location outside the table, then the point on the table
that is nearest the requested point is found. The Y and Z values
at the requested point are set equal to the Y and Z values of the
nearest point. Note that the nearest point might be (probably
will be) an interpolated point. See the following figure.
X1
Requested point
X2
Known Problems
interpolation routines
Known Problems
Other Docs
Known Problems
Example 1
The first FORTRAN example comes from the subroutine
INIT_AMP_RATIO, which can be found in the example source
code amp_ratio.f. This code is actually altered slightly from the
original amp_ratio.f to minimize code that is extraneous to this
discussion.
In this example, a table that holds start and end times for a time
gate is read from the database. The table DB_TBL_GET
allocates memory for the table and loads the table values into
that memory. The routine returns an argument called
ITBL_HANDLE. This is a numerical value that should not be
changed, as it is the memory location of the table. This value of
ITBL_HANDLE is the way in which the table is referenced.
Any subroutines that make use of the table will pass
ITBL_HANDLE to the routine so that the table can be uniquely
identified.
C ..... Get the name of the time gate file from the menu
CALL EX_CGETPARM( 'GATENAME', 1, CGATENAME,
NCHARS )
C ..... Get the gate table from the database
CALL DB_TBL_GET( 'GAT', CGATENAME, ITBL_HANDLE,
IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_PROMAX_ERR( IERR )
CALL EX_ERR_FATAL(
&
'Cannot open time gate ' //CGATENAME )
ENDIF
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Example 2
In order to create a new ProMAX table, the user must have first
created a table name while working in the user interface. The
program that will fill the table with data must get the name of
the table into which the table data will be written. The name of
the table is acquired with the routine EX_CGETPARM in the
INIT_ subroutine, as is shown in the previous example. Note
that the name of the table that is acquired from a call to
EX_CGETPARM is the 8-character label (or hash name) which
is generated from the table description input by the user. In
order write to the table, you must find the descriptive name by
use of the routine TBL_DESC_FROM_DB. Memory must then
be allocated for the table, which is done using
TBL_ALLOCATE.
The following code shows a working ProMAX module which
writes a new velocity table to the database.
C----------------------------------------------------------------------------C
C
Description:
C
Standard initialization routine
C
C
Output arguments:
C
LEN_SAVE - number of 4-byte words to save
for\ re-entrancy
C
ITOOLTYPE - processing tool type
C
C----------------------------------------------------------------------------SUBROUTINE INIT_DUMMYA( LEN_SAV, ITOOLTYPE )
#include "dummya.inc"
INTEGER LEN_SAV, ITOOLTYPE
INTEGER NCHARS, IERR
C ..... declare variable for user-given descriptive table
name
CHARACTER CTABLE_DESC*128
C ..... declare variable for lable or name created from\
CTABLE_DESC
CHARACTER CHASH_NAME*8
C ..... Call for the input parameter by name. Note the\
padding in the
C ..... character constant. It is the programmers\
responsibility to
C ..... provide the correct type of return argument.
Other Docs
Known Problems
C----------------------------------------------------------------------------C
C
Description:
C
Standard execution routine
C
C
Input/output arguments:
C
TRACE - array of trace samples
C
ITHDR - trace header (as integer)
C
RTHDR - trace header (as floating point)
C
C----------------------------------------------------------------------------SUBROUTINE EXEC_DUMMYA( TRACE, ITHDR, RTHDR )
#include "dummya.inc"
REAL TRACE(NUMSMPz), RTHDR(NTHz)
REAL XVALUE, YVALUE, ZVALUE
INTEGER ITHDR(NTHz), IERR
IF ( CLEANUPz ) THEN
CALL TBL_TO_DATABASE( ID_TABLE, 'VEL', IERR )
Other Docs
Known Problems
C Code Examples
This section contains two examples of C table routines.
Example 1
The first C example comes from the subroutine
init_amp_ratio_, which can be found in the example source
code ampRatio.c. This code is actually altered slightly from the
original ampRatio.c to minimize code that is extraneous to this
discussion.
In this example, a table that holds start and end times for a time
gate is read from the database. The table database allocates
memory for the table and loads the table values into that
memory. The routine returns a (void*) pointer to the table
location. The returned value is the way in which the table is
referenced. Any subroutines that make use of the table require
Other Docs
Known Problems
After the table is read into memory, the names of the X and Y
axes are retrieved using tlbDescX and tblDescY. The header
array indices for the X and Y keys are also retrieved using
hdrIndex. The number of Z values (times) is checked using
tblCountZ to be sure that it is exactly two (a start and end time),
otherwise this would be an invalid table for this operation.
This piece of code came from the initialization subroutine in
ampRatio.c. The table is read into memory only one time. It
will be preserved there until it is intentionally closed by the
programmer, or until the routine fails through exErrFatal or
some other means of stopping execution.
Next we see where the table that is created above is used in the
subroutine exec_amp_ratio, which can also be found in the
example code file ampRatio.c. The subroutine exec_amp_ratio
is given one data trace at a time to process, and the time gate is
Other Docs
Known Problems
Other Docs
Known Problems
Example 2
In order to create a new ProMAX table, the user must have first
created a table name while working in the user interface. The
program that will fill the table with data must get the name of
the table into which the data will be written. The name of the
table is acquired with the routine exParGetString in the init_
subroutine, as shown in the previous example. The name of the
table that is acquired from a call to exParGetString is the 8character label (or hash name) which is generated from the table
description input by the user. In order write to the table, you
must find the descriptive name by use of the routine
tblDescFromDatabase. Memory must then be allocated for the
table, which is done using tblAllocate.
The following code shows a working ProMAX module which
writes a new velocity table to the database.
/* This example shows how to create a new table in the
database. */
/* The example if for adding a new RMS velocity table */
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
/* define saved parameters */
BEGINPARMS
void *tblPntr;
ENDPARMS(parms)
/***-----------------------------------------------------------------Description:
Standard initialization routine
output arguments:
len_save - number of 4-byte words to save for\
re-entrancy
itooltype - processing tool type
--------------------------------------------------------------------***/
void
init_dummya_(int *len_sav, int *itooltype)
{
/* local variabes */
char *tblDesc; /* user-given descriptive table name
*/
Other Docs
Known Problems
/*******************************************************
**************
*
*
Description:
*
Standard execution routine
*
*
Input/output arguments:
*
trace - array of trace samples
*
ithdr - trace header (as integer)
*
rthdr - trace header (as floating [point)
*
********************************************************
**************/
Other Docs
Known Problems
Other Docs
Known Problems
219
Memory Management
Other Docs
Known Problems
Other Docs
Known Problems
C Memory Management221
C Memory Management
The C programming language provides a number of very
flexible capabilities for handling different kinds of data. C
structures, for example, allow associated data to be placed in a
data object that can be named and passed from one routine to
another. Because of the flexibility of C, there are several general
types of memory management routines within ProMAX which
handle different collections of data. The types of data
collections which are handled include:
multi-dimensional arrays
deques
heaps
queues
stacks
Multi-dimensional Arrays
The array memory management functions are intended to
simplify manipulation of multi-dimensional arrays in scientific
programming in C. These functions are useful only because true
multi-dimensional arrays in C cannot have variable dimensions
(as in FORTRAN). For example, the following function IS NOT
valid in C:
void badFunc(a,n1,n2)
float a[n2][n1];
{
a[n2-1][n1-1] = 1.0;
}
Other Docs
Known Problems
C Memory Management222
Other Docs
Known Problems
C Memory Management223
_mem
alloc
deque
_mem
Routine names that begin with _mem have the name and line
number of the subroutine from which the _mem routine is being
called as calling arguments. If a memory error occurs, then the
subroutine and line number at which the error occurred will be
reported. The _mem routines have _memFree routines to free
the allocated memory.
alloc
Routine names that begin with alloc allocate multi-dimensional
arrays without error messages if there is a memory error (such
as if there is insufficient memory to satisfy the request). Routine
names that begin with ealloc are routines that call the alloc
routines, but they also provide error messages and a graceful
exit from the program if there is a memory allocation error.
Memory allocated with alloc and ealloc routines is freed using
the routine names that begin with free.
deque
Routine names that begin with deque are used for creating and
using a deque. A deque is a double-ended queue; in other
words, entries can be inserted and extracted from either end of
the queue.
Other Docs
Known Problems
C Memory Management224
Heap
Routine names that begin with the heap are used for creating
and using a heap. A heap is an ordered, balanced binary tree in
which the value of the node at the root of any subtree is less
than or equal to the value of either of its children. There is no
implied relationship between siblings. Because the tree is
balanced, an array implementation is possible. With the array
implementation, if the root of a subtree is at position i in the
array, the left child will be at position 2*i+1 and the right child
at position 2*i+2, for a tree beginning with the (C convention)
position 0.
A heap can contain any size data type, but all the data in any
heap must be the same size and should be the same type.
Linked Lists
Routine names that begin with the ll are used for creating and
using linked lists. A singly-linked list is a data structure in
which the memory location of the next data node is stored as
part of the current data node.
Priority Queues
A priority queue is a limited interface to a heap data structure. It
is defined as a queue because as items are added, they are
automatically positioned appropriately, depending on their
relative priority to items already in the queue. Items are always
deleted from the front of a priority queue. This implementation
is based upon a heap data structure.
A priority queue can contain any size data type, but all the data
in any priority queue must be the same size, and should be the
same type.
Promax
Routine names that begin with promax are memory allocation,
freeing, and reallocation routines for 1D arrays. The routines
also provide the benefit of checking the ends of arrays to be
certain that they have not been overwritten. This is
accomplished through use of the routine promaxCheckmem().
Other Docs
Known Problems
C Memory Management225
Queues
Routine names that begin with queue are for allocation and use
of standard queues. The first entry input to the queue is the first
entry taken from the queue.
Memory reallocation
Routine names that begin with realloc are for use with the alloc
and ealloc routines. These routines allow arrays that were
allocated with alloc and ealloc routines to be resized.
Stack
Routine names that begin with stack are for allocation and
manipulation of data in a stack. A stack is a data structure in
which the last data value input to the structure is the first one
that can be retrieved from the structure.
References
Esakov, J., and Weiss, T., 1989. Data structures: an advanced
approach using C. Prentice Hall, p. 260-267.
Sedgewick, R., 1990. Algorithms in C. Addison-Wesley,
p. 148-156.
Other Docs
Known Problems
mem.inc
Three memory arrays are declared in the file
$PROMAX_HOME/port/include/mem.inc. One of these arrays
is the RSPACEz array, which is managed memory in the sense
that array bounds checking is provided by the ProMAX system.
Any array boundary that is overwritten due to a programming
mistake will be caught by the ProMAX system and the program
terminated with an error message. The array RSPACEz is used
for storing and accessing REAL (floating point) numbers. There
is also an array called ISPACEz for integer numbers. RSPACEz
and ISPACEz are equivalenced in memory. They occupy the
same space in memory, and the bit patterns in memory are
interpreted as being an INTEGER or REAL number depending
on which array you access; that is, RSPACEz or ISPACEz.
Another memory space that is available to the programmer is
the set of equivalenced 1-dimensional arrays RTEMPz,
ITEMPz, and CTEMPz for REAL, INTEGER, and CHAR data
types respectively. The TEMPz arrays are not managed memory
in the sense that array bounds are not checked; they are intended
to serve as a convenient place to put temporary results. The size
of the TEMPz array is 50000 four-byte words at the time of this
writing, but the programmer should check the array size by
looking at the value of the PARAMETER LTEMPpz in
$PROMAX_HOME/port/include/mem.inc if a question of the
size is important.
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
229
Overview of dbx
System Review
Debugging
Other Docs
Known Problems
Overview of dbx230
Overview of dbx
Debugging ProMAX programs can be done in a number of
ways, such as by using print statements in the code to report
variable values. However, experienced programmers find that
use of the programming tool called dbx is one of the most
efficient ways of debugging a program. The program dbx is
available on all hardware platforms on which ProMAX runs. It
allows a programmer to step through a computer program and
check variable values at any point in the execution.
This chapter is not a tutorial on the use of dbx. You can learn
about dbx by typing man dbx from the command line or
through the manuals provided with your computer hardware.
This chapter provides a tutorial on how to use dbx when
debugging a ProMAX module.
Other Docs
Known Problems
System Review231
System Review
Before we discuss the use of dbx with ProMAX, we will review
the components that make a process. The following figure
shows the sequence of events that occurs when a ProMAX job
is created and executed. The Job Builder (promax.exe) is the
part of the user interface where the user builds a job flow, telling
ProMAX which data processing steps to run. A binary file is
written by the Job Builder when either the Execute or Exit
buttons are clicked. This file is called a packet file which, in
addition to the processing steps in the flow, contains the
ProMAX Area, Line, and dataset to be processed. The packet
file is written to the file
$PROMAX_DATA_HOME/Area/Line/Flow/packet.job
where
Other Docs
Known Problems
System Review232
Job Builder
(promax.exe)
Batch
Queue
Super Executive
(super_exec.exe)
Stand-alone
Programs
Executive
(exec.exe)
Tool Caller
AGC
Diskread
NMO
Line Database
Information
(datasets, parameter tables,
ordered database files, etc.)
Mute
Filter
Packet File
Other Docs
Known Problems
Debugging233
Debugging
The following sections provide information and tips on
debugging with dbx.
from the command line. This is assumes that you have the
correct Makefiles and are in the right directory structure in the
ProMAX environment.
Other Docs
Known Problems
Debugging234
where
Running dbx
All that is required to run dbx is executable code which has
been compiled with the debug option set to yes, a packet.job
file, and the source code to the program that is being debugged.
Most programmers find it convenient to cd to the directory in
which the source code resides and create symbolic links to both
the packet.job and the executable code. For example, suppose
that a new ProMAX module existed in
~abc/$PROMAX_HOME/port/src/lib/maxtool/new_prog
Other Docs
Known Problems
Debugging235
Other Docs
Known Problems
Debugging236
Other Docs
Known Problems
237
Menus
Other Docs
Known Problems
Other Docs
Known Problems
Menu Heading
Parameter Specifications
exec_data
rules
'(
name: PROGRAM_NAME
label: "Sample ProMAX Menu"
value_tab: 48
Menu Heading
parameter: NUMTO_DO
text: "Input the number of traces to process"
type: int:
value: 3
mouse_text: "Type in number of traces to process."
parameter: PARM_VAL
text: " Input the processing parameter value"
type: typein:
type_desc: ( float: 6 nil 999999. )
value: 4.
mouse_text: "Input the parameter value "
exec_data: ("PROGRAM_NAME"
("GENERAL"
("NUMTO_DO " implicit: (value 'NUMTO_DO))
("PARM_VAL" implicit: (value 'PARM_VAL))
)
)
rules: (
(rule1 ( > ( value 'NUMTO_DO ) 3 )
(do_show 'PARM_VAL)
(do_not_show 'PARM_VAL))
)
)
Parameter
Specifications
Exec_data
Rules
Other Docs
Known Problems
Menu Heading
The menu heading has three important features plus two
optional feature. The first important feature is the '( which is
actually the first two characters in the file. Lisp makes heavy
use of parentheses to group related syntax together. There is a
corresponding ) at the end of the menu. The single quote mark
just before the parenthesis signals the Lisp interpreter to just
read the string that follows (the menu code), but to not evaluate
it.
The second line in the Menu Heading section is the name of the
program to which the menu belongs. This line is actually
optional, but it is a good idea to include it so that you can see
which program the menu belongs to without searching the rest
of the menu.
The third line is the label. This is the name that will appear in
the ProMAX processes list in the user interface. This string
should match the string in the Processes file (the file that
contains a list of menus and where they reside), or else a
harmless error will be issued in the window from which
ProMAX was started.
The fourth line in the Menu Heading is the value_tab. This
value specifies how many character spaces from the right end of
the menu text to place the input boxes in the menu.
The fifth line is the optional plot_label: keyword. In the menu
heading this parameter controls whether or not this process
appears in side label processing history plots. The default is nil,
i.e. not to include this process in the plot history. Set to t to
override the default. Individual process parameters may then
use the plot_label: keyword to provide further details in the
processing history.
Parameter Specifications
This section is used to specify names, types, and other attributes
of menu parameters. In the preceeding example menu, there are
two parameters, each of which has its own set of attributes.
The first line in the Parameter Specification is parameter:. The
parameter: line acts to declare a variable name, so the first
Other Docs
Known Problems
The default value for the parameter is set using the value:
attribute. This is the value that will appear on the screen when
the menu is first placed into a processing flow.
The final attribute in the example above is mouse_text: which
specifies the text that appears in a box at the bottom of the
ProMAX screen when the mouse pointer is on a parameter.
There are many variations of type and type_desc; for example,
the type can be a function, and the description of the function is
that it gets a list of header names and displays them to the
screen. An example of all the menu parameter types,
descriptions, etc., can be found in the Lisp Menu Code
Examples appendix..
Other Docs
Known Problems
exec_data
The first line in the exec_data section is
exec_data: ("PROGRAM_NAME"
Other Docs
Known Problems
("FOO
"
", 1, VALUE_PARM ).
Rules
The rules section is the part of the menu file that controls,
among other things, which parameters are hidden from the user
when they are not needed.
The rules section begins with the string rules( and ends with
a closing parenthesis. The rules themselves are of the form
( ruleName ( conditional statement )
(action if conditional statement is true)
(action if conditional statement is false)
)
The string ruleName represents a character string without blank
spaces that can contain anything. It serves as a label to give
some documentation as to what the rule accomplishes. The
string has no length limit except that it has to contain at least
one character. Note that additional documentation can be added
in a Lisp menu by preceding the documentation line with a
semi-colon. For example:
;this is a comment line
Other Docs
Known Problems
The type of evaluation is >, <, =, etc. The thing being evaluated
is some attribute of a parameter, such as its value; the
comparison value can be a constant or some expression, such as
the sum of two other parameters.
In the preceeding example menu, the value of NUMTO_DO is
evaluated to see if it is greater than 3 by the statement:
( > ( value 'NUMTO_DO ) 3 ).
In the preceeding menu file example, the only rule in the file
states that PARM_VAL is to be shown to the user on the menu
when NUMTO_DO is greater than 3.
The conditional statement need not be as simple as the one in
the menu file example above. It can contain compound statements such as and or if, as well as functions. For example, the
following rules section sets the condition that in order for the
parameter SHOW_PAR to be shown on the menu, the value of
parameter PARM1 must be equal to 1, the value of PARM2
must be equal to the value of PARM1, and the value of PARM3
must be equal to the sum of the values of PARM1 and PARM2.
The action statements can also have conditional and compound
statements within them.
rules:(
(rule1
(and
( = (value 'PARM1 ) 1 )
(and
(= (value 'PARM2 ) (value 'PARM1) )
(= (value 'PARM3 ) (+(value'PARM1) (value\
'PARM2)) )
Other Docs
Known Problems
)
)
(do_show 'SHOW_PAR)
(do_not_show 'SHOW_PAR)
)
)
Other Docs
Known Problems
Use Examples
Unlike the source code for ProMAX modules, you have access
to all of the ProMAX menus. Study and copy those files
liberally. It is likely that somewhere within the existing menus
there is a menu file that does something similar to what you
would like to do in your new menu.
Keep it Simple
Complex conditional statements can be difficult to debug (as in
any other programming language) but there are no debugging
tools such as dbx to debug Lisp code.
Other Docs
Known Problems
Lisp Primitives
We do not document the Lisp primitives in this manual; instead,
we direct you to two references:
Other Docs
Known Problems
Lisp Primitives
Lisp Primitive
Common Lisp
Reference
cdr
Yes
car
Yes
length
Yes
first
Yes
second
Yes
third
Yes
fourth
Yes
fifth
Yes
sixth
Yes
seventh
Yes
nth
Yes
nthcdr
Yes
last
Yes
list
Yes
append
Yes
cons
Yes
nconc
Yes
push
Yes
rplaca
Yes
pushend
No
remove
Almost
remq
No
delete
Almost
delq
No
copy
No
same as copy-list
copy-list
Yes
eq
Yes
equal
Yes
Yes
Other Docs
Known Problems
Common Lisp
Reference
>
Yes
>=
Yes
<
Yes
<=
Yes
member
Almost
memq
No
atom
Yes
numberp
Yes
listp
Yes
symbolp
Yes
and
Yes
or
Yes
null
Yes
not
Yes
boundp
Yes
assoc
Almost
assq
No
eval
Yes
Yes
makunbound
Yes
Yes
Yes
Yes
Yes
quote
Yes
'
Yes
Almost
if
Yes
cond
Yes
setq
Yes
Other Docs
Known Problems
Common Lisp
Reference
set
Almost
setf
Almost
progn
Almost
let
Almost
1, is in fact let*
defun
Almost
do
Yes
load
Yes
Description
value parm
type parm
type_desc parm
text parm
selected_item parm
mouse_text parm
error_list parm
Other Docs
Known Problems
Description
warning_list parm
value_tab parm
showing parm
do_show parm
do_not_show parm
Description
(dataset_list)
(header_list)
Other Docs
Known Problems
Database Functions
Function
Description
(parm_list parm_type)
This function returns a list of three elements, the third of which is a list
of the UNIX names of available parameter files. The first two elements
should not be depended upon as they are used internally by the menu
system. One string argument is required, such as "MUT", "VEL", etc.,
for the various types of parametric data.
(db_parmget_line var_string)
Description
(string_out var)
(string_shorten var)
(string_upcase var)
(string_downcase var)
(Yes thats how its spelled.) Returns the concatenation of its string
arguments as one long string.
(system var)
Executes the Unix command line in the argument string and return
the commands output.
(xsystem var)
(promax_path "partial_path")
(current_area)
(current_line)
(current_flow)
Other Docs
Known Problems
Description
(flow_directory)
(where_promax_is)
(where_promax_displays)
(unset_environment var)
Other Docs
Known Problems
choose:
choose:
:choose
:choose
We suggest that you use the last form; that is, to use the postfix
notation for process and parameter attributes and the prefix
notation for keyword values. The remainder of this document
uses this notation, although it is possible that this notation is not
used in early examples that you might have encountered. The
choice is arbitrary and completely up to the menu author.
Three KVPs are always first in the MDF: name, label, and
value_tab. The plot_label specification should appear with that
group as well. The exec_data and rules KVPs may appear
anywhere.
Keywords
Keyword
Value Type
Default
name:
symbol
NONE
label:
string
name:
attribute
value_tab:
integer
40
plot_label:
nil or t
NONE
rules:
list
NONE
exec_data:
list
NONE
Other Docs
Definition
Known Problems
Parameter Keywords
Each parameter keyword is followed by a name symbol and
defines a new parameter. These appear one below another on the
menu. Each parameter has a number of attributes associated
with it that are also set using KVPs. The KVPs immediately
following a parameter-KVP establish the initial settings for that
parameter and may appear in any order. However, if the same
keyword is repeated before the next parameter keyword is read,
the last occurrence takes precedence. The parameter and
attribute KVPs are as follows:
Parameter Keywords
Parameter
Keyword
Value Type
Default
Definition
parameter:
symbol
None
type:
keyword
None
Type of parameter.
type_desc:
list
nil
selected_item:
string or list
nil
value:
depends on type
nil
text:
string
parameter:
value_tab:
integer
menu
value_tab:
showp:
nil or t
Visibility predicate.
mouse_text:
string
nil
plot_label:
nil or t
nil
error_list
list
nil
warn_list
list
nil
Other Docs
Known Problems
Type-ins
The following table describes implicit Type-ins.
Implicit Type-in
Type
Description
type: :int
or type: :integer
or type: :fixnum
User allowed to type in any integer into 8 character field. No upper or lower
bounds applied.
type: :real
or type: :float
or type: :flonum
User allowed to type in any real into 10 character field. No upper or lower
bounds applied.
type: :string
Specified Type-in
In this example, the value typed in is placed in the value
attribute of the parameter, and selected_item is not used. One or
both of bounds may be omitted, which would allow the field
width to be set without any restriction on the value. To specify
an upper bound and no lower bound, set lower bound to nil.
type: :typein
type_desc: ( typein_type field_width typein_lower_bound\
typein_upper_bound )
where- typein_type is from the list of implicit\
typein types above
field_width is an integer number of characters\
to provide for entering values.
typein_lower_bound is the lowest numerical\
value allowed to be entered (ignored for\
:string type)
typein_upper_bound is the highest numerical\
value allowed to be entered (ignored for\
:string type)
Editor Type-in
In this example, the editor pops up when the visible field
(show_always_width) is clicked on. The editor and the help
windows are scroll-enabled, so neither needs to be as large as
the maximum expected entry. Again, the value typed-in is
Other Docs
Known Problems
Choose Type
In this example, if you want to have the list of choices appear
when no item is selected, you must set selected_item to the
keyword :none.
type: :choose
type_desc: ( item [item] [item] ... )
where- item = string
or item = ( string sexp mouse_help )
or item = :return
selected_item: an item from type_desc or :none
Items may be:
string - -String will appear on list of choices
-selected_item is the string to highlight\
and is set when the user clicks button\
1 on it
-value will be set to selected_item string
list - -String will appear on list of choices
-selected_item is set to entire list with\
user click
-value set to (eval sexp) mouse_text string
-will appear on mouse-help line when user\
is pointing at this specific choice
:return --repeatable keyword which will not appear\
on list of choices but instead causes\
choices that follow to be placed on a\
new line beneath previous choices
Other Docs
Known Problems
Defaults;
selected_item-defaults to (first type_desc). If\
specified it must be a 'member' of\
type_desc list or it will be set to (first\
type_desc).
value
-defaults to selected_item if selected_item\
is a string or to (eval (second\
selected_item)) if selected_item is a list.
Pop_Choose List
Pop_choose presents a single mouse sensitive item
(selected_item) to the user that, when clicked on, pops up the
entire list specified in type_desc.
type: :pop_choose
Circular List
Circular lists are just like pop_choose in that they present to the
user only the selected_item element of type_desc in a mouse
sensitive field. However, instead of popping up the entire list
when clicked on by the user, the selected_item circulates to the
next item in type_desc.
type: :circular
Boolean
Boolean type presents a list of two items to the user, Yes and
No. The value attribute is set to t if Yes is selected and to nil if
No is selected.
Other Docs
Known Problems
type: :boolean
selected_item:always one of the two lists ("Yes " t) or \
("No" nil)
defaults to ("Yes " t)
Boolean is a shorthand fortype: :choose
type_desc: ( ("Yes " t) ("No" nil) )
Multiple Choose
Multiple choose work like the choose type except that any
number of the options (including none) may be selected. The
value is this case is a list containing as members the
corresponding value that the ordinary choose would have
returned for a given selected item.
type: :multiple_choose
Action Lists
Action lists are a shorthand type exactly equivalent to choosetype with selected_item: set to :none. Both permit lists of
choices to appear without any item selected by default, so a rule
might be fired when it is detected that selected_item does not
equal :none.
Action list are normally used as a middle ground between a
regular choose parameter, supplying a predetermined selection
list and a value, and a :function type requiring special functions
or programs to initialize its entries. Action lists typically have
no default :type_desc and these items are dependent upon other
user parameter settings.
Function Type
The function type is a specialized type for access to three major
components of the ProMAX database.
type: :function
type_desc: function_call_list
where function_call_list is (dataset_list datasets)
Other Docs
Known Problems
or (header_list headers)
or ((parm_list string) parms)
where string is "MUT", "VEL", "GAT" or one of\
the other three letter strings for each type of\
parametric data allowed in the ProMAX database.
2.
3.
4.
Other Docs
Known Problems
Text Attribute
The text attribute specifies the parameter text to appear or the
menu.
text: string or text: :none
Showp Attribute
The showp attribute is a predicate that controls the visibility of
the parameter on the menu.
showp: Attribute
If set to nil, the parameter will still exist, but will not appear at
all on the menu. Being a predicate, if set to any other value
except nil, the parameter will appear (the default case). It is
possible to have parameters which never show, but this
predicate is usually manipulated by the rules which affect the
set of parameters that will be visible, based on other userspecified parameter values. This, along with the computational
power of rules, is how context sensitivity is achieved.
Other Docs
Known Problems
Plot_label Attribute
The plot_label attribute is a predicate that controls the visibility
of the parameter on the sidelabel history of hardopy plots.
plot_label: Attribute
If set to nil (the default case), the parameter will still exist, but
will not appear at all on the plot sidelabel history. Being a
predicate, if set to any other value except nil, the parameter will
appear. In addition to being an attribute, the plot_label:
predicate is used at the beginning of the menu as a keyword to
control whether any individual parameters appear on the plot
sidelabel. (If omitted, the first plot_label: attribute determines
this global menu setting.) In any event the name of the process
being run appears on the sidelabel history.
Other Docs
Known Problems
Other Docs
Known Problems
:implicit
:implicit
ERROR
:real
real
Returned value
:real
integer
:real
ERROR
:integer
integer
Returned value
:integer
real
:integer
ERROR
:string
string
:string
not a string
ERROR
(:string num)
string
(:string num)
not a string
(:int and :fixnum are synonyms for :integer, :float and :flonum
are synonyms for :real)
exec_data Example
The exec_data: KVP from the AGC menu is:
exec_data:("AGC"
("GENERAL"
("MODE_AMP" implicit: (value 'MODE_AMP))
("AGCLEN" implicit: (value 'AGCLEN))
("MODE_WIN" implicit: (value 'MODE_WIN))
("MODEZERO" implicit: (if(value 'mode_option)1\
0 ))
)
)
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Example
As an example, consider the following scenario. A menu is on
the screen and the change_list is nil (the empty list). This menu
has one parameter called framus, of type integer, and an initial
value of 2:
parameter: framus
type: :integer
value: 2
There is one rule, i.e:
rules: (
;start of rule list
( framus_rule;rule name start of rule
Other Docs
Known Problems
)
)
When the user types in a new value for integer framus, the value
attribute of framus is changed to that new value, and the
state_variable '(value framus) is pushed onto the end of the
change_list. The change_list is now:
( (value framus) )
Other Docs
Known Problems
)
)
Other Docs
Known Problems
Initialization Rules
In the event that the if-condition is t, the rule is unconditional
and termed an initialization rule. Such rules are run once and
only once immediately after menu parameter attributes are set
when the menu is first invoked. Initializations in included
menus are run after all initialization in the including menu have
been run, irrespective of where the :include parameters appear
on the displayed menu.
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
These four rules, each with the same simple action clause(s),
are much easier to comprehend than a single rule with an
if_clause as complicated as the earlier example. (There are, of
Other Docs
Known Problems
Other Docs
Known Problems
pwin276
pwin
pwin is a program that you can use to develop new menus. You
can execute pwin to see how the menu will appear on the
ProMAX screen; you do not have to put the menu into the
processes list and start ProMAX. Additionally, you can change
the menu file and immediately see the effect on the menu
behavior.
Before you execute pwin, make sure that your menu file is not
read-only and that the following environment variables, which
are also needed to run ProMAX, are set:
This will pop the menu up onto the screen along with an emacs
editor window in which you can make changes to the menu. To
see the behavior of the menu, place the mouse pointer in the
menu itself. To change the menu, click on the part of the screen
that contains the source code. After the change, move the mouse
pointer back into the menu to see the effect of the change.
You can also execute pwin by typing:
pwin menuName.menu -t
This will bring up the menu without the emacs part of the
window. Resize the window so that it does not occupy the entire
screen, and start your favorite editor in or from another window.
Other Docs
Known Problems
pwin277
You can then make changes to the file in the editor window, and
observe their effects in the menu window when you move the
mouse pointer into the pwin window. Remember to save the
new edits to the disk file or pwin will not see them, since pwin
reads the menu disk file each time you return to the menu
window.
Other Docs
Known Problems
parameter: LABEL
text: "Select trace data file"
type: function:
type_desc: (dataset_list datasets)
value: "no entry"
;selected_item: "* No Datasets Found *"
selected_item: "INVALID"
mouse_text: "Use Mouse Button 1 to select a dataset file\
description from the DATASETS menu."
parameter: KEYLIST
text: " SOURCE list to display"
type: edit:
type_desc: (25 80 5 " FORMAT: Shot1ShotN,ShotM,ShotI,etc/
EXAMPLES: 1,5,9,13,27,30-40,47/ 1-10/ 11-20(2)/ \
1-10000(50),1005/
HELP: EMACS Editor Widget (scroll with down/up arrow\
keys)
CURSOR MOVEMENT: Use the arrow keys:->,<-,etc.;Point\
the mouse cursor,click B1
Other Docs
Known Problems
Other Docs
Known Problems
)
)
("TR_DISPLAY"
("GENERAL"
("X_SERVER" implicit:
(if (= (value 'X_SERVER) "This Screen")
(where_promax_displays)
(value 'X_SERVER)))
("TSTART"
implicit: 0.0 )
("TEND"
implicit: 8000.0 )
("NTR_SCRN" implicit: 0 )
("NEN_SCRN" implicit: 1 )
("GAP"
implicit: 0 )
("SCROLL"
implicit: 0 )
("XMAGNIFY" implicit: 1.0 )
("YMAGNIFY" implicit: 1.0 )
("DISPMODE" implicit: 2 )
("VARBIAS" implicit: 0.0 )
("AUTOSAVE" implicit: 1 )
("NIMAGES" implicit: 2 )
("NBATCH"
implicit: 1 )
("DIRECT"
implicit: 1 )
("POLARITY" implicit: 1.0 )
("TIMELINE" implicit: 100 )
("TIMEBOLD" implicit: 1000 )
("TIMEANN" implicit: 500 )
("LKEYNAM1" implicit: "SOURCE " )
("LABLMOD1" implicit: 3 )
("LABLINC1" implicit: 5 )
("LKEYNAM2" implicit: "CHAN
" )
("LABLMOD2" implicit: 2 )
("LABLINC2" implicit: 5 )
("POSITION" implicit: 0 )
("CLIP"
implicit: 2.0 )
("MODSCALE" implicit: 1 )
("ASCALAR" implicit: 1.0 )
("SCALEOPT" implicit: 1 )
("LMFRDATA" implicit: 0 )
("SCRN_MIN" implicit: -10.0 )
("SCRN_MAX" implicit: 10.0 )
("INTERP"
implicit: 1 )
("SPLT_ENS" implicit: 1 )
)
)
)
rules: (
(test_host_name (NOT (= (value 'X_SERVER) "This
Screen"))
(progn
(setq temp (host_valid_p (value
'X_SERVER)))
(if temp
(add_error 'X_SERVER temp)
(set_error_list 'X_SERVER temp)))
(set_error_list 'X_SERVER nil)
)
)
)
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
283
Helpfiles
Other Docs
FrameMaker-formatted Helpfiles
Starting FrameMaker
Creating a New Helpfile
Editing a Helpfile
Working with FrameMaker Files
Helpfile Organization
Example Helpfile
Theory
Usage
References
Parameters
Interactive Display
Common Error Messages
Customizing the User Interface
Hypertext
Known Problems
FrameMaker-formatted Helpfiles284
FrameMaker-formatted Helpfiles
At Landmark, we use Adobe FrameMaker to generate and edit
most of our online and printed software documentation. This
chapter describes how to create and edit FrameMaker-formatted
helpfiles. The Documentation Department is also available to
help with formatting or style issues, such as word usage.
Starting FrameMaker
Follow these steps to start FrameMaker at Landmark:
1.
Login to Spitfire
2.
cd /usr/local/frame/bin
3.
4.
maker
2.
3.
Editing a Helpfile
Follow these steps to edit an existing helpfile:
1.
Other Docs
Known Problems
FrameMaker-formatted Helpfiles285
2.
Other Docs
Known Problems
FrameMaker-formatted Helpfiles286
Other Docs
recent (one day or so), then someone is now editing the file
old, then someone was editing the file, probably left it open
in FrameMaker, went to lunch, and Framemaker closed
abnormally, such as if the host rebooted or the X-terminal
crashed. Since the file was never exited properly, the lock
status file is still present, even though no one is currently
editing the file. To be safe, check with the person listed in
the warning message dialog box. If they are not using the
file, then click the Reset file lock checkbox and click
Continue to proceed. If you simply want to look at the
file, just click Continue on the message dialog. If you
then do try to save the file, the warning message will
appear again.
Known Problems
FrameMaker-formatted Helpfiles287
Autosave Files
Autosave files are automatically generated by FrameMaker
while you have a file open. The save interval can be specified in
the Preferences option under the File menu. The default has
autosave turned on and set to 5 minutes. Autosave versions of
files are reliable as long as autosave is turned on.
Other Docs
Known Problems
Helpfile Organization288
Helpfile Organization
The following pages describe the organization of a helpfile. We
have included examples to make writing your helpfile easier.
FrameMaker helps you organize your information with
paragraph and character formats. Paragraph formats have names
that correspond to the sections to which they are typically
applied. For example, the title of a helpfile uses the paragraph
format Helpfile Title. The list of predefined paragraph formats
should handle most of the documentation formatting issues that
you might experience when creating a ProMAX helpfile. Please
try to avoid customizing the formats. The actual body of the
documentsuch as the text that you are reading nowuses the
text or body paragraph format. You can modify the text with
character formats, but use these modifications sparingly and
only as needed for clarity.
Other Docs
Known Problems
Example Helpfile289
Example Helpfile
This section provides the purpose and a short description of a
process. Begin the first sentence with the exact process name
and bold it. The following paragraph provides an example:
Differential Autostatics measures time shifts between
unstacked traces in common receiver and shot gathers.
Theory
The theory section is an explanation of how a process
accomplishes its purpose. Write this with your audience in
mind. Your audience has a good knowledge of geophysics and
seismic processing; therefore, you do not need to define P-wave
or S-wave, nor do you need to include a discussion of
Zoeppritzs equations. Consider the 90% rule: mention what
90% of our clients will want to know. The following two
examples illustrate two different but concise theory discussions:
Theory Example 1
The spectral shaping algorithm has two modes of application.
The first scales all frequency components of the data to a
specified contour, while maintaining the original phase
relationships. The second multiplies all frequency components
by the specified contour also without changing the phase. The
contour is defined by a series of frequency-amplitude pairs. The
amplitudes may be given as a percentage of the maximum
amplitude, or as a dB value relative to 1.0.
Theory Example 2
Spectral analysis of the results of IRLS L1 decon show
spectral whitening within the bandwidth of the original data.
The IRLS system is
A
A X = A
W Y where:
A X = Y and where:
A = Convolution Matrix, (rows columns)
Other Docs
Known Problems
Example Helpfile290
= transpose of A
Usage
The Usage section discusses how to use the process and
includes a description of the input/output headers. For instance,
what kind of data does the process operate upon? What must be
done first in order to use the process? What typically comes
after the use of the process? In this section, you fit the process
into the big picture of using ProMAX. The following paragraph
illustrates one way to write the Usage section:
Header Output: Tau-P creates new header entries called
SLOWNESS, TAUMIN, and TAUPIN. SLOWNESS is the P
value for the trace, TAUMIN is the Tau value of sample one of
the trace, and TAUPIN contains information used by the inverse
transform. Required input trace headers are CDP and OFFSET
for prestack data and CDP, CDP_X and CDP_Y for stacked
data.
References
If you use the 90% rule discussed in the preceeding theory
section, you can use the References section to supply our clients
Other Docs
Known Problems
Example Helpfile291
Books
Authors last name, initials, year. Book title (capitalize only
proper nouns). City of publication, publisher, xxx p.
Refer to the SEG Instructions to Authors for more information
on references.
Parameters
Write the parameter exactly as it appears in the process.
The parameter explanation should be as clear and concise as
possible. Our clients should know what input is expected for
any given parameter within the first two sentences. It is also
helpful if you include the default or expected input range for all
parameters. For clarity, we are using the following styles:
Other Docs
Known Problems
Example Helpfile292
Interactive Display
Several ProMAX processes are interactive. The optional
Interactive Display section comes after the Parameters section
and describes how the interactive display operates. For a good
example, see Trace Display.
Other Docs
Known Problems
Example Helpfile293
Other Docs
Known Problems
Hypertext294
Hypertext
Hypertext links documents in the online help system. Hypertext
is a word or group of words that, when clicked upon, will cause
a jump to a different part of the current document or to an
entirely different document. The hypertext character format
(which appears as red italics) helps the reader identify
hyperactive text. However, in addition to marking the text with
the hypertext character format, you will also have to embed the
actual hypertext jump commands in your document.
Not every helpfile will have or should have hypertext in it. It can
be a very valuable aid to the reader, but most simple helpfiles do
not need it. Please notify the Documentation Department if your
helpfile needs hypertext links.
Other Docs
Known Problems
295
Code Standards
C Coding Standards
FORTRAN Coding Standards
Portable Code
Other Docs
Known Problems
C Coding Standards296
C Coding Standards
At Landmark, we use Recommended C Style and Coding
Standards by Cannon et. al. as a general coding guideline and
make the following additions:
Other Docs
1.
2.
3.
4.
5.
6.
Known Problems
C Coding Standards297
8.
9.
Other Docs
Known Problems
C Coding Standards298
and not
float
cvtibm(float ibm_int)
Place the documentation as a comment block immediately after the function declaration. Begin the comment
lines with /********** (a forward slash followed by at least
10 asterisks) and end the block of lines with **********/
(at least 10 asterisks followed by a forward slash.) Internal sections of the documentation should be separated
by a row of (at least 5) asterisks.
Begin the documentation comments with one or more
lines describing the purpose of the routine.
Follow the purpose section with a description of the
arguments and return value. Do not describe more than
one argument per line. Divide this section into up to
three groups separated by blank lines, entitled "Input:",
"Output:" and "Returned:". If an argument is both an
input and an output, list it in both sections.
After the argument section, place any further sections
you may want, for example Notes, References, and
Author sections.
The following code shows an example of recommended C
documentation style.
float cvtibm(long ibm_in)
/*******************************************************
Convert IBM hexadecimal floating point numbers
********************************************************
Input:
in_ibm IBM floating point number to be converted
Returned:native floating point equivalent
********************************************************
Notes:
Converts to IEEE standard format and uses the xdr library
to convert from there.
********************************************************
Author:Anonymous, Jan. 24, 2000
*******************************************************/
{ /* begin function body ... */
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Good example:
DO 110 J=1,10
DO 100 I=1,10
X(I,J) = 0.0
100
CONTINUE
110 CONTINUE
Other Docs
Known Problems
', 1, XLOCATION )
C preprocessor
All ProMAX FORTRAN code is run through the C
preprocessor before it reaches the FORTRAN compiler. The
primary benefits are the use of the #ifdef and #include
statements. The syntax of an include statement is:
IMPLICIT NONE
#include "foo.inc"
#include "header.inc"
Other Docs
Known Problems
rather than:
IMPLICIT NONE
INCLUDE 'foo.inc'
INCLUDE '/usr/ProMAX/sys/misc/header.inc'
Note that the use of full path names for include files is
disallowed (use the -I directive in the compiler).
Be aware that the C preprocessor knows nothing about Fortran
source code format and will happily generate lines longer than
72 characters. Judicious use of continuation lines are suggested.
For example:
#define VLONG 'a very very long string to substitute...'
CHARACTER*(*) TITLE
PARAMETER(TITLE=
&VLONG
&)
Comments
Comments should be used to adequately explain the structure
and intent of the code. Poorly commented code is difficult for
the author to maintain and impossible for someone else to
maintain. If you spend much time explaining yourself during
code walk-throughs, your comments are inadequate. No one
ever errors on the side of too many comments.
Comments should begin with C ..... for readability. The first
letter of the comment should always line up with the code that
follows. Put comments inside the part of an IF structure that
applies to the comments.
Each subroutine should have a reasonable description that
explains it basic purpose.
Other Docs
Known Problems
White Space
Do not be afraid to use white space. Blank lines can be used to
further clarify the structure, and spaces between the elements of
a statement make it easier to read. A statement like:
IF ( GL .LT. 0.0 .AND. GE .GE. GMAX ) THEN
just like:
Source code statements should read like sentences
is easier to read than:
Amassofcharacterswithoutblanksisdifficulttoread
Avoid too many blank lines; however, it is nice to be able to see
a reasonable number of lines of source code on the screen at the
same time.
Code Structure
Do not use multiple IF conditional tests on the same variable in
the same block of code if an ELSE or ELSEIF will do the same
task.
Bad example:
IF ( NSAMPS .EQ. 1 ) X = Y
IF ( NSAMPS .EQ. 1 ) J0 = 0
Even worse:
IF ( NSAMPS .EQ. 1 ) X = Y
IF ( NSAMPS .EQ. 2 ) X = Y2
IF ( NSAMPS .EQ. 1 ) J0 = 0
Good example:
IF ( NSAMPS .EQ. 1 ) THEN
X = Y
J0 = 0
ELSEIF ( NSAMPS .EQ. 2 ) THEN
Other Docs
Known Problems
X = Y2
ENDIF
Miscellaneous
The source code for a particular processing tool should be kept
in a unique directory and include the associated include file.
Keep FORMAT statements close to the code where they are
being used, or preferably imbed them in the code like this:
READ (*,(A8,3I8)) CWORK, I, J, K
and this code will crash if CDP is not defined in the header:
ICDP = ITHDR(ICDPz)
X(ICDP) = 0.0
Purify
14. Use Purify on your code as standard procedure before you
check it in to the production libraries.
Known Problems
Other Docs
Known Problems
Portable Code307
Portable Code
Since ProMAX products are offered on multiple hardware
platforms, it is important to make your code a portable as
possible. Portable code minimizes compiler and runtime errors
with new compiler releases, new hardware platforms, and new
operating systems. Here are some rules that have been derived
from experience.
Other Docs
1.
2.
3.
4.
5.
Known Problems
Portable Code308
Other Docs
Known Problems
309
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
313
Other Docs
Known Problems
Other Docs
bin/
promax
prospector
promaxvsp
promax3d
emacs
gmake
...
exe/
exec.exe
super_exec.exe
autostat.exe
dbmath.exe
...
showfile
...
lib/
libmaxexec.a
libmaxtool1.a
libmaxtool2.a
Known Problems
Other Docs
libmaxtool3.a
libmaxtool4.a
libmaxutil.a
libmaxui.a
libagfc.a
libXaw.a
libXhp.a
libsupport.a
...
...
obj/
bin/
promax/
...
exe/
exec/
golden.a
libxcgm.a
...
c_exec.o
Known Problems
exec.o
toolcall.o
...
autostat/
...
lib/
maxtool/
cgmplot/
.cgmplot.o
.c_cgmplot.o
.cgmplot_combined.o
rf/
.cfstack.o
....
...
...
nodist/
lib/
sdi/
...
libxcgm.a
.
decmips/ (sys/ -> decmips/ on DEC MIPS Rx000
machines)
.
Other Docs
...
Known Problems
Other Docs
...
port/
bin/
Makeexec
...
misc/
header.inc
color_tbl_b
...
fontimage0
fontimage1
...
menu/
promax/
Processes
agc.menu
...
prospector/
...
...
Processes
Known Problems
Other Docs
agc.menu
...
...
promaxvsp/
Processes
agc.menu
...
promax3d/
Processes
agc.menu
...
help/
promax/
agc.help
...
prospector/
agc.help
...
promaxvsp/
agc.help
...
promax3d/
agc.help
Known Problems
Other Docs
...
man/
man1/
gmake.1
...
...
include/
SCCS/
header.inc
cglobal.h
cpromax.h
cwp.h
...
private/
interface/
make/
advance.make
maxexec.make
maxprog.make
rs6000.make
...
...
...
Known Problems
Other Docs
X11/
Xaw/
SCCS/
Box.h
...
...
geoquest/
portable.h
portable.par
...
cgm.h
portable.h
...
src/
bin/
promax/
emacs/
gmake/
...
...
...
...
Known Problems
Other Docs
...
exe/
exec/
Makefile
SCCS/
c_exec.c
exec.f
toolcall.f or toolcall.c
...
autostat/
Makefile
...
...
lib/
maxtool/
Makefile
agc/
.SCCS/
.agc.f
...
maxexec/
Makefile
SCCS/
Known Problems
Other Docs
table.f
ex.c
err.c
par.c
...
maxutil/
Makefile
c_promax/
.SCCS/
.hdr.c
....
table/
.SCCS/
.table.f
....
...
maxui/
Makefile
...
cwp/
Makefile
...
X11/
Known Problems
Other Docs
Xaw/
.Makefile
.SCCS/
.Box.c
....
...
...
...
nodist/
include/
sdi/
cgm.h
portable.h
etc/
config_file
...
data/
scratch/
...
...
Known Problems
Other Docs
Known Problems
325
cglobal.h
cpromax.h
Example simple processes
simple.menu
simple.c
ampRatio.c
Other Docs
Known Problems
Other Docs
Known Problems
cglobal.h327
cglobal.h
Other Docs
Known Problems
cglobal.h328
} GlobalMisc;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalMisc GLOBAL_MISCCZ;
GlobalMisc *globalMisc = &GLOBAL_MISCCZ;
#elif defined (CONVEX)
GlobalMisc _global_misccz_;
GlobalMisc *globalMisc = &_global_misccz_;
#else
GlobalMisc global_misccz_;
GlobalMisc *globalMisc = &global_misccz_;
#endif /* CRAY */
#else
#if defined (CRAY)
extern GlobalMisc GLOBAL_MISCCZ, *globalMisc;
#elif defined (CONVEX)
extern GlobalMisc _global_misccz_, *globalMisc;
#else
extern GlobalMisc global_misccz_, *globalMisc;
#endif /* CRAY */
#endif /* DEFINE_CGLOBALS */
/* choices for globalMisc->iunits - type of units */
#define IENGLISH 1
#define IMETRIC 3
/* shorthand for easier typing and reading of code */
#define IUNITSz(globalMisc->iunits)
/* runtime globals */
typedef struct globalRuntimeStruct {
float samprat;
/* time sampling interval in milliseconds */
int numsmp;
/* number of samples per trace */
int ipsort;
/* physical primary sort flag (see choices below) */
int maxdtr;
/* maximum number of data traces per ensemble */
int idtyp;
/* primary data type (see choices below) */
int nth;
/* number of 4-byte words in trace header */
int mode;
/* processing executive mode (see choices below) */
int iounit;
/* Fortran I/O unit for output diagnostics */
int ipkey;
/* trace header index of primary sort key */
int iskey;
/* trace header index of secondary sort key */
int idate;
/* current date (seconds since 00:00:00 GMT, 1/1/70 */
int idomain;
/* domain type (see choices below) */
logical cleanup;
/* true if system is in cleanup mode */
logical ierror; /* true if system in error mode (trying to cleanup) */
logical igeom_match; /* true if header geometry matches database */
logical itrno_valid; /* true if trace number can index database */
logical init_only;
/* true if initialization phase only */
int ipad[15];
/* padding to 32 words */
} GlobalRuntime;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalRuntime GLOBAL_RUNTIMECZ;
Other Docs
Known Problems
cglobal.h329
Other Docs
Known Problems
cglobal.h330
#define IDEPTH 7
/* depth-space domain */
/* geometry globals */
typedef struct globalGeomStruct {
int minsloc;
/* minimum surface location number */
int maxsloc;
/* maximum surface location number */
int incsloc;
/* surface location number increment (always 1) */
int nrcvrs;
/* total number of live groups */
int maxtpr;
/* maximum traces per receiver ensemble */
int mincdp;
/* minimum cdp number */
int maxcdp;
/* maximum cdp number */
int inccdp;
/* cdp number increment (always 1) */
int numcdp;
/* total number of cdps */
int ntrcdp;
/* maximum cdp fold */
int minsin;
/* minimum source index number */
int maxsin;
/* maximum source index number */
int incsin;
/* source index number increment (always 1) */
int nsins;
/* total number of SINs (records of all types) */
int maxcps;
/* maximum channels per source */
int nshots;
/* total number of live sources */
int minofb;
/* minimum offset bin number */
int maxofb;
/* maximum offset bin number */
int incofb;
/* offset bin number increment (always 1) */
int nofbins;
/* number of offset bins */
float offbinc; /* offset increment between bins */
float offmax; /* longest offset of line */
int minchn;
/* minimum channel number */
int maxchn;
/* maximum channel number */
int incchn;
/* increment between channel numbers (always 1) */
int nslocs;
/* total number of surface locations of all types */
float x3dorig; /* x coordinate of origin of 3D grid (rel. to xref) */
float y3dorig; /* y coordinate of origin of 3D grid (rel. to yref) */
int nilines;
/* number of inlines */
int minilin;
/* minimum inline number */
int maxilin;
/* maximum inline number */
float xilnend; /* x coordinate of far end of first inline */
float yilnend; /* y coordinate of far end of first inline */
float dcdpiln; /* distance between CDPs in the inline direction for
* 3D; mean distance between CDPs for 2D */
int nxlines;
/* number of crosslines */
int minxlin;
/* minimum crossline number */
int maxxlin;
/* maximum crossline number */
float xxlnend; /* x coordinate of far end of first crossline */
float yxlnend; /* y coordinate of far end of first crossline */
float dcdpxln; /* distance between CDPs in the crossline direction */
int ipad[24]; /* padding to 64 words */
} GlobalGeom;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalGeom GLOBAL_GEOMCZ;
GlobalGeom *globalGeom = &GLOBAL_GEOMCZ;
#elif defined (CONVEX)
GlobalGeom _global_geomcz_;
GlobalGeom *globalGeom = &_global_geomcz_;
#else
GlobalGeom global_geomcz_;
GlobalGeom *globalGeom = &global_geomcz_;
Other Docs
Known Problems
cglobal.h331
#endif /* CRAY */
#else
#if defined (CRAY)
extern GlobalGeom GLOBAL_GEOMCZ, *globalGeom;
#elif defined (CONVEX)
extern GlobalGeom _global_geomcz_, *globalGeom;
#else
extern GlobalGeom global_geomcz_, *globalGeom;
#endif /* CRAY */
#endif /* DEFINE_CGLOBALS */
/*
*/
/* coordinates globals */
typedef struct globalCoordStruct {
float azimx1;
/* azimuth towards increasing SURFLOC number */
float sloc1x;
/* X coordinate of first surface location */
float sloc1y;
/* Y coordinate of first surface location */
int ipad[5];
/* pad to 8 words */
} GlobalCoord;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalCoord GLOBAL_COORDCZ;
GlobalCoord *globalCoord = &GLOBAL_COORDCZ;
#elif defined (CONVEX)
GlobalCoord _global_coordcz_;
GlobalCoord *globalCoord = &_global_coordcz_;
#else
GlobalCoord global_coordcz_;
GlobalCoord *globalCoord = &global_coordcz_;
#endif /* CRAY */
#else
#if defined (CRAY)
extern GlobalCoord GLOBAL_COORDCZ, *globalCoord;
#elif defined (CONVEX)
extern GlobalCoord _global_coordcz_, *globalCoord;
#else
extern GlobalCoord global_coordcz_, *globalCoord;
#endif /* CRAY */
#endif
typedef struct globalXYStruct {
double xref;
/* X reference point for the line */
double yref;
/* Y reference point for the line */
int ipad[4];
/* pad to 8 words */
} GlobalXY;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalXY GLOBAL_XYCZ;
GlobalXY *globalXY = &GLOBAL_XYCZ;
Other Docs
Known Problems
cglobal.h332
Other Docs
Known Problems
cglobal.h333
Other Docs
Known Problems
cglobal.h334
Other Docs
Known Problems
cglobal.h335
#define
NPARMS(p) (2+sizeof(*p)/sizeof(float));
/* last-trace-in-ensemble flag */
#define LASTTR 1
#define NLAST 0
/* trace type */
#define IAUX 0
#define ILIVE 1
#define IDEAD 2
#define IDUMMY 3
#define ITBREAK 4
#define IUPHOLE 5
#define ISWEEP 6
#define ITIMING 7
#define IWBREAK 8
#define IOTHER 9
#define IWLOG 10
/* tool
#define
#define
#define
#define
#define
#define
#define
#define
#define
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
types */
ISIMPLE 1
IENSEMBLE 2
ICOMPLEX 3
IFLOW 4
INPUT 6
IROLLGATE 7
IPANEL 8
ISNL_BUFF 9
IDBL_BUFF 10
/*
/*
/*
/*
/*
/*
/*
/*
/*
*/
*/
*/
*/
#endif /* CGLOBAL_H */
/* SCCS: @(#)cglobal.h
Other Docs
50.17
11/18/93 */
Known Problems
cpromax.h336
cpromax.h
/*
/*
<math.h>
<limits.h>
<stdlib.h>
<stdio.h>
<string.h>
#ifdef DEC
#defineusleep(x)sleep((x)/1000000)
#endif
#ifdef SGI
#defineusleep(x)sleep((x)/1000000)
#endif
#ifdef CONVEX
#defineusleep(x)sleep((x)/1000000)
Other Docs
Known Problems
cpromax.h337
#endif
/*********************************************/
/* C defines and functions useful for ProMAX */
/*********************************************/
/**-**
char * listDesc( void *l)
Macro that returns the description of a list
****/
/* parameter list */
typedef struct DatabaseStruct {
int ikey;
int lock;
char domain[4];
int last_err;
int loc_min;
int loc_max;
int loc_inc;
int nstored;
int softrlse;
int igdate;
int igtime;
int ngtrace;
} Database;
typedef struct dbDomainProjectStruct {
int itoken;
char domain1[9];
char domain2[9];
} DomainProject;
typedef struct dbEnsembleMapStruct {
int itoken;
char domain1[9];
char domain2[9];
char domain3[9];
} EnsembleMap;
typedef struct dbTraceMapStruct {
int itoken;
char domain1[9];
char domain2[9];
char domain3[9];
} TraceMap;
typedef struct dbBufGetStruct {
int itoken;
Database *db;
char cinfo[9];
char cname[9];
int length;
int format;
void *buffer;
} BufGet;
Other Docs
Known Problems
cpromax.h338
Other Docs
Known Problems
cpromax.h339
/* error functions */
void exErrFatal (char *format, ...);
void exErrMessage (char *format, ...);
void exErrWarn (char *format, ...);
int exErrHelp (char *format, ...);
void uErrFatal (char *format, ...);
void uErrMessage (char *format, ...);
void uErrWarn (char *format, ...);
int uErrHelp (char *format, ...);
/* parameter table
void *tblAllocate(
void *tblAllocTmp(
void tblFree( void
Other Docs
functions */
int nz, char *xdesc, char *ydesc, char *zdesc, char *desc );
int nz );
*tbl );
Known Problems
cpromax.h340
Other Docs
Known Problems
cpromax.h341
Other Docs
Known Problems
cpromax.h342
Other Docs
Known Problems
cpromax.h343
void int_mix_vec_( int *id_num, int *ix_xtrap, int *iy_xtrap, float *x,
float *yStart, float *yInc, int *npts, float *zVec, int *noInterp,
float *mixWidth, float *dxMix);
int tblMixInterpXYu( void *tbl,
float x, float ymin, float dy, int numy,
float *z, float mixWidth, float dxMix);
void convert_v_table_( int *t_in_id, char *in_type, int *t_out_id,
char *out_type, float *in_step, float *out_step);
/* Miscellaneous routines */
double roundUpInc(double inc);
double roundDownInc(double inc);
/* packet file manipulation routines */
int pktFileClose(void *ptr);
void * pktFileOpen(char *name);
void * pktFileCreate(char *name);
int pktInit(void *ptr, char *name);
int pktGroupInit(void *ptr, char *gname);
int pktOutParmN(void *ptr, char *name, int format, int nwrdpval, int nvalues,
void *buf);
int pktOutInt(void *ptr, char *name, int val);
Other Docs
Known Problems
cpromax.h344
Other Docs
Known Problems
Other Docs
Known Problems
simple.menu346
simple.menu
'(
name: SIMPLE
label: "A Simple C Module"
value_tab: 48
parameter: ZMULT
text: "Input a positive multiplier"
type: typein:
type_desc: ( real: 6 0.0 nil )
value: 1.0
mouse_text: "Input a positive valued multiplier."
exec_data: ("SIMPLE"
("GENERAL"
("ZMULT
)
)
)
Other Docs
Known Problems
simple.c347
simple.c
/* this is a really simple example of a C promax module */
/* include ProMAX prototypes and globals */
#include "cpromax.h
#include "cglobal.h
/* define the saved parameters (user input, etc) */
BEGINPARMS
int sampsPerTrace;
float zmult;
ENDPARMS (parms);
/* declare the functions used internally */
void multTrc( float* trace, float zmult, int sampsPerTrace );
/*-------------------------------------------------------------------*/
/* init_simple_()
/*
/* initialization routine for ProMAX module simple
/*
/*
/*-------------------------------------------------------------------*/
void init_simple_( int *len_sav, int *itooltype )
{
/* declare a local version of an external parameter */
float zmult;
/* set a pointer to the globalRuntime structure */
GlobalRuntime *gr = globalRuntime;
/* get the number of samples per trace, set the external parm too */
parms->sampsPerTrace = gr->numsmp;
/* get the multiplier for the trace from the menu */
exPerGetFloat("ZMULT, &zmult);
if( zmult < 0.0 ){
exErrFatal("The multiplier cannot be less than 0.0.);
}
/* now set the external parameter */
parms->zmult = zmult;
/* set the number of words that need to be saved for re-entrancy */
*len_sav = NPARMS(parms);
/* set the tool type to simple, (one trace in one trace out). */
/* ISIMPLE is defined in cglobal.h */
*itooltype = ISIMPLE;
}
/*-------------------------------------------------------------------*/
/* exec_simple_()
Other Docs
Known Problems
simple.c348
/*
/* execution routine for ProMAX module simple
/*
/*
/*-------------------------------------------------------------------*/
void exec_simple_( float* trace, float* rthdr, int* ithdr )
{
/* set a pointer to the globalRuntime structure */
GlobalRuntime *gr = globalRuntime;
/* see if we are in cleanup phase */
if( gr->cleanup ){
return;
}
/* process the trace */
multTrc( trace, parms->zmult, parms->sampsPerTrace );
}
/*-------------------------------------------------------------------*/
/*
/* multTrc()
/* multiplies trace samples by a scalar
/*
/* input arguments:
/*
zmult - float the multiplier
/*
sampsPerTrace int number of samples per trace
/* output argument:
/*
float *trace the data trace to be scaled
/*
/*-------------------------------------------------------------------*/
void multTrc( float *trace, float zmult, int sampsPerTrace )
{
int i;
for( i = 0; i < sampsPerTrace; i++ ){
trace[i] *= zmult;
}
}
Other Docs
Known Problems
ampRatio.c349
ampRatio.c
/* include ProMAX prototypes and globals */
#include "cpromax.h
#include "cglobal.h
/* define saved parameters */
BEGINPARMS
int
ngate, ih_ratio_max, ih_ratio_time, load_hdr, load_db,
id_max, id_time, itraceno, use_gate,
itabl_handle, ih_pkey, ih_skey, iformat_pkey, iformat_skey;
float
*scratch;
void
*gate_tbl;
void *db_trc, *dbPtr1,*dbPtr2;
ENDPARMS(parms)
int n_trc;
void
amp_ratio_work (float *trace, float *scratch, int nsams, int ngate,
int imin_samp, int imax_samp, float samprate, float
*ratio_max, float *ratio_time);
/***
C------------------------------------------------------------------C
C
C
Description:
C
Standard initialization routine
C
C
output arguments:
C
LEN_SAVE - number of 4-byte words to save for re-entrancy
C
ITOOLTYPE - processing tool type
C
C--------------------------------------------------------------------***/
void
init_amp_ratio_(int *len_sav, int *itooltype)
{
extern int n_trc;
float
gatelen;
char
*cgatename ;
n_trc = 0;
/* get the gate length */
gatelen=-1.0;
exParGetFloat ("GATELEN,
&gatelen);
Other Docs
Known Problems
ampRatio.c350
*/
*/
*/
if (hdrExists ("RATIOMAX) ) {
if (hdrFormat ("RATIOMAX) == HDRFLOAT)
exErrWarn ("RATIOMAX header already exists!);
else
exErrFatal ("RATIOMAX header already exists but is of wrong
type!);
} else {
parms->ih_ratio_max = hdrAdd ("RATIOMAX, "Time of amp ratio
maximum, 1, HDRFLOAT);
if (parms->ih_ratio_max== 0) {
/* This should virtually never happen. */
exErrFatal("Error adding header RATIOMAX);
}
}
if (hdrExists ("RATIOTIM) ) {
if (hdrFormat ("RATIOTIM) == HDRFLOAT)
exErrWarn ("RATIOTIM header already exists!);
else
exErrFatal ("RATIOTIM header already exists but is of wrong
type!);
} else {
Other Docs
Known Problems
ampRatio.c351
*/
Other Docs
*/
Known Problems
ampRatio.c352
parms->dbPtr1= opfInitBufPut(parms->db_trc,F_B_PICK,RATIOMAX);
parms->dbPtr2= opfInitBufPut(parms->db_trc,F_B_PICK,RATIOTIM);
}
/* Reserve a scratch buffer that we will need in exec phase */
parms->scratch = (float *) malloc (globalRuntime->numsmp * sizeof (float) );
/* Set the number of words that need to be saved for re-entrancy.
*/
{
database.);
{
database.);
}
/* We don't want control to pass into the main body
Other Docs
*/
Known Problems
ampRatio.c353
return;
}
if (parms->use_gate){
/* Interpolate the gate times from the table*/
if (tblInterpXY (parms->gate_tbl, rthdr [parms->ih_pkey],
rthdr[parms->ih_skey], tgate)) {
exErrFatal ("Error interpolating time gate);
}
}
else {
/* use entire trace */
tgate[0]=0.0;
tgate[1]= (globalRuntime->numsmp-1)*globalRuntime->samprat;
}
/* Convert the time gate values to samples */
imin_samp = tgate[0] / globalRuntime->samprat +
imax_samp = tgate[1] / globalRuntime->samprat +
imin_samp = MAX (imin_samp, 0);
imin_samp = MIN (imin_samp, globalRuntime->numsmp
imax_samp = MAX (imax_samp, 0);
imax_samp = MIN (imax_samp, globalRuntime->numsmp
if (imin_samp > imax_samp) {
int
isave;
/* assume that they were menat to be reversed
isave= imin_samp;
imin_samp= imax_samp;
imax_samp=isave;
}
0.5;
0.5;
- 1);
- 1);
*/
/* Pass the buffers off to a routine where the real work is done */
amp_ratio_work (trace, parms->scratch, globalRuntime->numsmp,
parms->ngate, imin_samp, imax_samp, globalRuntime->samprat,
&ratio_max,&ratio_time);
if (parms->load_hdr == 1) {
/* Load the values into the header */
rthdr [parms->ih_ratio_max] = ratio_max;
rthdr [parms->ih_ratio_time] = ratio_time;
}
if (parms->load_db) {
/* Load the values into the database
*/
}
/**
C--------------------------------------------------------------------C
C Actual work routine
C
Other Docs
Known Problems
ampRatio.c354
C--------------------------------------------------------------------**/
void
amp_ratio_work (float *trace, float *scratch, int nsamps, int ngate,
int imin_samp, int imax_samp, float samprate, float
*ratio_max, float *ratio_time)
{
int
i, istart, iend, ind_max;
float
sum_above, sum_below, rabove, rbelow;
/* Set the starting and end of the zone of interest
istart = 0 - ngate;
iend = nsamps + ngate;
/* Sum the first two gates
sum_above = 0.0;
rabove = 0.0;
*/
*/
sum_below = 0.0;
rbelow = 0.0;
for (i = istart + ngate; i< istart + ngate * 2; i ++)
if (i >=0 && i< nsamps && trace[i]!=0.0) {
sum_below = sum_below + fabs (trace[i]);
rbelow = rbelow + 1.0;
}
for (i = istart + ngate; i< iend - ngate ; i ++) {
/* Compute the ratio */
if (sum_above > 0.0 && rabove >0.0 && rbelow >0.0) {
scratch [i] = (sum_below/ rbelow) / (sum_above / rabove);
}
else if (trace[i] != 0.0) {
scratch [i] = 0.0;
}
/* Drop a sample from each gate and add the next one */
if (i - ngate >= 0) {
sum_above = sum_above - fabs (trace [i - ngate]) + fabs (trace [i]);
}
else {
sum_above = sum_above + fabs (trace[i]);
rabove = rabove + 1.0;
}
if (i + ngate +1< nsamps) {
sum_below = sum_below - fabs (trace[i + 1])
+ fabs (trace [i + ngate + 1]);
}
else {
if (i +1 < nsamps && trace[i+1]!=0.0) {
sum_below = sum_below - fabs (trace[i + 1]);
rbelow = rbelow - 1.0;
}
}
Other Docs
Known Problems
ampRatio.c355
}
/* Put the final results in place. Note that we have not handled the
edge problem, we have simply made the function undefined */
for (i = 0; i < nsamps; i++) {
trace [i] = scratch[i];
}
/* Find the maximum of the ratio function */
*ratio_max = trace [imin_samp ];
ind_max = imin_samp;
for (i = imin_samp ; i< imax_samp; i++) {
if (trace [i] > *ratio_max) {
ind_max = i;
*ratio_max = trace [i];
}
}
/* Covert the index of the maximum to time*/
*ratio_time = (float) (ind_max ) * samprate;
}
Other Docs
Known Problems
ampRatio.c356
Other Docs
Known Problems
357
Other Docs
amp_ratio.menu
amp_ratio.inc
amp_ratio.f
ampRatio.c
Known Problems
amp_ratio.menu358
amp_ratio.menu
'(
name: AMP_RATIO
label: "Amplitude Ratio"
value_tab: 35
parameter: GATELEN
text: "Amplitude gate length"
type: typein:
type_desc: ( real: 7 1.0e-5 nil )
value: 100.0
mouse_text: "Enter the sliding gate length used to compute amplitude ratios."
parameter: time_gate_opt
text: "Confine the maximum?"
type: boolean:
value: nil
mouse_text: "Select 'Yes' if you wish to use a gate to constrain the search for
the maximum in the amp ratio."
parameter: GATENAME
text: " Select gate parameter file"
type: function:
type_desc: ((parm_list "GAT") parms)
value: "INVALID"
selected_item: "** No Parameter File Selected **"
mouse_text: "Use Mouse Button 1 to select a gate parameter file from the
parameter file menu."
parameter: LOAD_HDR
text: "Load the results into the header?
type: boolean:
value: t
mouse_text: "Select 'Yes' if you wish to load the maximum of the amp ratio and
its time into the trace header."
parameter: LOAD_DB
text: "Load the results into the database?
type: boolean:
value: t
mouse_text: "Select 'Yes' if you wish to load the maximum of the amp ratio and
its time into the database."
exec_data: ("AMP_RATIO"
("GENERAL"
("GATELEN"
implicit: (value 'GATELEN))
("GATENAME" implicit: ( if (value 'time_gate_opt)
(value 'GATENAME) "NO__GATE" ))
("LOAD_HDR" implicit: ( if (value 'LOAD_HDR) 1 0 ) )
("LOAD_DB"
implicit: ( if (value 'LOAD_DB) 1 0 ) )
)
)
rules: (
(rule1 ( value 'time_gate_opt
)
) (do_show 'GATENAME)
(do_not_show 'GATENAME))
Other Docs
Known Problems
amp_ratio.inc359
amp_ratio.inc
C-----------------------------------------------------------------------------C Include file for AMP_RATIO
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
&
&
&
&
&
&
C
C
C
C
.....
.....
.....
.....
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
Other Docs
Known Problems
amp_ratio.f360
amp_ratio.f
C-----------------------------------------------------------------------------C
C
Description:
C
Standard initialization routine
C
C
Output arguments:
C
LEN_SAVE - number of 4-byte words to save for re-entrancy
C
ITOOLTYPE - processing tool type
C
C-----------------------------------------------------------------------------SUBROUTINE INIT_AMP_RATIO( LEN_SAV, ITOOLTYPE )
C ..... The include file 'amp_ratio.inc' contains a nested include
C
for the global parameters
#include "amp_ratio.inc"
C ..... Include file with error definitions
#include "hdr_err.inc"
#include "db_err.inc"
INTEGER LEN_SAV, ITOOLTYPE, IERR, LENGTH, IFORMAT, NCHARS,
&
IDUMMY(3), NTIMES
REAL GATELEN, RDUMMY(6)
CHARACTER CDESC_HDR*32, CDESC_DB*80, CGATENAME*8, CPRIM_KEY*8,
&
CSCND_KEY*8, CTABLE_DESC*128, CZ_DESC*8
C ..... Set a default that is illegal (in case there is a menu problem)
GATELEN = -1.0
C ..... Call for the input parameter by name. Note the padding in the
C ..... character constant. It is the programmers responsibility to
C ..... provide the correct type of return argument.
CALL EX_GETPARM( 'GATELEN ', 1, GATELEN )
C ..... Convert the gate length to samples
NGATE = NINT( GATELEN / SAMPRATz )
C ..... Check for reasonable input
IF ( NGATE .LT. 1 .OR. NGATE*2+1 .GT. NUMSMPz ) THEN
CALL EX_ERR_FATAL( 'Gate length is illegal' )
ENDIF
C ..... See if the user wants to confine the maximum to fall within a gate
USE_GATE = .FALSE.
CGATENAME = '
'
CALL EX_CGETPARM( 'GATENAME', 1, CGATENAME, NCHARS )
IF ( CGATENAME .NE. '
'
&
.AND. CGATENAME .NE. 'NO__GATE' ) THEN
C ......... Something was specified
USE_GATE = .TRUE.
C ......... Get the gate from the database
CALL DB_TBL_GET( 'GAT', CGATENAME, ITBL_HANDLE, IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_PROMAX_ERR( IERR )
CALL EX_ERR_FATAL(
Other Docs
Known Problems
amp_ratio.f361
&
&
&
&
C ..... See if the user wants to load the results into the trace header
LOAD_HDR = 0
CALL EX_GETPARM( 'LOAD_HDR', 1, LOAD_HDR )
IF ( LOAD_HDR .EQ. 1 ) THEN
C ......... Add new trace header entries
CDESC_HDR = 'Maximum value of amp ratio'
CALL HDR_ADD( 'RATIOMAX', CDESC_HDR, 1, IREAL4pz,
&
IH_RATIO_MAX, IERR )
IF ( IERR .NE. 0 ) THEN
IF ( IERR .EQ. IERR_HDR_EXSTpz ) THEN
C ................. That's OK, but somewhat unexpected
CALL EX_ERR_WARN(
&
'RATIOMAX already exists in header' )
ELSE
C ................. This will virtually never happen, but just in case
CALL EX_ERR_FATAL( 'Error adding header entry' )
ENDIF
ENDIF
CDESC_HDR = 'Time of amp ratio maximum'
CALL HDR_ADD( 'RATIOTIM', CDESC_HDR, 1, IREAL4pz,
&
IH_RATIO_TIME, IERR )
IF ( IERR .NE. 0 ) THEN
IF ( IERR .EQ. IERR_HDR_EXSTpz ) THEN
C ................. That's OK, but somewhat unexpected
CALL EX_ERR_WARN(
&
'RATIOTIM already exists in header' )
ELSE
C ................. This will virtually never happen, but just in case
Other Docs
Known Problems
amp_ratio.f362
&
&
Other Docs
Known Problems
amp_ratio.f363
C ..... Note that LENSAVED declared within the include file, hopefully
C ..... to avoid oversights
LEN_SAV = LENSAVED
C ..... Set the tool type to simple (one trace in, one trace out)
ITOOLTYPE = ISIMPLEpz
RETURN
END
C-----------------------------------------------------------------------------C
C
Description:
C
Standard execution routine
C
C
Input/output arguments:
C
TRACE - array of trace samples
C
ITHDR - trace header (as integer)
C
RTHDR - trace header (as floating point)
C
C-----------------------------------------------------------------------------SUBROUTINE EXEC_AMP_RATIO( TRACE, ITHDR, RTHDR )
#include "amp_ratio.inc"
C ..... Include the file that allows use of the "space array" and memory
C ..... management routines.
#include "mem.inc"
INTEGER ITHDR(NTHz), LOC_TRC, IERR, ISAVE, IMIN_SAMP, IMAX_SAMP
REAL TRACE(NUMSMPz), RTHDR(NTHz), RATIO_MAX, RATIO_TIME,
&
PKEYVAL, SKEYVAL, TGATE(2)
C
C
C
IF ( CLEANUPz ) THEN
IF ( LOAD_DB .EQ. 1 ) THEN
............. Flush the buffers for buffered database I/O
............. Note that errors only give rise to warnings in cleanup phase.
............. Also note that the "location" is now 0.
CALL DB_BUFFRDPUT( ID_MAX, IKEY_TRC, 'F_B_PICK',
&
'RATIOMAX', 0, 0.0, .TRUE., IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_PROMAX_ERR( IERR )
CALL EX_ERR_WARN(
&
'Error loading data into database' )
ENDIF
CALL DB_BUFFRDPUT( ID_TIME, IKEY_TRC, 'F_B_PICK',
&
'RATIOTIM', 0, 0.0, .TRUE., IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_PROMAX_ERR( IERR )
CALL EX_ERR_WARN(
&
'Error loading data into database' )
ENDIF
ENDIF
......... We don't want control to pass into the main body
RETURN
ENDIF
IF ( USE_GATE ) THEN
C ......... Interpolate the gate times from the table
Other Docs
Known Problems
amp_ratio.f364
&
&
ELSE
C ......... Use the entire trace
TGATE(1) = 0.0
TGATE(2) = FLOAT(NUMSMPz-1) * SAMPRATz
ENDIF
C ..... Convert the time gate values to samples
IMIN_SAMP = NINT( TGATE(1) / SAMPRATz ) + 1
IMAX_SAMP = NINT( TGATE(2) / SAMPRATz ) + 1
C ..... Don't let them go out of bounds
IMIN_SAMP = MAX0( IMIN_SAMP, 1 )
IMIN_SAMP = MIN0( IMIN_SAMP, NUMSMPz )
IMAX_SAMP = MAX0( IMAX_SAMP, 1 )
IMAX_SAMP = MIN0( IMAX_SAMP, NUMSMPz )
IF ( IMIN_SAMP .GT. IMAX_SAMP ) THEN
C ......... Let's assume that they were meant to be reversed
ISAVE = IMIN_SAMP
IMIN_SAMP = IMAX_SAMP
IMAX_SAMP = ISAVE
ENDIF
C ..... Pass
CALL
&
&
&
&
&
&
Other Docs
Known Problems
amp_ratio.f365
ENDIF
ENDIF
ENDIF
RETURN
END
C-----------------------------------------------------------------------------C
C
Actual work routine
C
C------------------------------------------------------------------------------
&
&
&
110
SUM_BELOW = 0.0
RBELOW = 0.0
DO 110 I=ISTART+NGATE+1,ISTART+NGATE*2
IF ( I .GE. 1 .AND. I .LE. NSAMPS ) THEN
SUM_BELOW = SUM_BELOW + ABS( TRACE(I) )
RBELOW = RBELOW + 1.0
ENDIF
CONTINUE
Other Docs
Known Problems
amp_ratio.f366
&
120
C ..... Put the final results in place. Note that we have not handled the
C ..... edge problem, we have simply made the function undefined.
DO 130 I=1,NSAMPS
IF ( I .LE. ISTART+NGATE-1 ) THEN
TRACE(I) = 0.0
ELSEIF ( I .GE. IEND-NGATE+1 ) THEN
TRACE(I) = 0.0
ELSE
TRACE(I) = SCRATCH(I)
ENDIF
130
CONTINUE
C ..... Find the maximum of the ratio function
RATIO_MAX = TRACE(IMIN_SAMP)
IND_MAX = IMIN_SAMP
DO 140 I=IMIN_SAMP,IMAX_SAMP
IF ( TRACE(I) .GT. RATIO_MAX ) THEN
IND_MAX = I
RATIO_MAX = TRACE(I)
ENDIF
140
CONTINUE
C ..... Convert the index of the maximum to time
RATIO_TIME = FLOAT( IND_MAX - 1 ) * SAMPRATE
RETURN
END
Other Docs
Known Problems
ampRatio.c367
ampRatio.c
void
amp_ratio_work (float *trace, float *scratch, int nsams, int ngate,
int imin_samp, int imax_samp, float samprate, float
*ratio_max, float *ratio_time);
/***------------------------------------------------------------------Description:
Standard initialization routine
output arguments:
LEN_SAVE - number of 4-byte words to save for re-entrancy
ITOOLTYPE - processing tool type
---------------------------------------------------------------------***/
void
init_amp_ratio_(int *len_sav, int *itooltype)
{
extern int n_trc;
float
gatelen;
char
*cgatename ;
n_trc = 0;
/* get the gate length */
gatelen=-1.0;
exParGetFloat ("GATELEN",
&gatelen);
Other Docs
Known Problems
ampRatio.c368
*/
*/
*/
if (hdrExists ("RATIOMAX") ) {
if (hdrFormat ("RATIOMAX") == HDRFLOAT)
exErrWarn ("RATIOMAX header already exists!");
else
exErrFatal ("RATIOMAX header already exists but is of wrong
type!");
} else {
parms->ih_ratio_max = hdrAdd ("RATIOMAX", "Time of amp ratio
maximum", 1, HDRFLOAT);
if (parms->ih_ratio_max== 0) {
/* This should virtually never happen. */
exErrFatal("Error adding header RATIOMAX");
}
}
if (hdrExists ("RATIOTIM") ) {
if (hdrFormat ("RATIOTIM") == HDRFLOAT)
exErrWarn ("RATIOTIM header already exists!");
else
exErrFatal ("RATIOTIM header already exists but is of wrong
type!");
} else {
Other Docs
Known Problems
ampRatio.c369
*/
Other Docs
*/
Known Problems
ampRatio.c370
parms->dbPtr1= opfInitBufPut(parms->db_trc,"F_B_PICK","RATIOMAX");
parms->dbPtr2= opfInitBufPut(parms->db_trc,"F_B_PICK","RATIOTIM");
}
/* Reserve a scratch buffer that we will need in exec phase */
parms->scratch = (float *) malloc (globalRuntime->numsmp * sizeof (float) );
/* Set the number of words that need to be saved for re-entrancy.
*/
{
database.");
{
database.");
}
/* We don't want control to pass into the main body
return;
*/
}
if (parms->use_gate){
/* Interpolate the gate times from the table*/
if( hdrIndexFormat(parms->ih_pkey) == HDRINT ){
fltPkey = (float)ithdr[parms->ih_pkey];
Other Docs
Known Problems
ampRatio.c371
}
else{
fltPkey = rthdr[parms->ih_pkey];
}
if( hdrIndexFormat(parms->ih_skey) == HDRINT ){
fltSkey = (float)ithdr[parms->ih_skey];
}
else{
fltSkey = rthdr[parms->ih_skey];
}
if (tblInterpXY (parms->gate_tbl, fltPkey, fltSkey, tgate )){
exErrFatal ("Error interpolating time gate");
}
}
else {
/* use entire trace */
tgate[0]=0.0;
tgate[1]= (globalRuntime->numsmp-1)*globalRuntime->samprat;
}
/* Convert the time gate values to samples */
imin_samp = tgate[0] / globalRuntime->samprat +
imax_samp = tgate[1] / globalRuntime->samprat +
imin_samp = MAX (imin_samp, 0);
imin_samp = MIN (imin_samp, globalRuntime->numsmp
imax_samp = MAX (imax_samp, 0);
imax_samp = MIN (imax_samp, globalRuntime->numsmp
if (imin_samp > imax_samp) {
int
isave;
/* assume that they were meant to be reversed
isave= imin_samp;
imin_samp= imax_samp;
imax_samp=isave;
}
0.5;
0.5;
- 1);
- 1);
*/
/* Pass the buffers off to a routine where the real work is done */
amp_ratio_work(trace, parms->scratch, globalRuntime->numsmp,
parms->ngate, imin_samp, imax_samp, globalRuntime->samprat,
&ratio_max,&ratio_time);
if (parms->load_hdr == 1) {
/* Load the values into the header */
rthdr [parms->ih_ratio_max] = ratio_max;
rthdr [parms->ih_ratio_time] = ratio_time;
}
if (parms->load_db) {
/* Load the values into the database
*/
Other Docs
Known Problems
ampRatio.c372
}
/*--------------------------------------------------------------------Actual work routine
----------------------------------------------------------------------*/
void
amp_ratio_work (float *trace, float *scratch, int nsamps, int ngate,
int imin_samp, int imax_samp, float samprate, float
*ratio_max, float *ratio_time)
{
int
i, istart, iend, ind_max;
float
sum_above, sum_below, rabove, rbelow;
/* Set the starting and end of the zone of interest
istart = 0 - ngate;
iend = nsamps + ngate;
/* Sum the first two gates
sum_above = 0.0;
rabove = 0.0;
*/
*/
sum_below = 0.0;
rbelow = 0.0;
for (i = istart + ngate; i< istart + ngate * 2; i ++)
if (i >=0 && i< nsamps && trace[i]!=0.0) {
sum_below = sum_below + fabs (trace[i]);
rbelow = rbelow + 1.0;
}
for (i = istart + ngate; i< iend - ngate ; i ++) {
/* Compute the ratio */
if (sum_above > 0.0 && rabove >0.0 && rbelow >0.0) {
scratch [i] = (sum_below/ rbelow) / (sum_above / rabove);
}
else if (trace[i] != 0.0) {
scratch [i] = 0.0;
}
/* Drop a sample from each gate and add the next one */
if (i - ngate >= 0) {
sum_above = sum_above - fabs (trace [i - ngate]) + fabs (trace [i]);
}
else {
sum_above = sum_above + fabs (trace[i]);
rabove = rabove + 1.0;
}
if (i + ngate +1< nsamps) {
sum_below = sum_below - fabs (trace[i + 1])
+ fabs (trace [i + ngate + 1]);
}
else {
if (i +1 < nsamps && trace[i+1]!=0.0) {
sum_below = sum_below - fabs (trace[i + 1]);
Other Docs
Known Problems
ampRatio.c373
}
/* Put the final results in place. Note that we have not handled the
edge problem, we have simply made the function undefined */
for (i = 0; i < nsamps; i++) {
trace [i] = scratch[i];
}
/* Find the maximum of the ratio function */
*ratio_max = trace [imin_samp ];
ind_max = imin_samp;
for (i = imin_samp ; i< imax_samp; i++) {
if (trace [i] > *ratio_max) {
ind_max = i;
*ratio_max = trace [i];
}
}
/* Covert the index of the maximum to time*/
*ratio_time = (float) (ind_max ) * samprate;
Other Docs
Known Problems
ampRatio.c374
Other Docs
Known Problems
375
avo.menu
avo.inc
avo.f
avoC.c
Trace Interpolation Tools
prestk_interp.menu
prestk_interp.inc
prestk_interp.f
prestk_interp.c
Other Docs
Known Problems
Fortran Note:
This example shows things that are often done in ensemble
tools. The important points to remember from the INIT_
subroutine are that MAXDTRz (the maximum number of traces
in an ensemble that will be leaving the EXEC_ subroutine) is
set to 1, the type of data is set to ISTACKEDpz, and the trace
number is no longer valid after this process, so
ITRNO_VALIDz is set to 0. The important points in the
EXEC_ subroutine are that the trace header values (particularly
the end-of-ensemble flag) are set, and the trace executive is
notified that the number of traces to be returned from
EXEC_ AVO_DEMO is 1. This is accomplished through setting
the calling argument NSTORED to 1.
C Note:
This example shows things that are often done in ensemble
tools. The important points to remember from the init_
subroutine are that globalRuntime->maxdtr (the maximum
number of traces in an ensemble that will be leaving the exec_
subroutine) is set to 1, the type of data is set to ISTACKED, and
the trace number is no longer valid after this process, so
ITRNO_VALID is set to 0. The important points in the exec_
subroutine are that the trace header values (particularly the
end-of-ensemble flag) are set, and the trace executive is notified
that the number of traces to be returned from exec_avo_demo_
is 1. This is accomplished through setting the calling argument
*nStored to 1.
Other Docs
Known Problems
avo.menu377
avo.menu
'(
name: AVO_DEMO
label: "AVO Demo"
value_tab: 35
parameter: AVO_OPT
text: "Type of AVO output"
type: circular:
type_desc: (
("Slope"
1 "Output AVO slope." )
("Intercept" 2 "Output AVO intercept." )
)
value: 1
mouse_text: "Use MB1 to rotate between choices for type of AVO output."
exec_data: ("AVO_DEMO"
("GENERAL"
("AVO_OPT"
implicit: (value 'AVO_OPT))
)
)
)
Other Docs
Known Problems
avo.inc378
avo.inc
C-----------------------------------------------------------------------------C
Include file for AVO_DEMO
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
&
&
C
C
C
C
.....
.....
.....
.....
C
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
.....
Other Docs
Known Problems
avo.f379
avo.f
C-----------------------------------------------------------------------------C
C
Description:
C
Standard initialization routine
C
C
Output arguments:
C
LEN_SAVE - number of 4-byte words to save for re-entrancy
C
ITOOLTYPE - processing tool type
C
C-----------------------------------------------------------------------------SUBROUTINE INIT_AVO_DEMO( LEN_SAV, ITOOLTYPE )
C ..... The include file "avo.inc" contains an include for the global
C ..... parameters ("global.inc")
#include "avo.inc"
INTEGER LEN_SAV, ITOOLTYPE, IERR, LENGTH, IFORMAT, ISLOPEPZ,
&
INTERCEPTPZ
CHARACTER CDESC*32
PARAMETER ( ISLOPEPZ=1, INTERCEPTPZ=2 )
C ..... Issue a fatal error if the data is already stacked
IF ( IDTYPz .EQ. ISTACKEDpz ) CALL EX_ERR_FATAL(
&
'This process cannot operate on stacked data' )
C ..... Call for the input parameters by name. Allow user to output
C ..... slope or intercept.
IOPT = 0
CALL EX_GETPARM( 'AVO_OPT ', 1, IOPT )
IF ( IOPT .NE. ISLOPEPZ .AND. IOPT .NE. INTERCEPTPZ ) THEN
CALL EX_ERR_FATAL( 'AVO_OPT not recognized' )
ENDIF
C ..... Get buffers to store the values before linear regression
CALL MEM_RESBUFF( MAXDTRz, IX_X, IERR )
CALL MEM_RESBUFF( MAXDTRz, IX_Y, IERR )
CALL MEM_RESBUFF( MAXDTRz, IX_WT, IERR )
C ..... Get the indices of the headers that we need
CALL HDR_NAMINFO( 'OFFSET ', CDESC, LENGTH,
&
IH_OFFSET, IERR )
IF ( IERR .NE. 0 ) CALL EX_ERR_FATAL(
&
'OFFSET not found in header' )
CALL HDR_NAMINFO( 'END_ENS ', CDESC, LENGTH,
&
IH_END_ENS, IERR )
IF ( IERR .NE. 0 ) CALL EX_ERR_FATAL(
&
'END_ENS not found in header' )
CALL HDR_NAMINFO( 'TRACENO ', CDESC, LENGTH,
&
IH_TRACENO, IERR )
IF ( IERR .NE. 0 ) CALL EX_ERR_FATAL(
&
'TRACENO not found in header' )
CALL HDR_NAMINFO( 'TR_FOLD ', CDESC, LENGTH,
&
IH_TR_FOLD, IERR )
IF ( IERR .NE. 0 ) CALL EX_ERR_FATAL(
Other Docs
IFORMAT,
IFORMAT,
IFORMAT,
IFORMAT,
Known Problems
avo.f380
&
C ..... The trace number is no longer valid, since we are now stacked
ITRNO_VALIDz = 0
C ..... Set the general data type to stacked (not really stacked, but
C ..... more similar to stacked than other types)
IDTYPz = ISTACKEDpz
C ..... Reset the maximum number of data traces per ensemble, for
C ..... subsequent tools.
MAXDTRz = 1
C ..... Set the number of words that need to be saved for re-entrancy
LEN_SAV = LENSAVED
C ..... Set the tool type to ensemble
ITOOLTYPE = IENSEMBLEpz
RETURN
END
C-----------------------------------------------------------------------------C
C
Description:
C
Standard execution routine
C
C
Input/output arguments:
C
TRACES - 2-d array of trace samples
C
ITHDRS - 2-d array of trace header (as integer)
C
RTHDRS - 2-d array of trace header (as floating point)
C
NSTORED - number of stored traces
C
C-----------------------------------------------------------------------------SUBROUTINE EXEC_AVO_DEMO( TRACES, ITHDRS, RTHDRS, NSTORED )
C ..... The include file "avo.inc" contains an include for the global
C ..... parameters ("global.inc")
#include "avo.inc"
C ..... Include the file that allows use of the "space array"
#include "mem.inc"
INTEGER NSTORED, ITHDRS(NTHz,NSTORED), INDEX, IERR
REAL TRACES(NUMSMPz,NSTORED), RTHDRS(NTHz,NSTORED)
C ..... No action required in cleanup phase
IF ( CLEANUPz ) RETURN
C ..... Call
CALL
&
&
Other Docs
Known Problems
avo.f381
C-----------------------------------------------------------------------------C
C
Actual work routine
C
C------------------------------------------------------------------------------
&
&
&
Other Docs
Known Problems
avo.f382
TRACE(I) = RINTER
ENDIF
120
CONTINUE
RETURN
END
C-----------------------------------------------------------------------------C
SUBROUTINE WT_LIN_REG( X_IN, Y_IN, WT, NPTS, A, B )
C-----------------------------------------------------------------------------C
C
Description:
C
C
Weighted linear regression routine. Least squares analysis
C
is performed to solve y = Ax + B. Does not handle infinite
C
slope.
C
C
Input arguments:
C
X_IN - array of X values
C
Y_IN - array of Y values
C
WT
- array of weights
C
C
Output arguments:
C
A
- slope
C
B
- intercept
C
C-----------------------------------------------------------------------------SUBROUTINE WT_LIN_REG( X_IN, Y_IN, WT, NPTS, A, B )
IMPLICIT NONE
INTEGER I, NPTS
REAL X_IN(NPTS), Y_IN(NPTS), WT(NPTS)
REAL X, SWX, SWY, SW, SWXY, SWX2, B, A
C ..... Initialize:
SWX = 0.0
SWY = 0.0
SW
= 0.0
SWXY = 0.0
SWX2 = 0.0
C ..... Compute the constants for a weighted linear regression
DO 100 I=1, NPTS
X = WT(I) * X_IN(I)
SWX = SWX + X
SWY = SWY + WT(I) * Y_IN(I)
SW
= SW
+ WT(I)
SWXY = SWXY + X * Y_IN(I)
SWX2 = SWX2 + X * X_IN(I)
100
CONTINUE
C ..... Compute the slope and intercept
A = (SW * SWXY - SWY * SWX) / (SW * SWX2 - SWX * SWX)
B = (SWY - A * SWX) / SW
RETURN
END
Other Docs
Known Problems
avoC.c383
avoC.c
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
/* define the saved
BEGINPARMS
int outputOpt ;
float *xVals ;
float *yVals ;
float *weights;
ENDPARMS (parms)
of external parameters */
;
;
;
;
/* local variables */
int iErr;
/* connect with global variables */
GlobalRuntime *gr = globalRuntime;
/* issue a fatal error if data is already stacked */
if( gr->idtyp == ISTACKED ){
exErrFatal("This process does not operate on stacked data.");
}
/* see if the user wants to output slope or intercept */
outputOpt = 0;
exParGetInt( "AVO_OPT", &outputOpt );
Other Docs
Known Problems
avoC.c384
saved parameters */
= outputOpt;
= xVals
;
= yVals
;
= weights ;
}
/*-------------------------------------------------------------------*/
/* exec_avo_exer
/*
/* execution routine for ProMAX module avo_exe
/*
/* input and output args:
/* traces - the data traces in continuous memory
/* rthdrs - floating point trace headers
Other Docs
Known Problems
avoC.c385
/* local
int
float
float
float
versions of
outputOpt =
*xVals
=
*yVals
=
*weights =
external parameters */
parms->outputOpt;
parms->xVals
;
parms->yVals
;
parms->weights ;
/* local variables */
int iErr;
/* connect with global variables */
GlobalRuntime *gr = globalRuntime;
/* see if we are in cleanup phase */
if( gr->cleanup ){
free( xVals );
free( yVals );
free( weights );
return;
}
/* call the actual work routine */
avoDemoWork( traces, rthdrs, *nStored );
/* the header being output is the first one in the array. */
/* the output trace is the last one in the ensemble */
ithdrs[hdrIndex("END_ENS")] = LASTTR;
/* assign the fold */
rthdrs[hdrIndex("TR_FOLD")] = (float)(*nStored);
/* make the trace number NULL */
ithdrs[hdrIndex("TRACENO")] = INULL;
/* set the number of output traces to be picked up by the */
/* trace executive and sent to subsequent modules */
*nStored = 1;
}
/*-------------------------------------------------------------------*/
/* acutual work routine
/* input/output
/*
traces - the input traces in continuous memory
/* input:
/*
rthdrs - floating point header array, in continuous memory
/*
nStored - number of traces in the ensemble
/*-------------------------------------------------------------------*/
Other Docs
Known Problems
avoC.c386
Other Docs
Known Problems
avoC.c387
}
/*-------------------------------------------------------------------*/
/* weighted linear regression routine. A least squares analysis is
/* performed to solve y=ax+ b. Does not handle infinite slope.
/*
/* input:
/*
x_in - array of input x values
/*
y_in - arrry of input y values
/*
wt
- array of input weights
/*
npts - number of points in regression
/*
/* output:
/*
a - slope
/*
b - intercept
/*
/*-------------------------------------------------------------------*/
void avoDemoWtLinReg( float *x_in, float *y_in, float *wt, int npts,
float *a, float *b )
{
/* variables */
int i;
float x, swx, swy, sw, swxy, swx2;
/* initialize */
swx = 0.0;
swy = 0.0;
sw
= 0.0;
swxy = 0.0;
swx2 = 0.0;
/* compute the constants for a linear regression */
for( i= 0; i< npts; i++ ){
x = wt[i] * x_in[i];
swx += x;
swy += wt[i]*y_in[i];
sw
+= wt[i];
swxy += x*y_in[i];
swx2 += x*x_in[i];
}
/* compute the slope and intercept */
*a = ( (sw*swxy)-(swy*swx))/( (sw*swx2)-(swx*swx));
*b = (swy - (*a * swx) )/sw;
}
Other Docs
Known Problems
Other Docs
Known Problems
prestk_interp.menu389
prestk_interp.menu
'(
name: PRESTK_INTERP
label: "Prestack Interpolation"
value_tab: 35
exec_data: ("PRESTK_INTERP"
("GENERAL"
("dummy"
implicit: 1)
)
)
)
Other Docs
Known Problems
prestk_interp.inc390
prestk_interp.inc
C-----------------------------------------------------------------------------C
Include file for PRESTK_INTERP
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
COMMON /SAVED_PARMS/ SAVE1z
INTEGER LENSAVED
DATA LENSAVED /1/
Other Docs
Known Problems
prestk_interp.f391
prestk_interp.f
C
C
C
C
.....
.....
.....
.....
#include "prestk_interp.inc"
INTEGER LEN_SAV, ITOOLTYPE
&
C ..... The trace number is no longer valid, since we are adding new traces
C ..... that have no corresponding slots in the database.
ITRNO_VALIDz = 0
C ..... Reset the maximum number of data traces per ensemble
MAXDTRz = MAXDTRz*2 - 1
C ..... Set the number of words for re-entrancy and the tool type
LEN_SAV = LENSAVED
ITOOLTYPE = IENSEMBLEpz
RETURN
END
Other Docs
Known Problems
prestk_interp.f392
120
130
ITHDRS(I,J*2-2) = ITHDRS(I,J-1)
CONTINUE
CONTINUE
Other Docs
Known Problems
prestk_interp.c393
prestk_interp.c
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
/* define saved parameters */
BEGINPARMS
int dummy; /* doesn't actually have to be here */
ENDPARMS(parms)
void init_prestk_interp_(int *len_sav, int *itooltype);
void exec_prestk_interp_(float *trace, int *ithdr,
float *rthdr, int* nStored);
/*------------------------------------------------------------------Description:
Initialization routine for prestack interp
output arguments:
len_save - number of 4-byte words to save for re-entrancy
itooltype - processing tool type
---------------------------------------------------------------------*/
void init_prestk_interp_(int *len_sav, int *itooltype)
{
/* get access to global runtime variables */
GlobalRuntime *gr = globalRuntime;
/* The trace number is no longer valid, since we are adding new traces */
/* that have no corresponding slots in the database.*/
gr->itrno_valid = FALSE;
/* Reset the maximum number of data traces per ensemble */
gr->maxdtr = 2*gr->maxdtr - 1;
*/
/*********************************************************************
*
*
Description:
*
Execution routine for prestack interp
Other Docs
Known Problems
prestk_interp.c394
*
*
Input/output arguments:
*
traces - array of trace samples
*
ithdrs - trace header (as integer)
*
rthdrs - trace header (as floating [point)
/*
nStored - number of traces input and output
*
**********************************************************************/
/* Put all
/* that is
trcs =
rhdrs =
Other Docs
Known Problems
prestk_interp.c395
free( trcs );
free( rhdrs );
Other Docs
Known Problems
prestk_interp.c396
Other Docs
Known Problems
397
Other Docs
panel_test.menu
panel_test.inc
panel_test.f
panelTest.c
Known Problems
panel_test.menu398
panel_test.menu
'(
name: PANEL_TEST
label: "Panel Test"
value_tab: 42
parameter: PANLSIZE
text: "Panel size"
type: typein:
type_desc: ( int: 7 nil nil )
value: 21
mouse_text "Enter the number of traces per panel."
parameter: PANLEDGE
text: "Panel edge"
type: typein:
type_desc: ( int: 7 nil nil )
value: 5
mouse_text "Enter the size of the panel edge."
parameter: PANL_MIX
text: "Panel mix"
type: typein:
type_desc: ( int: 7 nil nil )
value: 0
mouse_text "Enter the size of the panel mix."
parameter: PANL_TPD
text: "Panel trace pad"
type: typein:
type_desc: ( int: 7 nil nil )
value: 0
mouse_text "Enter the size of the panel trace pad."
parameter: PANL_SPD
text: "Panel sample pad"
type: typein:
type_desc: ( int: 7 nil nil )
value: 0
mouse_text "Enter the size of the panel sample pad."
exec_data: ("PANEL_TEST"
("GENERAL"
("version" implicit: "%Z%%M%
("PANLSIZE" implicit: (value
("PANLEDGE" implicit: (value
("PANL_MIX" implicit: (value
("PANL_TPD" implicit: (value
("PANL_SPD" implicit: (value
)
)
)
Other Docs
%I% %G%" )
'PANLSIZE))
'PANLEDGE))
'PANL_MIX))
'PANL_TPD))
'PANL_SPD))
Known Problems
panel_test.inc399
panel_test.inc
C-----------------------------------------------------------------------------C
Include file for PANEL_TEST
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
COMMON /SAVED_PARMS/ SAVE1z, RVAL, NPAD_SAMPS, NPAD_TRACES
INTEGER LENSAVED, NPAD_SAMPS, NPAD_TRACES
REAL RVAL
C ..... Specify the number of variables to save
DATA LENSAVED /4/
C ..... SCCS:
Other Docs
@(#)panel_test.inc
50.1
3/10/94
Known Problems
panel_test.f400
panel_test.f
NPANEL_SIZE )
NPANEL_EDGE )
NPANEL_MIX )
send through .inc file
NPAD_TRACES )
NPAD_SAMPS )
C ..... Set the panel parameters (and allow them to be returned with a
C ..... different value).
CALL EX_PANEL_PARMS( NPANEL_SIZE, NPANEL_EDGE, NPANEL_MIX,
&
NPAD_TRACES, NPAD_SAMPS )
RVAL = 1.0
LEN_SAV = LENSAVED
ITOOLTYPE = IPANELpz
RETURN
END
100
110
DO 110 J=1,NSTORED
DO 100 I=1,NUMSMPz+NPAD_SAMPS
TRACES(I,J) = RVAL
CONTINUE
CONTINUE
Other Docs
Known Problems
panel_test.f401
130
CONTINUE
RETURN
END
Other Docs
Known Problems
panelTest.c402
panelTest.c
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
/* define the saved parameters (user input, etc) */
BEGINPARMS
int nPadTraces; /* number of padding traces */
int nPadSamples; /* number of padding samples */
float sampValue;
/* value of trace samples */
ENDPARMS (parms)
/*-------------------------------------------------------------------*/
/* init_panel_test
/*
/* initialization routine for ProMAX module sine_wave
/*
/*-------------------------------------------------------------------*/
void init_panel_test_( int *len_sav, int *itooltype )
{
/* local variables */
int panelSize;
int panelEdge;
int panelMix;
/* local versions of external parms */
int nPadTraces;
int nPadSamples;
/* get the panel parameters
exParGetInt( "PANLSIZE",
exParGetInt( "PANLEDGE",
exParGetInt( "PANL_MIX",
*/
&panelSize );
&panelEdge );
&panelMix );
Other Docs
Known Problems
panelTest.c403
Other Docs
Known Problems
panelTest.c404
Other Docs
Known Problems
405
Other Docs
ens_define.menu
ens_define.inc
ens_define.f
interp_sb.menu
interp_sb.c
Known Problems
ens_define.menu406
ens_define.menu
'(
name: ENS_DEFINE
label: "Ensemble Re-define"
value_tab: 51
parameter: PRIM_KEY
text: "Select PRIMARY key to re-define output ensembles"
type: function:
type_desc: (header_list headers)
value: "NONE
"
selected_item: "**INVALID**"
mouse_text: "Use MB1 to select a header word from the headers menu as the PRIMARY
key for re-defining input ensembles."
parameter: MAXTR
text: "Maximum traces per output ensemble"
type: typein:
type_desc: ( int: 5 1 nil )
value: 0
mouse_text: "What is the maximum number of traces per output ensemble AFTER redefining the ensembes?"
exec_data: ("ENS_DEFINE"
("GENERAL"
("version" implicit: "@(#)ens_define.menu
("PRIM_KEY" implicit: (value 'PRIM_KEY))
("MAXTR"
implicit: (value 'MAXTR))
)
)
40.1
11/24/92" )
Other Docs
Known Problems
ens_define.inc407
ens_define.inc
C-----------------------------------------------------------------------------C
Include file for ENS_DEFINE.
C
C
Original code by S. Rutt Bridges, April 30, 1991.
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
&
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
Other Docs
Known Problems
ens_define.f408
ens_define.f
C-----------------------------------------------------------------------------C
C
Initialization routine for ENS_DEFINE
C
C
ENS_DEFINE is an ensemble definition tool. It resets ensemble flags
C
based on a change in a header word. Output ensembles may be larger
C
or smaller, depending on the changes in the header word. Examples of
C
the use of this tool:
C
C
1. In the Ensemble Decon Parameter Test macro, we input data that
C
has a primary sort key of 'REPEAT' and a secondary sort key of
C
'CDP'. For the subsequent CDP stack, we need to have ensembles
C
defined by CDP. ENS_DEFINE provides this function.
C
C
2. Typically for Radon Filtering, we need to use Ensemble Split to
C
seperate the positive and negative offsets. However, for a
C
subsequent CDP stack these traces need to form a single ensemble.
C
ENS_DEFINE provides this function.
C
C
3. To create a single ensemble from a CDP stack, you should use the
C
special option of setting the primary header key word to NONE
C
which will force the entire dataset to be combined into a single
C
ensemble.
C
C
Output parameters:
C
LEN_SAV - the number of parameters that must be saved
C
ITOOLTYPE
- the tool type
C
C
Original code by S. Rutt Bridges, April 30, 1991.
C-----------------------------------------------------------------------------SUBROUTINE INIT_ENS_DEFINE( LEN_SAV, ITOOLTYPE )
#include "ens_define.inc"
#include "runtime.inc"
CHARACTER CDESC*32, CPRIM_KEY*8
INTEGER LEN_SAV, ITOOLTYPE, IERR, LENGTH, IFORMAT, NCHARS
INTEGER MAXDTR, IOPTION
CHARACTER CSCCS_KEY*50
DATA CSCCS_KEY /'@(#)ens_define.f 31.5 6/18/92'/
C ..... issue a stern warning if the tool is within an IF conditional
IF (IF_DEPTHrz.NE.0) CALL EX_ERR_HELP( 'Warning: Ensemble '
&
// 'Re-define should not be used within IF''s !'
&
//'|Click here to CONTINUE (job may fail)'
&
//'|Click here to STOP'//CNULLpz, IOPTION )
IF (IOPTION.EQ.3) CALL EX_ERR_STOP(
&
'Stopping execution as requested...' )
C ..... initialize for the exec phase
ITRC_COUNT = 0
IFIRST_ENTRY = 1
C ..... get the primary key name for ensemble redefinition
Other Docs
Known Problems
ens_define.f409
Other Docs
Known Problems
ens_define.f410
C-----------------------------------------------------------------------------C
Flow routine for ENS_DEFINE.
C------------------------------------------------------------------------------
&
#include "ens_define.inc"
INTEGER NSTORED, ITHDRS(NTHz,NSTORED), IFOUND_EOJ, NOUTPUT,
&
NOVERLAP, J
REAL TRACES(NUMSMPz,NSTORED), RTHDRS(NTHz,NSTORED)
C ..... Initialize the number to output to zero (not ready yet)
NOUTPUT = 0
IF ( IFOUND_EOJ .EQ. 1 ) THEN
C ......... We have reached the end of the data, output whatever we have
NOUTPUT = NSTORED
RETURN
ENDIF
IF ( IH_PRIM .NE. 0 ) THEN
C ......... We are looking for the primary key value to change
DO 100 J=2,NSTORED
IF ( ITHDRS(IH_PRIM,J) .NE. ITHDRS(IH_PRIM,J-1) ) THEN
C ................. Output up to the change
NOUTPUT = J-1
NOUT_EXEC = NOUTPUT
C ................. Save what it not output for next time
NOVERLAP = NSTORED - NOUTPUT
RETURN
ENDIF
100
CONTINUE
ENDIF
RETURN
END
C-----------------------------------------------------------------------------C
C
Execution routine for ENS_DEFINE
C
C
Input parameters:
C
NTR_BUFF - size of the trace buffer (MAX(NSTORED, NOUTPUT)
C
from FLOW_ENS_DEFINE
C
C
Input/output parameters:
C
ITHDRS - 2-d array of INTEGER*4 trace header entries
C
RTHDRS - 2-d array of REAL*4 trace header entries
C
C
Unused parameters:
C
TRACES - 2-D array of trace samples
C
C
Original code by S. Rutt Bridges, April 30, 1991.
Other Docs
Known Problems
ens_define.f411
C
Rewritten as a single buffered tools by D.E. Diller, May 12, 1992
C
C-----------------------------------------------------------------------------SUBROUTINE EXEC_ENS_DEFINE( TRACES, ITHDRS, RTHDRS, NTR_BUFF )
#include "ens_define.inc"
#include "header.inc"
INTEGER NTR_BUFF, J, ITHDRS(NTHz,NTR_BUFF)
REAL TRACES(NUMSMPz,NTR_BUFF), RTHDRS(NTHz,NTR_BUFF)
C ..... no action needed for cleanup mode
IF (CLEANUPz) RETURN
C ..... Set the header values
DO 100 J=1,NOUT_EXEC
ITHDRS(ISEQNOz,J) = J
ITHDRS(IEND_ENSz,J) = NLASTpz
100
CONTINUE
ITHDRS(IEND_ENSz,NOUT_EXEC) = LASTTRpz
RETURN
END
Other Docs
Known Problems
interp_sb.menu412
interp_sb.menu
'(
name: INTERP_SB
label: "Single Buffer Trace Interpolation"
value_tab: 35
exec_data: ("INTERP_SB"
("GENERAL"
("dummy"
implicit: 1)
)
)
)
Other Docs
Known Problems
interp_sb.c413
interp_sb.c
/*--------------------------------------------------------------------------*/
/* interp_sb
/* An example of a single buffer tool in C. The program collects an ensemble
/* of data traces then passes the ensemble on to the exec_ subroutine.
/* The program uses a change in Primary sort key value to detect that
/* there has been a change in the ensemble rather than by using the END_ENS
/* flag. This is done for demonstration of the nOverlap variable in
/* the flow routine. The output data traces are the original traces
/* plus a trace that is linearly interpolated between each input trace.
/* The output ensemble therefore has 2*N - 1 traces where
/* N is the number of input traces.
/*
/* The example called interp_db.c is identical to this example except that
/* this is a single buffer tool and therefore the input trace buffer also
/* serves as the ouptut trace buffer.
/*-------------------------------------------------------------------------*/
/* include promax interface, globals, error codes, etc */
#include "cpromax.h"
#include "cglobal.h"
/* define saved parameters */
BEGINPARMS
int nInEnsemble; /* the number of traces passed to the exec subroutine */
int pKeyHdrIndx; /* index of the primary sort key trace header (FFID, CDP etc)
*/
ENDPARMS(parms)
/*-------------------------------------------------------------------*/
/*
/* description:
/*
initialization routine for interp_sb:
/*
/* output arguments:
/*
len_sav - length of the saved common block
/*
itooltype - type of tool
/*
/*-------------------------------------------------------------------*/
void init_interp_sb_( len_sav, itooltype )
int *len_sav, *itooltype;
{
int max_to_buffer, nPadTraces, nPadSamples;
/* set the global pointers */
GlobalRuntime *gr = globalRuntime;
/* set the number of words that need to be saved */
*len_sav = NPARMS(parms);
Other Docs
Known Problems
interp_sb.c414
/*
/*
/*
/*
/*
/*
Get the header array index for the primary sort key of the input data. */
Note that 1 is subracted from the value of globalRuntime->ipkey */
to obtain the index of the primary sort key that is appropriate for */
the C language. The global variable trace indicies are indexed for */
FORTRAN. This rule is true for globalRuntime->iskey as well as */
the standard headers. */
parms->pKeyHdrIndx = gr->ipkey - 1;
/*
/*
/*
/*
/*
Notify trace exec of maximum number of traces it will have to hold for */
this module. The ex_buff_parms_() routine must be called in the init */
subroutine of any buffered tool. NOTE that the routine is a FORTRAN */
routine that is being directly called by this C routine so the address of */
the variables are passed. */
max_to_buffer = 2*gr->maxdtr;
nPadTraces = 0;
nPadSamples = 0;
ex_buff_parms_( &max_to_buffer, &nPadTraces, &nPadSamples );
/* we are going to output more traces per ensemble than are input */
gr->maxdtr = (2*gr->maxdtr) - 1;
/* set the tool type */
*itooltype = ISNL_BUFF;
}
/*--------------------------------------------------------------------*/
/*
/* flow tool for interp_sb
/*
/* input args
/*
traces - 2d array of data traces
/*
ithdrs - 2-d array of input integer trace headers
/*
rthdrs - 2-d array of input float trace headers
/*
/*
/*--------------------------------------------------------------------*/
flow_interp_sb_( float *traces, int *ithdrs, float *rthdrs,
int *nStored, int *ifound_eoj, int *nOutput, int *nOverlap )
{
GlobalRuntime *gr = globalRuntime;
float **rhdrs;
/*
/*
/*
/*
/*
if( *nStored == 1 ){
.. There is only one trace so we can't compare it to anything. This */
.. situtation should only occur on the first call to the routine unless */
.. the last trace input is a single-trace ensemble in which case more */
.. code would be needed to handle that special case. We leave out that */
.. extra code here as it would clutter the example. */
*nOutput = 0;
return;
}
Other Docs
Known Problems
interp_sb.c415
}
/*-------------------------------------------------------------------*/
/*
/*
description:
/*
exectution routine for interp_sb
/*
/*
input arguments:
/*
nStored - the amount of memory available (in traces) in the
/*
traces array. NOTE that the actual number of traces
/*
input was determined in the flow_interp_sb routine and
/*
passed to exec_interp_sb via the parms->nInEnsemble
/*
variable.
/*
/*
input/output arguments:
/*
traces - 2-d array of traces
/*
ithdrs - 2-d array of integer trace headers
/*
rthdrs - 2-d array of float trace headers
/*
/*-------------------------------------------------------------------*/
void exec_interp_sb_( float *traces, int *ithdrs,
float *rthdrs, int *nStored )
{
float **rhdrs, **tracs;
Other Docs
Known Problems
interp_sb.c416
int i,j;
/* set the global pointers */
GlobalRuntime *gr = globalRuntime;
/* if cleaning up release memory, close files, in this case there is nothing to
do */
if( gr->cleanup){
return;
}
/* Arrange the trace and header arrays into 2d arrays that are easy to handle. */
tracs = fVecTo2d( traces, *nStored, gr->numsmp );
rhdrs = fVecTo2d( rthdrs, *nStored, gr->nth );
/* Interpolate the sample values */
for( i = 0; i < gr->numsmp; i++ ){
for( j = parms->nInEnsemble-1; j > 0; j-- ){
tracs[2*j][i]
= tracs[j][i];
tracs[2*j-1][i] = (tracs[j][i] + tracs[j-1][i])/2.;
}
}
/* Take care of the headers too, interpolated traces will have a copy */
/* of the header just before them */
for( i = 0; i < gr->nth; i++ ){
for( j = parms->nInEnsemble-1; j > 0; j-- ){
rhdrs[2*j][i]
= rhdrs[j][i];
rhdrs[2*j-1][i] = rhdrs[j-1][i];
}
}
free( tracs );
free( rhdrs );
}
Other Docs
Known Problems
417
Other Docs
semblance.menu
semblance.inc
semblance.f
interp_db.menu
interp_db.c
Known Problems
semblance.menu418
semblance.menu
'(
name: SEMBLANCE
label: "Semblance Vel Analysis"
parameter: VSTART
text: "Minimum analysis velocity"
type: typein:
type_desc: ( real: 7 1.0e-5 nil )
value: -1.0
mouse_text: "Minimum expected stacking velocity."
parameter: VEND
text: "Maximum analysis velocity"
type: typein:
type_desc: ( real: 7 1.0e-4 nil )
value: -1.0
mouse_text: "Maximum expected stacking velocity."
parameter: NVELS
text: "Number of test velocities"
type: typein:
type_desc: ( int: 3 1 999 )
value: 25
mouse_text: "Number of constant velocities to use to compute semblance values."
parameter: NORM
text: "Semblance normalization mode"
type: pop_choose:
type_desc: (
("Scale Time Slice"
1 "Divide time slice of semblance values by the maximum in
time slice.")
("Scale Panel" 2 "Divide all semblance values by the maximum semblance in
panel.")
("No Scaling"
3 "Do no scaling of semblance values.")
)
mouse_text: "Choose method of normalizing semblances."
parameter: RNOISE
text: "Noise factor for normalization"
type: typein:
type_desc: ( real: 3 0.0 nil )
value: 0.1
mouse_text: "Add this value to maximum semblance (in time slice, or panel) before
scaling. Recommend 0.0 to 0.4"
parameter: STRETCH
text: "Stretch factor"
type: typein:
type_desc: ( real: 3 0.0 999.0 )
value: 50.0
mouse_text: "Maximum percentage stretch allowed in NMO calculation?"
parameter: MIN_FOLD
text: "Minimum fold"
type: typein:
Other Docs
Known Problems
semblance.menu419
type_desc: ( int: 2 1 99 )
value: 4
mouse_text: "Minimum fold required for semblance calculation?"
exec_data: ("SEMBLANCE"
("GENERAL"
("version " implicit: "@(#)semblance.menu
("VSTART " implicit: (value 'VSTART))
("VEND
" implicit: (value 'VEND))
("NVELS
" implicit: (value 'NVELS))
("NORM
" implicit: (value 'NORM))
("RNOISE " implicit: (value 'RNOISE))
("STRETCH " implicit: (value 'STRETCH))
("MIN_FOLD" implicit: (value 'MIN_FOLD))
)
)
40.1
11/24/92" )
rules: (
Other Docs
Known Problems
semblance.inc420
semblance.inc
IMPLICIT NONE
C-----------------------------------------------------------------------------C
Include file for SEMBLANCE
C-----------------------------------------------------------------------------#include "global.inc"
&
&
&
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
Other Docs
31.4
5/14/92
Known Problems
semblance.f421
semblance.f
C-----------------------------------------------------------------------------C
Initialization routine for SEMBLANCE
C-----------------------------------------------------------------------------SUBROUTINE INIT_SEMBLANCE( LEN_SAV, ITOOLTYPE )
#include "semblance.inc"
#include "hdr_err.inc"
#include "header.inc"
CHARACTER CDESC*32
INTEGER IERR, IFORMAT, LEN_SAV, ITOOLTYPE, LENGTH, IOK_HDR,
&
MAXDTRZ_SAVE
CHARACTER CSCCS_KEY*50
DATA CSCCS_KEY /'@(#)semblance.f 31.6 5/14/92'/
C ..... Must not be stacked data
IF ( IDTYPz .EQ. ISTACKEDpz ) CALL EX_ERR_FATAL(
&
'Cannnot operate on stacked data' )
C ..... The trace number is no longer valid, and the geometry no longer matches
ITRNO_VALIDz = 0
IGEOM_MATCHz = 0
C ..... Get the starting velocity
VSTART = -1.0
CALL EX_GETPARM( 'VSTART ', 1, VSTART )
IF ( VSTART .EQ. -1.0 ) CALL EX_ERR_FATAL(
&
'Starting velocity must be specified' )
C ..... Get the ending velocity
VEND = -1.0
CALL EX_GETPARM( 'VEND
', 1, VEND )
IF ( VEND .EQ. -1.0 ) CALL EX_ERR_FATAL(
&
'Ending velocity must be specified' )
C ..... Get the number of velocities
NVELS = 0
CALL EX_GETPARM( 'NVELS
', 1, NVELS )
IF ( NVELS .LE. 0 ) CALL EX_ERR_FATAL(
&
'Number of velocities must be specified' )
C ..... We will actually output 3 extra traces
NOUT = NVELS + 3
C ..... get the normalization method
NORM = 0
CALL EX_GETPARM( 'NORM
', 1, NORM )
IF ( NORM .LE. 0 ) CALL EX_ERR_FATAL(
&
'Norm method is not specified' )
C ..... Get the noise factor
RNOISE = 0.1
CALL EX_GETPARM( 'RNOISE ', 1, RNOISE )
IF ( RNOISE .LT. 0.0 ) CALL EX_ERR_FATAL(
Other Docs
Known Problems
semblance.f422
&
Other Docs
Known Problems
semblance.f423
C-----------------------------------------------------------------------------C
Flow routine for SEMBLANCE.
C------------------------------------------------------------------------------
&
#include "semblance.inc"
#include "header.inc"
INTEGER NSTORED, ITHDRS(NTHz,NSTORED), IFOUND_EOJ, NOUTPUT,
&
NOVERLAP
REAL TRACES(NUMSMPz,NSTORED), RTHDRS(NTHz,NSTORED)
C ..... We're just looking for the end of an ensemble
IF ( IFOUND_EOJ .EQ. 1
&
.OR. ITHDRS(IEND_ENSz,NSTORED) .EQ. LASTTRpz ) THEN
NOUTPUT = NOUT
ELSE
NOUTPUT = 0
ENDIF
C ..... We don't want to see any of the input traces again
NOVERLAP = 0
RETURN
END
C-----------------------------------------------------------------------------C
Execution routine for SEMBLANCE.
C------------------------------------------------------------------------------
&
&
#include "semblance.inc"
#include "mem.inc"
#include "header.inc"
INTEGER NTR_BUFF_IN, NTR_BUFF_OUT, J, IERR, IX_WORK1,
&
ITHDRS_IN(NTHz,NTR_BUFF_IN),
&
ITHDRS_OUT(NTHz,NTR_BUFF_OUT)
REAL TRACES_IN(NUMSMPz,NTR_BUFF_IN),
&
TRACES_OUT(NUMSMPz,NTR_BUFF_OUT),
Other Docs
Known Problems
semblance.f424
&
&
RTHDRS_IN(NTHz,NTR_BUFF_IN),
RTHDRS_OUT(NTHz,NTR_BUFF_OUT)
IF (CLEANUPz) RETURN
C ..... Calculate the semblance (also need one addition scratch buffer)
CALL MEM_RESBUFF( NTR_BUFF_IN*NUMSMPz, IX_WORK1, IERR )
CALL SEMBLANCE_WORK( TRACES_IN, NUMSMPz, RTHDRS_IN, NTHz,
&
NTR_BUFF_IN, RSPACEz(IX_WORK1), RSPACEz(IX_WORK2),
&
RSPACEz(IX_WORK3), TRACES_OUT, NVELS, NOUT,
&
RSPACEz(IX_VNMO), IOFFSETz, SAMPRATz, VSTART, VEND,
&
IH_VEL, RSPACEz(IX_VELSAVE), INA_STATz, NFFT, NORM,
&
RNOISE, MIN_FOLD, STRETCH )
CALL MEM_FREEBUFF( NTR_BUFF_IN*NUMSMPz, IX_WORK1, IERR )
C ..... Create the output headers
DO 100 J=1,NTR_BUFF_OUT
C ......... Just copy the last header
CALL VMOV( ITHDRS_IN(1,NTR_BUFF_IN), 1,
&
ITHDRS_OUT(1,J), 1, NTHz )
C ......... Make the offset zero
RTHDRS_OUT(IOFFSETz,J) = 0.0
C ......... Set the velocity and round off to nearest 10 for labeling neatness
RTHDRS_OUT(IH_VEL,J) = NINT( RSPACEz(IX_VELSAVE+J-1)
&
/ 10.0 ) * 10.0
C ......... Make the trace number null
ITHDRS_OUT(ITRACENOz,J) = INULLpz
C ......... Set the END_ENS flag
ITHDRS_OUT(IEND_ENSz,J) = NLASTpz
IF ( J .EQ. NTR_BUFF_OUT )
&
ITHDRS_OUT(IEND_ENSz,J) = LASTTRpz
100
CONTINUE
RETURN
END
&
&
&
&
&
&
&
&
C ..... Initialize:
VINC = (VEND - VSTART) / FLOAT(NVELS-1)
C ..... AGC all of the data first (1000.0 ms or the trace length)
LENHALF = NINT( ( 1000.0 / SAMPRATE ) / 2.0 )
IF ( LENHALF .GT. NSAMPS/2 ) LENHALF = NSAMPS/2
Other Docs
Known Problems
semblance.f425
&
90
DO 90 J=1,NSTORED
CALL STAT_AGC_RUNAVG( TRACES(1,J), WORK2, NSAMPS,
LENHALF, 0 )
CONTINUE
Other Docs
Known Problems
semblance.f426
200
CONTINUE
Other Docs
Known Problems
interp_db.menu427
interp_db.menu
'(
name: INTERP_DB
label: "Double Buffer Trace Interpolation"
value_tab: 35
exec_data: ("INTERP_DB"
("GENERAL"
("dummy"
implicit: 1)
)
)
)
Other Docs
Known Problems
interp_db.c428
interp_db.c
/*--------------------------------------------------------------------------*/
/* interp_db
/* An example of a double buffer tool in C. The program collects an ensemble
/* of data traces then passes the ensemble on to the exec_ subroutine.
/* The program uses a change in Primary sort key value to detect that
/* there has been a change in the ensemble rather than by using the END_ENS
/* flag. This is done for demonstration of the nOverlap variable in
/* the flow routine. The output data traces are the original traces
/* plus a trace that is linearly interpolated between each input trace.
/* The output ensemble therefore has 2*N - 1 traces where
/* N is the number of input traces.
/*
/* The single buffer tool example called interp_sb.c is identical to
/* this example except that this is a double buffer tool and therefore
/* the data traces from the input buffer are mapped to the separate
/* output trace buffer.
/*-------------------------------------------------------------------------*/
/* include promax interface, globals, error codes, etc */
#include "cpromax.h"
#include "cglobal.h"
/* define saved parameters */
BEGINPARMS
int nInEnsemble; /* the number of traces passed to the exec subroutine */
int pKeyHdrIndx; /* index of the primary sort key trace header (FFID, CDP etc)
*/
ENDPARMS(parms)
/*-------------------------------------------------------------------*/
/*
/* description:
/*
initialization routine for interp_sb:
/*
/* output arguments:
/*
len_sav - length of the saved common block
/*
itooltype - type of tool
/*
/*-------------------------------------------------------------------*/
void init_interp_db_( len_sav, itooltype )
int *len_sav, *itooltype;
{
int max_to_buffer, nPadTraces, nPadSamples;
/* set the global pointers */
GlobalRuntime *gr = globalRuntime;
/* set the number of words that need to be saved */
*len_sav = NPARMS(parms);
Other Docs
Known Problems
interp_db.c429
/*
/*
/*
/*
/*
/*
Get the header array index for the primary sort key of the input data. */
Note that 1 is subracted from the value of globalRuntime->ipkey */
to obtain the index of the primary sort key that is appropriate for */
the C language. The global variable trace indicies are indexed for */
FORTRAN. This rule is true for globalRuntime->iskey as well as */
the standard headers. */
parms->pKeyHdrIndx = gr->ipkey - 1;
/*
/*
/*
/*
/*
Notify trace exec of maximum number of traces it will have to hold for */
this module. The ex_buff_parms_() routine must be called in the init */
subroutine of any buffered tool. NOTE that the routine is a FORTRAN */
routine that is being directly called by this C routine so the address of */
the variables are passed. */
max_to_buffer = 2*gr->maxdtr;
nPadTraces = 0;
nPadSamples = 0;
ex_buff_parms_( &max_to_buffer, &nPadTraces, &nPadSamples );
/* we are going to output more traces per ensemble than are input */
gr->maxdtr = (2*gr->maxdtr) - 1;
/* set the tool type */
*itooltype = IDBL_BUFF;
}
/*--------------------------------------------------------------------*/
/*
/* flow tool for interp_db
/*
/*
/*
/*--------------------------------------------------------------------*/
flow_interp_db_( float *traces, int *ithdrs, float *rthdrs,
int *nStored, int *ifound_eoj, int *nOutput, int *nOverlap )
{
GlobalRuntime *gr = globalRuntime;
float **rhdrs;
/*
/*
/*
/*
/*
if( *nStored == 1 ){
.. There is only one trace so we can't compare it to anything. This */
.. situtation should only occur on the first call to the routine unless */
.. the last trace input is a single-trace ensemble in which case more */
.. code would be needed to handle that special case. We leave out that */
.. extra code here as it would clutter the example. */
*nOutput = 0;
return;
}
Other Docs
Known Problems
interp_db.c430
{
float **rhdrs_in, **tracs_in;
float **rhdrs_out, **tracs_out;
int i,j;
Other Docs
Known Problems
interp_db.c431
gr->numsmp );
gr->nth );
Other Docs
Known Problems
interp_db.c432
Other Docs
Known Problems
433
Other Docs
transform.menu
transform.inc
transform.f
transform.c
Known Problems
transform.menu434
transform.menu
'(
name: TRANSFORM
label: "Transform"
value_tab: 35
exec_data: ("TRANSFORM"
("GENERAL"
("dummy" implicit: nil)
)
)
)
Other Docs
Known Problems
transform.inc435
transform.inc
C-----------------------------------------------------------------------------C
Include file for TRANSFORM
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
&
&
C
C
C
C
.....
.....
.....
.....
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
Other Docs
Known Problems
transform.f436
transform.f
SUBROUTINE INIT_TRANSFORM( LEN_SAV, ITOOLTYPE )
#include "transform.inc"
#include "header.inc"
INTEGER LEN_SAV, ITOOLTYPE, IOK_HDR
C ..... The trace number is no longer valid, and the geometry no longer matches
ITRNO_VALIDz = 0
IGEOM_MATCHz = 0
C ..... Reset the data type to transformed unstacked data
IDTYPz = IUS_TRANSpz
C ..... Reset the domain. We will have to make up something new, since
C ..... nothing appropriate exists
IDOMAINz = 100
C ..... Save the previous values of the trace length and maximum number
C ..... of traces per ensemble (we will need them in exec phase)
MAXDTRZ_OLD = MAXDTRz
NUMSMPZ_OLD = NUMSMPz
C ..... Reset the trace length and maximum number of traces per ensemble
MAXDTRz = NUMSMPZ_OLD
NUMSMPz = MAXDTRZ_OLD
C ..... Check the needed header entries
IF ( IOK_HDR(IEND_ENSz) .NE. 1 ) CALL EX_ERR_FATAL(
&
'ENS_ENS not found in header' )
IF ( IOK_HDR(ITRACENOz) .NE. 1 ) CALL EX_ERR_FATAL(
&
'TRACENO not found in header' )
IF ( IOK_HDR(ISEQNOz) .NE. 1 ) CALL EX_ERR_FATAL(
&
'SEQNO not found in header' )
C ..... Initialize for execution phase
NSTORED = 0
NDUMPED = 0
DUMPING = .FALSE.
C ..... Set the number of words that need to be saved and the tool type
LEN_SAV = LENSAVED
ITOOLTYPE = ICOMPLEXpz
RETURN
END
Other Docs
Known Problems
transform.f437
This is a
Other Docs
Known Problems
transform.f438
100
110
&
&
IMPLICIT NONE
INTEGER NUMSMPZ_OLD, MAXDTRZ_OLD, I, J
REAL TRACES_OLD(NUMSMPZ_OLD,MAXDTRZ_OLD),
TRACES_NEW(MAXDTRZ_OLD,NUMSMPZ_OLD)
DO 110 J=1,MAXDTRZ_OLD
DO 100 I=1,NUMSMPZ_OLD
TRACES_NEW(J,I) = TRACES_OLD(I,J)
CONTINUE
CONTINUE
RETURN
END
Other Docs
Known Problems
transform.c439
transform.c
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
#include "alloc.h"
#include "memalloc.h"
#include "agfc.h"
/* define saved parameters */
BEGINPARMS
/* saved parms related to sample interval and trace length */
int
maxdtr_old;
int
numsmp_old;
/* saved parms related to control of trace I/O */
int nstored;
int ndumped;
int dumping;
/* saved
float
float
float
ENDPARMS(parms)
void init_transform_(int *len_sav, int *itooltype);
void exec_transform_(float *trace, int *ithdr, float *rthdr);
float **transform_work( float**, int, int, int );
/*------------------------------------------------------------------Description:
Initialization routine for transform
output arguments:
len_save - number of 4-byte words to save for re-entrancy
itooltype - processing tool type
---------------------------------------------------------------------*/
void init_transform_(int *len_sav, int *itooltype)
{
/* local variabes */
GlobalRuntime *gr = globalRuntime;
/* The trace number is no longer valid, and the geometry no longer matches */
gr->itrno_valid = 0;
gr->igeom_match = 0;
/* Reset the data type to transformed unstacked data */
gr->idtyp = IUS_TRANS;
Other Docs
Known Problems
transform.c440
*/
/*********************************************************************
*
*
Description:
*
Execution routine for transform
*
*
Input/output arguments:
*
trace - array of trace samples
*
ithdr - trace header (as integer)
*
rthdr - trace header (as floating [point)
*
**********************************************************************/
Other Docs
Known Problems
transform.c441
Other Docs
Known Problems
transform.c442
Other Docs
Known Problems
transform.c443
int i, j;
float **t;
/* allocate space for the transformed traces */
t = _memAlloc2Float( outTrcLen, numOutTrcs, "transform.c", 218 );
Other Docs
Known Problems
transform.c444
Other Docs
Known Problems
445
Other Docs
sine_wave.menu
sine_wave.inc
sine_wave.f
sineWave.c
Known Problems
sine_wave.menu446
sine_wave.menu
'(
name: SINE_WAVE
label: "Sine Wave Generation"
value_tab: 45
parameter: PKEYNAM
text: "Primay key name"
type: circular:
type_desc: (
("Source" "SOURCE" "Generate synthetic shot gathers." )
("CDP
" "CDP"
"Generate synthetic CDP gathers."))
value: "SOURCE"
mouse_text: "Use B1 to toggle between SHOT or CDP gathers."
parameter: NENS
text: "Number of trace ensembles to generate"
type: typein:
type_desc: ( int: 5 1 nil )
value: 1
mouse_text: "How many ensembles do you wish to generate?"
parameter: NTRACES
text: "Number of traces per ensemble"
type: typein:
type_desc: ( int: 5 1 nil )
value: 60
mouse_text: "How many traces per ensemble do you wish to generate?"
parameter: SAMPRATE
text: "Sample interval for the synthetic traces"
type: typein:
type_desc: ( real: 7 1.0e-5 nil )
value: 2.0
mouse_text: "What is the desired sample interval (in milliseconds) for the
synthetic traces?"
parameter: TRACELEN
text: "Trace length for the synthetic traces"
type: typein:
type_desc: ( real: 7 1.0e-5 nil )
value: 2000.0
mouse_text: "What is the desired trace length (in milliseconds) for the synthetic
traces?"
parameter: FREQS
text: "List of frequencies"
type: edit:
type_desc: (31 80 5 " FORMAT: freq1 , freq2 , freq3 , ...
EXAMPLE: 60.0,125.0
HELP: EMACS Editor Widget (scroll with down/up arrow keys)
CURSOR MOVEMENT: Use the arrow keys:->,<-,etc.;Point the mouse cursor,click B1
CM: Ctrl-A Move the cursor to the BEGINNING of the current line
CM: Ctrl-E Move the cursor to the END of the current line
EDITING: All keyboard entry is in 'insert' mode
E: Backspace, Delete keysDelete one character to the LEFT of the cursor
Other Docs
Known Problems
sine_wave.menu447
E:
E:
E:
Other Docs
Known Problems
sine_wave.inc448
sine_wave.inc
C-----------------------------------------------------------------------------C
Include file for SINE_WAVE
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
&
C
C
C
C
.....
.....
.....
.....
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
Other Docs
Known Problems
sine_wave.f449
sine_wave.f
C ..... This tool is a template for an input tool
cdd - short-hand header manipulation
cdd - no missing code
SUBROUTINE INIT_SINE_WAVE( LEN_SAV, ITOOLTYPE )
#include "sine_wave.inc"
#include "mem.inc"
#include "header.inc"
CHARACTER*8 CNAMES(4)
CHARACTER CPKEYNAM*8
INTEGER NCHARS, NTR_PER_ENS, NS, IERR, LEN_SAV,
&
ITOOLTYPE, IOK_HDR
REAL SAMPRATE, TRACELEN
C ..... Get the primary key name
CALL EX_CGETPARM( 'PKEYNAM ', 1, CPKEYNAM, NCHARS )
IF ( CPKEYNAM(1:6) .NE. 'SOURCE'
&
.AND. CPKEYNAM(1:3) .NE. 'CDP' ) CALL EX_ERR_FATAL(
&
'Only SOURCE or CDP can be primary keys' )
C ..... Get and decode the list for frequencies
CALL EX_CGETPARM( 'FREQS
', 1, CTEMPz, NCHARS )
IF ( NCHARS .LT. 1 ) CALL EX_ERR_FATAL(
&
'No frequencies were input' )
CALL FIX_SLASHES( CTEMPz, NCHARS, NS )
CALL FLOAT_DECODE( CTEMPz, NS, RTEMPz, NFREQS, .FALSE. )
IF ( NFREQS .LT. 1 ) CALL EX_ERR_FATAL(
&
'No frequencies were input' )
C ..... Get a buffer and save the frequencies
CALL MEM_RESBUFF( NFREQS, IX_FREQS, IERR )
CALL VMOV( RTEMPz, 1, RSPACEz(IX_FREQS), 1, NFREQS )
C ..... Get the number of traces per ensemble, the sample rate, the length of
C ..... the traces, and the number of ensembles
NTR_PER_ENS = 0
SAMPRATE = 0.0
TRACELEN = 0.0
NENS = 0
CALL EX_GETPARM( 'NTRACES ', 1, NTR_PER_ENS )
CALL EX_GETPARM( 'SAMPRATE', 1, SAMPRATE )
CALL EX_GETPARM( 'TRACELEN', 1, TRACELEN )
CALL EX_GETPARM( 'NENS
', 1, NENS )
C ..... Check and set the number of traces per ensemble
IF ( NTR_PER_ENS .LE. 0 ) THEN
CALL EX_ERR_FATAL(
&
'Number of traces per ensemble < 1' )
ELSE
MAXDTRz = NTR_PER_ENS
ENDIF
Other Docs
Known Problems
sine_wave.f450
Other Docs
Known Problems
sine_wave.f451
ENDIF
C ..... Set the domain to normal space-time
IDOMAINz = ITXpz
C ..... Check to be sure that SEQNO, TRACENO, and END_ENS exist
IF ( IOK_HDR(ISEQNOz) .NE. 1 ) CALL EX_ERR_FATAL(
&
'SEQNO not found in header' )
IF ( IOK_HDR(ITRACENOz) .NE. 1 ) CALL EX_ERR_FATAL(
&
'TRACENO not found in header' )
IF ( IOK_HDR(IEND_ENSz) .NE. 1 ) CALL EX_ERR_FATAL(
&
'END_ENS not found in header' )
C ..... It is impossible for the geometry to match or the trace number to be
C ..... valid (must be set by the program INIT_DATABASE)
IGEOM_MATCHz = 0
ITRNO_VALIDz = 0
C
C
C
C
C
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
Other Docs
Known Problems
sine_wave.f452
&
#include "sine_wave.inc"
#include "header.inc"
INTEGER ITHDR(NTHz), I
REAL TRACE(NUMSMPz), FREQS(NFREQS), RTHDR(NTHz)
LOGICAL NO_DATA_FOUND
IF ( IENS .GT. NENS
C ......... We have no more
C ......... to read a trace
NO_DATA_FOUND =
RETURN
ELSE
NO_DATA_FOUND =
ENDIF
) THEN
data to output. This is equivalent to failing
from disk or tape
.TRUE.
.FALSE.
Other Docs
Known Problems
sine_wave.f453
Other Docs
Known Problems
sine_wave.f454
100
DO 100 I=1,NUMSMP
TIME = FLOAT(I-1) * SAMPRAT / 1000.0
ANGLE = FREQ * TIME * TWO_PI
TRACE(I) = TRACE(I) + SIN( ANGLE )
CONTINUE
RETURN
END
Other Docs
Known Problems
sineWave.c455
sineWave.c
/* this tool is a template for an input tool */
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
/* define the saved parameters (user input, etc) */
BEGINPARMS
int
nens;
int
nfreqs;
float *freqs;
int
currEns;
int
currTrcInEns;
logical firstVisit;
/*
/*
/*
/*
/*
/*
ENDPARMS (parms)
/* functions defined and used internally */
static void sineWaveAdd( float, float, int, float* );
static int sineWaveNextTr( float*, int*, float*, float* );
/*-------------------------------------------------------------------*/
/* init_sine_wave
/*
/* initialization routine for ProMAX module sine_wave
/*
/*-------------------------------------------------------------------*/
void init_sine_wave_( int *len_sav, int *itooltype )
{
Other Docs
Known Problems
sineWave.c456
){
= 0.0;
Other Docs
Known Problems
sineWave.c457
..
..
..
..
..
..
..
Other Docs
Known Problems
sineWave.c458
;
;
;
;
;
;
}
/*-------------------------------------------------------------------*/
/* exec_sine_wave
/*
/* execution routine for ProMAX module sine_wave
/*
/*
/*-------------------------------------------------------------------*/
void exec_sine_wave_( float* trace, float* rthdr, int* ithdr )
{
/* declare
int
int
float
int
int
logical
local versions
nens
=
nfreqs
=
*freqs
=
currEns
=
currTrcInEns =
firstVisit
=
Other Docs
of external variables */
parms->nens
;
parms->nfreqs
;
parms->freqs
;
parms->currEns
;
parms->currTrcInEns ;
parms->firstVisit
;
Known Problems
sineWave.c459
Other Docs
Known Problems
sineWave.c460
int i;
int iErr;
float offset;
/* global variables */
GlobalRuntime *gr = globalRuntime;
if( parms->currEns > parms->nens ){
/* .. we have no more data to output, this is equivalent to */
/* .. failing to read a trace from tape or disk */
return(TRUE);
}
/* if control reaches here we need to build a trace */
/* clear the input data trace */
vClr( trace, 1, gr->numsmp );
/* add the sine_wave data to the trace */
for( i = 0; i < parms->nfreqs; i++ ){
sineWaveAdd( freqs[i], gr->samprat, gr->numsmp, trace );
}
/* initialize the values of the minimum standard header values */
initStdHdr( ithdr, rthdr );
/* take care of other header entries */
if( gr->ipsort == ISIN ){
/* .. inputting shots */
/* .. the source index number should be null until geom is assigned */
ithdr[ hdrIndex("SIN") ] = INULL;
/* .. set the live source number */
ithdr[ hdrIndex("SOURCE") ] = parms->currEns;
/* .. set the channel number */
ithdr[ hdrIndex("CHAN") ] = parms->currTrcInEns;
/* .. set the field file id number, FFID */
ithdr[ hdrIndex("FFID") ] = parms->currEns;
}
else{
/* .. inputting CDPs */
/* .. set the CDP bin number */
ithdr[ hdrIndex("CDP") ] = parms->currEns;
/* .. set the offset and aoffset, these values don't make much sense */
offset = (float)(parms->currTrcInEns);
rthdr[ hdrIndex("OFFSET") ] = offset;
rthdr[ hdrIndex("OFFSET") ] = (float)fabs( (double)offset );
}
/* set the sequence number in the ensemble */
ithdr[ hdrIndex("SEQNO") ] = parms->currTrcInEns;
/* set the sequential trace number (null until geometry is assigned) */
Other Docs
Known Problems
sineWave.c461
/*-------------------------------------------------------------------*/
/* sineWaveAdd
/*
/* subroutine to add a sine wave to a trace
/* input:
/*
freq - frequency of sine wave to add
/*
sampInt - float sample interval of trace in ms
/*
numsmp - number of samples in trace
/* output:
/*
trace - the trace
/*
/*-------------------------------------------------------------------*/
static void sineWaveAdd( float freq, float sampInt, int numsmp,
float *trace )
{
/* local variables */
int i;
double angle, twoPi, time;
twoPi = asin(1.0)*4.0;
for( i = 0; i < numsmp; i++ ){
time = (float)i * sampInt/1000.;
angle = freq*time*twoPi;
trace[i] += (float)sin( angle );
}
}
Other Docs
Known Problems
sineWave.c462
Other Docs
Known Problems
463
Other Docs
sc_amp.menu
sc_amp.inc
sc_amp.f
disk_iter.menu
disk_iter.c
Known Problems
sc_amp.menu464
sc_amp.menu
'(
name: SC_AMP
label: "Sc Amp"
value_tab: 35
exec_data: ("SC_AMP"
("GENERAL"
("dummy" implicit: nil)
)
)
)
Other Docs
Known Problems
sc_amp.inc465
sc_amp.inc
C-----------------------------------------------------------------------------C
Include file for SC_AMP
C-----------------------------------------------------------------------------IMPLICIT NONE
#include "global.inc"
&
&
Other Docs
Known Problems
sc_amp.f466
sc_amp.f
C ..... This is a working model for a surface consistent gain module.
C ..... makes no attempt for true separation of source and receiver.
It
Other Docs
Known Problems
sc_amp.f467
#include "mem.inc"
INTEGER ITHDR(NTHz), ISHOT, IREC
REAL TRACE(NUMSMPz), RTHDR(NTHz), SCALAR
C ..... No action required in cleanup phase
IF ( CLEANUPz ) RETURN
IF ( ITHDR(ISINz) .GE. MINSINz
&
.AND. ITHDR(ISINz) .LE. MAXSINz
&
.AND. ITHDR(IREC_SLOCz) .GE. MINSLOCz
&
.AND. ITHDR(IREC_SLOCz) .LE. MAXSLOCz ) THEN
C ......... This is a valid trace
C ......... Compute the sequential shot and receiver mem offset
ISHOT = (ITHDR(ISINz)-MINSINz) / INCSINz + 1
IREC = (ITHDR(IREC_SLOCz)-MINSLOCz) / INCSLOCz + 1
IF ( ITHDR(IDISKITERz) .EQ. 1 ) THEN
C ............. Still analyzing the data
C ............. Call the routine to accumulate the statistics
CALL SC_AMP_ACCUM( ISHOT, IREC, TRACE, RSPACEz(IX_TR),
&
NUMSMPz, RSPACEz(IX_SHOT_SUM),
&
RSPACEz(IX_SHOT_NORM), RSPACEz(IX_REC_SUM),
&
RSPACEz(IX_REC_NORM) )
ELSE
C ............. Processing the data
IF ( .NOT. PROCESSING ) THEN
C ................. Just started processing
PROCESSING = .TRUE.
C ................. Normalize the values
CALL SC_AMP_NORM( NSHOTS, NRECS,
&
RSPACEz(IX_SHOT_SUM), RSPACEz(IX_SHOT_NORM),
&
RSPACEz(IX_REC_SUM), RSPACEz(IX_REC_NORM) )
ENDIF
C ............. Apply the scalar to this trace
SCALAR = ( RSPACEz(IX_SHOT_SUM+ISHOT-1)
&
+ RSPACEz(IX_REC_SUM+IREC-1) ) / 2.0
CALL VSDIV( TRACE, 1, SCALAR, TRACE, 1, NUMSMPz )
ENDIF
ENDIF
IF ( ITHDR(IDISKITERz) .EQ. 1 ) THEN
C ......... Still analyzing the data, so act as a black hole
CALL EX_FILLMODE
ELSE
CALL EX_PIPEMODE
ENDIF
RETURN
END
&
Other Docs
Known Problems
sc_amp.f468
&
IMPLICIT NONE
INTEGER ISHOT, IREC, NUMSMP
REAL TRACE(NUMSMP), TR_WORK(NUMSMP), SHOT_SUM(*), SHOT_NORM(*),
REC_SUM(*), REC_NORM(*), SUM, AVEAMP
&
&
100
110
IMPLICIT NONE
INTEGER NSHOTS, NRECS, I
REAL SHOT_SUM(NSHOTS), SHOT_NORM(NSHOTS), REC_SUM(NRECS),
REC_NORM(NRECS)
DO 100 I=1,NSHOTS
IF ( SHOT_NORM(I) .GT. 0.0 ) THEN
SHOT_SUM(I) = SHOT_SUM(I) / SHOT_NORM(I)
ELSE
SHOT_SUM(I) = 1.0
ENDIF
CONTINUE
DO 110 I=1,NRECS
IF ( REC_NORM(I) .GT. 0.0 ) THEN
REC_SUM(I) = REC_SUM(I) / REC_NORM(I)
ELSE
REC_SUM(I) = 1.0
ENDIF
CONTINUE
RETURN
END
Other Docs
Known Problems
disk_iter.menu469
disk_iter.menu
'(
name: DISK_ITER
label: "Disk Iteration Demo"
value_tab: 50
exec_data: ("DISK_ITER"
("GENERAL"
("DUMMY"
implicit: 0)
)
)
)
Other Docs
Known Problems
disk_iter.c470
disk_iter.c
/*--------------------------------------------------------------------*/
/* disk_iter
/* A demo program for iterating over a dataset and scaling the
/* shot records by the power of the shot record.
/*
/*--------------------------------------------------------------------*/
/* include promax interface, globals, error codes, etc */
#include "cpromax.h"
#include "cglobal.h"
/* define saved parameters */
BEGINPARMS
float *scalVals; /* scalar values */
int
hdrIndexSIN;
ENDPARMS(parms)
/*-------------------------------------------------------------------*/
/*
/* description:
/*
initialization routine for disk_iter
/*
/* output arguments:
/*
len_sav - length of the saved common block
/*
itooltype - type of tool
/*
/*
/*-------------------------------------------------------------------*/
void init_disk_iter_( int *len_sav, int *itooltype )
{
int nShots, numIters, i;
/* set the global pointers */
GlobalRuntime *gr = globalRuntime;
GlobalGeom
*gg = globalGeom;
/* make sure the data are sorted by source */
if( gr->ipsort != ISIN ){
exErrFatal("Data must be sorted by SIN for this program to operate.");
}
/* allocate and initialize enough memory to store shot scalar values */
nShots = gg->maxsin - gg->minsin + 1;
if( nShots <= 0 ){
exErrFatal("Number of shots must be greater than 0. Have you "
"assigned geometry yet?");
}
parms->scalVals = (float*)malloc( nShots * sizeof(float));
if( parms->scalVals == NULL ){
Other Docs
Known Problems
disk_iter.c471
*/
/*-------------------------------------------------------------------*/
/*
/*
description:
/*
exectution routine for disk_iter
/*
/*
input/output arguments:
/*
trace - data trace
/*
ithdr - int header array
/*
rthdr - float header array
/*
/*-------------------------------------------------------------------*/
void exec_disk_iter_( float *trace, int *ithdr, float *rthdr)
{
int i;
float val;
/* set the global pointers */
GlobalRuntime *gr = globalRuntime;
GlobalGeom
*gg = globalGeom;
if( ithdr[ hdrIndex("DISKITER") ] == 1 ){
/* .. this is the first pass of the data */
/* .. sum the amplitudes */
if( ithdr[ parms->hdrIndexSIN ] < gg->maxsin ){
for( i = 0; i < gr->numsmp; i++ ){
Other Docs
Known Problems
disk_iter.c472
parms->scalVals[parms->hdrIndexSIN] += trace[i]*trace[i];
}
}
/* .. we are in just getting info from traces, not passing them on yet */
exFillMode();
}
else{
/* .. this is the second pass of the data */
/* .. scale the trace */
if( val = parms->scalVals[parms->hdrIndexSIN] != 0.0 ){
for( i = 0; i < gr->numsmp; i++ ){
trace[i] /= val;
}
}
/* .. put this trace back into the flow and receive one on the next call */
exPipeMode();
}
}
Other Docs
Known Problems
473
Other Docs
prestack_menu
prestack.f
Makefile_prestack
poststack.f
Makefile_poststack
poststack.c
vel_io.f
Known Problems
prestack.menu474
prestack.menu
'(
name: DOMAIN_READ
label: "Domain Read*"
value_tab: 47
parameter: LABEL
text: "Select trace data file"
type: function:
type_desc: (dataset_list datasets)
value: "no entry"
selected_item: "* No Datasets Found *"
mouse_text: "Use Mouse Button 1 to select a trace data file description from the
datasets menu."
parameter: DOMAIN
text: "Domain of the data"
type: pop_choose:
type_desc: (
("CDP" 1 "CDP domain." )
("SIN" 2 "Source domain.")
("SRF" 3 "Surface location domain." )
)
mouse_text: "Use B1 to pop up a menu to select the domain."
exec_data: ("DOMAIN_READ"
("SPECIAL"
("TOOLTYPE"
implicit: "STAND_ALONE")
("PATHNAME"
implicit:
"/home/dave/exer/stand_alone/prestack.exe")
)
("GENERAL"
("LABEL"
("DOMAIN"
)
)
)
Other Docs
Known Problems
prestack.f475
prestack.f
C
C
C
C
C
C
C
C
C
C
C
C
C
C
This is the C "wrapper" that passes command line args to the FORTRAN
stand alone program. This produces the main executable file that is
referenced in the menu under the "special" parameter section.
void main( argc, argv )
int argc;
char **argv;
{
prestack_( &argc, argv[1] );
}
.....
.....
.....
.....
IMPLICIT NONE
#include "global.inc"
#include "mem.inc"
INTEGER NARGS, ID_PACKET, IERR, NCHARS, ID_DATASET, IREAD_ONLY,
&
NDFILES, ISWAPENDS, ITRTOTAL, NUMSMP, NTH, MAXDTR, MAXATR,
&
IPSORT, IPKEY, ISKEY, IDTYP, IDOMAIN, NTRACES, IGEOM_MATCH,
&
ITRNO_VALID, NPRIORF, IFORMAT, LENGTH, IH_PKEY,
&
IX_TRACE, IX_THDR, MAXFOLD, NENS,
&
INPUT_DOMAIN
REAL SAMPRAT, SOFTRLP, GEORLSP
CHARACTER CINPUT(*), CAREA(16), CLINE(16)
CHARACTER CPACKET_FILE*128, CLABEL*8, CDESC*32, CHDRNAM*8,
&
CENS_FLAG*3
IF ( NARGS .LT. 2 ) THEN
C ......... Nothing was entered on the command line
CALL U_ERR_FATAL( 'Packet file must be specified' )
ENDIF
C ..... Load the character ARRAY into a character STRING.
C ..... understand the difference.
CALL U_CARR2STR( CINPUT, CPACKET_FILE, 128 )
C ..... Open
CALL
&
IF (
&
C
C
C
C
.....
.....
.....
.....
the parameter packet file, get back the ID, area, and line
PKT_OPEN_LOAD( CPACKET_FILE, 'DOMAIN_READ
', ID_PACKET,
CAREA, CLINE )
ID_PACKET .EQ. 0 ) CALL U_ERR_FATAL(
'Unable to open packet file' )
Initialize the database for this area and line. Note that CAREA
and CLINE are character arrays, not character strings. This call
set globals geom. from LIN OPF and directory path for database
routines.
CALL DB_INIT_LINE( CAREA, CLINE, IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_DB_ERR( IERR )
CALL U_ERR_FATAL( 'Unable to initialize the database' )
Other Docs
Known Problems
prestack.f476
ENDIF
C ..... Get the label for the dataset from the packet file. Parameters
C
are input using standalone version of EX_GET_PARM
CALL U_CGETPARM( ID_PACKET, 'LABEL
', 1, CLABEL, NCHARS )
C ..... Get the requested domain: 1=CDP, 2=SIN, 3=SRF
CALL U_GETPARM( ID_PACKET, 'DOMAIN ', 1, INPUT_DOMAIN )
IF ( INPUT_DOMAIN .EQ. 1 ) THEN
CENS_FLAG = 'CDP'
ELSEIF ( INPUT_DOMAIN .EQ. 2 ) THEN
CENS_FLAG = 'SIN'
ELSEIF ( INPUT_DOMAIN .EQ. 3 ) THEN
CENS_FLAG = 'SRF'
ENDIF
C ..... Open the dataset (status=readonly)
IREAD_ONLY = 1
CALL DISKIO_OPEN( CLABEL, IREAD_ONLY, ID_DATASET, IERR )
IF ( IERR .NE. 0 ) THEN
CALL U_ERR_FATAL(
&
'Unable to open the trace dataset ' // CLABEL )
ENDIF
C ..... Get misc. info on the dataset. This is where runtime globals
C ..... are set.
CALL DISKIO_INFO( ID_DATASET, NDFILES, ISWAPENDS,
&
ITRTOTAL, SAMPRAT, NUMSMP, NTH, MAXDTR,
&
MAXATR, IPSORT, IPKEY, ISKEY, IDTYP, IDOMAIN,
&
NTRACES, IGEOM_MATCH, ITRNO_VALID, NPRIORF, SOFTRLP,
&
GEORLSP )
C
C
C
C
C
.....
.....
.....
.....
.....
C ..... Now we can get header information. We are after the index of
C ..... the primary key in question.
IF ( CENS_FLAG .EQ. 'CDP' ) THEN
CHDRNAM = 'CDP
'
ELSEIF ( CENS_FLAG .EQ. 'SIN' ) THEN
CHDRNAM = 'SIN
'
ELSEIF ( CENS_FLAG .EQ. 'SRF' ) THEN
CHDRNAM = 'REC_SLOC'
ENDIF
CALL HDR_NAMINFO( CHDRNAM, CDESC, LENGTH, IFORMAT,
&
IH_PKEY, IERR )
IF ( IERR .NE. 0 ) CALL U_ERR_FATAL(
&
'Primary key not found in header' )
C ..... Allocate buffers for a trace and a trace header.
C ..... of memory routines as in executive.
CALL MEM_RESBUFF( NUMSMP, IX_TRACE, IERR )
CALL MEM_RESBUFF( NTH, IX_THDR, IERR )
Same use
C ..... Determine the actual number of ensembles and the maximum fold.
Other Docs
Known Problems
prestack.f477
C ..... Note that all of these variables were set by DB_INIT_LINE. You
C ..... should check to see if they are null (geometry not loaded).
IF ( CENS_FLAG .EQ. 'CDP' ) THEN
NENS = ( MAXCDPz - MINCDPz ) / INCCDPz + 1
MAXFOLD = NTRCDPz
ELSEIF ( CENS_FLAG .EQ. 'SIN' ) THEN
NENS = ( MAXSINz - MINSINz ) / INCSINz + 1
MAXFOLD = MAXCPSz
ELSEIF ( CENS_FLAG .EQ. 'SRF' ) THEN
NENS = ( MAXSLOCz - MINSLOCz ) / INCSLOCz + 1
MAXFOLD = MAXTPRz
ENDIF
&
&
C ..... Call
CALL
&
&
&
#include "global.inc"
&
&
C ..... Assign the secondary key domain (not called 'FOLD' in SIN domain)
C ..... Also assign the primary key name
IF ( CENS_FLAG .EQ. 'CDP' ) THEN
CS_DOMAIN = 'FOLD
'
CPKEYNAM = 'CDP
'
ELSEIF ( CENS_FLAG .EQ. 'SRF' ) THEN
CS_DOMAIN = 'FOLD
'
CPKEYNAM = 'SRF
'
ELSEIF ( CENS_FLAG .EQ. 'SIN' ) THEN
Other Docs
Known Problems
prestack.f478
C ............. Given the primary key and sequence number within ensemble,
C ............. get the trace number. Again the order parameter files are
C ............. the vehicle for extracting the all important original trace #
CALL DB_TRACE_MAP( ITOKEN2, CPKEYNAM, 'sequence',
&
'traceno ', IENS, I, ITRACENO, IFOUND_VAL, IERR )
C ............. Note that in some situations this might not be a fatal error
IF ( IFOUND_VAL .NE. 1 .OR. IERR .NE. 0 ) THEN
WRITE (*,*) CPKEYNAM, I, IFOUND_VAL, IERR
CALL U_ERR_FATAL( 'Error getting TRACENO' )
ENDIF
C
C
C
C
.............
.............
.............
.............
&
&
Other Docs
ITHDR= ',
Known Problems
prestack.f479
100
110
CONTINUE
CONTINUE
RETURN
END
Other Docs
Known Problems
Makefile_prestack480
Makefile_prestack
##############################################################################
# Makefile for ProMAX standalone program
##############################################################################
# Program name
name = prestack
# Object files - preface any product-specific files with "$(product)/"
objs = prestack_main.o prestack.o
# Libraries - to be searched before and after the standard ProMAX libraries
libsbefore =
libsafter =
# Standard rules to make ProMAX programs
include maxprog.make
# be quiet
.SILENT:
Other Docs
Known Problems
poststack.f481
poststack.f
C
C
C
C
C
C
C
C
C
C
This is the C "wrapper" that passes command line args to the FORTRAN
stand alone program. This produces the main executable file that is
referenced in the menu under the "special" parameter section.
void main( argc, argv )
int argc;
char **argv;
{
poststack_( &argc, argv[1] );
}
C ..... This is a sample program that shows how a stand-alone program can
C ..... read post-stack traces (or otherwise access data without using
C ..... TRACENO as a key)
SUBROUTINE POSTSTACK( NARGS, CINPUT )
IMPLICIT NONE
#include "global.inc"
#include "mem.inc"
INTEGER NARGS, ID_PACKET, IERR, NCHARS, ID_DATASET, IREAD_ONLY,
&
NDFILES, ISWAPENDS, ITRTOTAL, NUMSMP, NTH, MAXDTR, MAXATR,
&
IPSORT, IPKEY, ISKEY, IDTYP, IDOMAIN, NTRACES, IGEOM_MATCH,
&
ITRNO_VALID, NPRIORF, IFORMAT, LENGTH, IH_CDP,
&
IX_TRACE, IX_THDR
REAL SAMPRAT, SOFTRLP, GEORLSP
CHARACTER CINPUT(*), CAREA(16), CLINE(16)
CHARACTER CPACKET_FILE*128, CLABEL*8, CDESC*32
IF ( NARGS .LT. 2 ) THEN
C ......... Nothing was entered on the command line
CALL U_ERR_FATAL( 'Packet file must be specified' )
ENDIF
C ..... Load the character ARRAY into a character STRING.
C ..... understand the difference.
CALL U_CARR2STR( CINPUT, CPACKET_FILE, 128 )
C ..... Open the parameter packet file, get back the ID, area, and line
C ..... STAND_ALONE was the name specified in the menu file.
CALL PKT_OPEN_LOAD( CPACKET_FILE, 'POSTSTACK_READ ', ID_PACKET,
&
CAREA, CLINE )
IF ( ID_PACKET .EQ. 0 ) CALL U_ERR_FATAL(
&
'Unable to open packet file' )
C ..... Initialize the database for this area and line. Note that CAREA
C ..... and CLINE are character arrays, not character strings.
CALL DB_INIT_LINE( CAREA, CLINE, IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_DB_ERR( IERR )
CALL U_ERR_FATAL( 'Unable to initialize the database' )
ENDIF
C ..... Get the label for the dataset from the packet file.
C ..... the packet ID is an input arg.
Other Docs
Known Problems
poststack.f482
.....
.....
.....
.....
.....
&
IMPLICIT NONE
#include "global.inc"
INTEGER ITHDR(*)
INTEGER IERR, J, IH_CDP, ID_DATASET, ITRTOTAL
Other Docs
Known Problems
poststack.f483
REAL TRACE(*)
DO 100 J=1,ITRTOTAL
C ......... This reads in a trace, given the relative position within the
C ......... file.
CALL DISKIO_GET_TR( ID_DATASET, -J, ITHDR, TRACE, IERR )
IF ( IERR .NE. 0 ) THEN
WRITE (*,*) '*** ERROR *** ', J, IERR
ELSE
WRITE (*,*) 'CDP= ', ITHDR(IH_CDP)
ENDIF
100
CONTINUE
RETURN
END
Other Docs
Known Problems
Makefile_poststack484
Makefile_poststack
##############################################################################
# Makefile for ProMAX standalone program
##############################################################################
# Program name
name = poststack
# Object files - preface any product-specific files with "$(product)/"
# The following line is for the FORTRAN above
objs = poststack_main.o poststack.o
# The following line is for the C code example below
#objs = poststack.o
# Libraries - to be searched before and after the standard ProMAX libraries
libsbefore =
libsafter =
# Standard rules to make ProMAX programs
include maxprog.make
# be quiet
.SILENT:
Other Docs
Known Problems
poststack.c485
poststack.c
/*
/*
/*
/*
/*
/*
----------------------------------------------------------------*/
poststack()
This is a stand-alone ProMAX module for demonstration of a
stand alone program that reads in data traces and headers.
----------------------------------------------------------------*/
#include "cglobal.h"
#include "cpromax.h"
#include <stdio.h>
Other Docs
*/
Known Problems
poststack.c486
/* Get the 8-character label for the dataset from the packet file. */
uParGetString( "LABEL", &dsetLabel );
/* Open the dataset, status=readonly, note we are calling a FORTRAN routine
read_only = 1;
diskio_open_( dsetLabel, &read_only, &id_dataset, &errCode );
*/
if( errCode != 0 ){
uErrFatal("Unable to open the trace dataset %s", id_dataset );
}
/* Get misc. info about the dataset */
diskio_info_( &id_dataset, &ndfiles, &iswapends,
&trtotal, &samprat, &numsmp, &nth, &maxdtr,
&maxatr, &ipsort, &ipkey, &iskey, &idtyp, &idomain,
&ntraces, &igeom_match, &itrno_valid, &npriorf, &softrlp,
&georlsp );
/*
/*
/*
/*
/*
*/
*/
*/
*/
*/
Other Docs
Known Problems
poststack.c487
Other Docs
Known Problems
vel_io.f488
vel_io.f
C ..... This is a stand alone program that shows examples on inputting and
C ..... outputting velocities to the ProMAX database
PROGRAM VEL_IO
&
&
IMPLICIT NONE
CHARACTER CX_DESC*8, CY_DESC*8, CZ_DESC*8, CTABLE_DESC*128,
CLABEL*8, CREPLY*1, CDESC*128
INTEGER MODE, IHANDLE, NFUNCTIONS, J, IERR, IRETURN, I,
LX_NAM, LX_DSC, NTABLES, ISELECT, NUMSMP, IDUMB
REAL X, SAMPRAT, RCDP, TIMEIN
LOGICAL WRITE_TABLE
CHARACTER CAREA(16), CLINE(16), CTBLTYPE(3)
Other Docs
Known Problems
vel_io.f489
&
&
Other Docs
Known Problems
vel_io.f490
TIME(2,2) = 480.0
VEL(2,2) = 480.0
TIME(3,2) = 950.0
VEL(3,2) = 950.0
TIME(4,2) = 1510.0
VEL(4,2) = 1510.0
TIME(5,2) = 1975.0
VEL(5,2) = 1975.0
TIME(1,3) = 100.0
VEL(1,3) = 100.0
TIME(2,3) = 2000.0
VEL(2,3) = 2000.0
C ......... Loop over the functions, inputting them. You could also input
C ......... each time-velocity pair independently (NUMY=1 in TBL_ADD)
DO 100 J=1,NFUNCTIONS
C ............. X is the CDP in this case
X = FLOAT( ICDP(J) )
C ............. Add the data to the table
CALL TBL_ADD( IHANDLE, X, TIME(1,J), NPAIRS(J),
&
VEL(1,J), 1 )
100
CONTINUE
Other Docs
Known Problems
vel_io.f491
&
&
CONTINUE
&
the CDP'
RCDP
the time (ms)'
TIMEIN
&
Other Docs
Known Problems
vel_io.f492
ENDIF
END
Other Docs
Known Problems
vel_io.f493
Other Docs
Known Problems
vel_io.f494
Other Docs
Known Problems
495
Other Docs
Known Problems
This is a comment
'(
name: stand_alone
label: "Test IPC tool"
value_tab: 55
;These are normal menu parameters.....
parameter: program
text: "Program executable name"
type: edit:
type_desc: (30 100 2 " Example: /usr/stof/promax/sa/my_prog )
value: "/usr/stof/exe/test_sa.exe"
mouse_text: "Type path name of program executible. If the path
doesn't start with a /, the main ProMAX executable directory is used."
parameter: max_freq
text: "Maximum frequency"
type: typein:
type_desc: ( real: 7 1.0e-5 nil )
value: 100.0
mouse_text: "Enter maximum frequency in the data."
parameter: DEBUG
text: "Debug mode?"
type: boolean:
value: nil
mouse_text: "To debug program, enter YES.
debug the program yourself"
exec_data: ("SOCKET_TOOL"
("GENERAL"
; The program parameter is the executible name of your IPC tool.
; You can hard code by specifying:
;
("program" implicit: "/home/stof/exe/mySocketTool.exe" )
("program"
implicit: (value 'program))
("DEBUG"
implicit: ( if (value 'debug) 3 0) )
; Put your other program parameters below here
("max_freq"
implicit: (value 'max_freq ))
)
)
rules: (
; put your normal rules in
)
)
Other Docs
Known Problems
IPC C Code497
IPC C Code
#include
#include
#include
#include
#include
<stdio.h>
<math.h>
"cglobal.h"
"cpromax.h"
"cSocketTool.h"
*/
see cglobal.h */
/* Sample rate */
/* Number of samples per trace */
/* Number of traces per ensemble */
/* Length of trace header in
words */
Other Docs
*/
Known Problems
IPC C Code498
/*
*/
Other Docs
Known Problems
#include "socket_tool.inc"
Other Docs
Known Problems
C ..... Open
CALL
&
IF (
&
C
C
C
C
.....
.....
.....
.....
C
C
C
C
.....
.....
.....
.....
the parameter packet file, get back the ID, area, and line
PKT_OPEN_LOAD( CPACKET_FILE, 'SOCKET_TOOL
', ID_PACKET,
CAREA, CLINE )
ID_PACKET .EQ. 0 ) CALL U_ERR_FATAL(
'Unable to open packet file' )
Initialize the database for this area and line. Note that CAREA
and CLINE are character arrays, not character strings. This
must be called in order for access to parameter files in the
database.
CALL DB_INIT_LINE( CAREA, CLINE, IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_DB_ERR( IERR )
CALL ST_ERR_FATAL( 'Unable to initialize the database' )
ENDIF
&
Other Docs
Known Problems
&
&
C
C
C
C
C
.....
.....
.....
....
C ....
C ..... Pass the buffers off to a routine where the real work is done
CALL DO_WORK_ON_TRACE( RSPACEz(IX_TRACE), RSPACEz(IX_HEADER) ,
& RSPACEz(IX_HEADER) )
C ....
Other Docs
Known Problems
Other Docs
Known Problems
Other Docs
Known Problems
;
;
("GENERAL"
The following four variables are needed by init_stand_alone() to
run the stand alone program. They are described below.
("program"
implicit: "/home/mark/amp_ratio.exe" )
("machine"
implicit: "" )
("DEBUG"
implicit: ( if (value 'DEBUG) 3 1) )
variables after here are user parameters
("GATELEN"
implicit: (value 'GATELEN))
("GATENAME" implicit: ( if (value 'time_gate_opt)
(value 'GATENAME) "NO__GATE" ))
("LOAD_HDR" implicit: ( if (value 'LOAD_HDR) 1 0 ) )
("LOAD_DB"
implicit: ( if (value 'LOAD_DB) 1 0 ) )
)
)
rules: (
(rule1 ( value 'time_gate_opt )
(do_show 'GATENAME) (do_not_show 'GATENAME))
)
)
Other Docs
Known Problems
ampRatio C Code505
ampRatio C Code
/* include ProMAX prototypes and globals */
#include "cpromax.h"
#include "cglobal.h"
#include "cSocketTool.h"
void
amp_ratio_work (float *trace, float *scratch, int nsams, int ngate,
int imin_samp, int imax_samp, float samprate, float *ratio_max, float
*ratio_time);
main (int ac, char **av)
{
int
ngate, ih_ratio_max, ih_ratio_time, load_hdr, load_opf, id_max,
id_time, ih_traceno, use_gate, itbl_handle, ih_pkey, ih_skey, iformat_pkey,
iformat_skey;
float
*scratch;
void
*gate_tbl;
void
*opf_trc, *opfPtr1, *opfPtr2;
float
char
gatelen;
*cgatename;
float
int
float
*trace;
*ithdr;
*rthdr;
Other Docs
Known Problems
ampRatio C Code506
*/
*/
*/
if (stHdrExists ("RATIOMAX")) {
if (stHdrFormat ("RATIOMAX") == HDRFLOAT)
stErrWarn ("RATIOMAX header already exists!");
else
stErrFatal ("RATIOMAX header already exists but is of wrong type!");
}
else {
ih_ratio_max = stHdrAdd ("RATIOMAX", "Time of amp ratio maximum", 1,
HDRFLOAT);
if (ih_ratio_max < 0) {
/* This should virtually never happen. */
stErrFatal ("Error adding header RATIOMAX");
}
}
if (stHdrExists ("RATIOTIM")) {
if (stHdrFormat ("RATIOTIM") == HDRFLOAT)
stErrWarn ("RATIOTIM header already exists!");
else
stErrFatal ("RATIOTIM header already exists but is of wrong type!");
}
else {
ih_ratio_time = stHdrAdd ("RATIOTIM", "Time of amp ratio maximum", 1,
HDRFLOAT);
if (ih_ratio_time < 0) {
/* This should virtually never happen. */
stErrFatal ("Error adding header RATIOTIM");
}
}
}
/* See if the user wants to load the results into the database */
load_opf = 0;
Other Docs
Known Problems
ampRatio C Code507
if (!stHdrExists ("TRACENO")) {
stErrFatal ("TRACENO not found in header");
}
/* Lock the TRC order since we will be writing to it
*/
if (!opfExists ("TRC"))
stErrFatal ("TRC database does not exist.");
opf_trc = opfLock ("TRC");
if (opf_trc==NULL )
stErrFatal ("Could not lock TRC database order.");
/* Create the new entries in the database
*/
if (!opfParmExists (opf_trc, "F_B_PICK", "RATIOMAX")) {
ierr = opfParmCreate (opf_trc, "F_B_PICK",
"RATIOMAX", "Maximuma value of amp ratio", 1, PARFLOAT);
if (ierr != 0)
stErrFatal ("Error creating database entry");
}
if (!opfParmExists (opf_trc, "F_B_PICK", "RATIOTIM")) {
ierr = opfParmCreate (opf_trc, "F_B_PICK", "RATIOTIM",
"Time of amp ration maximum", 1, PARFLOAT);
if (ierr != 0)
stErrFatal ("Error creating database entry");
}
/* Initialize the token for buffered database I/O
*/
if (use_gate) {
/* Interpolate the gate times from the table */
Other Docs
Known Problems
ampRatio C Code508
*/
if (load_opf) {
/* Flush the buffers for buffered database I/O Note that errors ony give
rise to warnings in cleanup phase. Also note that the "location" is now
0.
*/
Other Docs
Known Problems
ampRatio C Code509
if (opfCloseBufPut (opfPtr1) != 0)
stErrWarn ("Error loading data
}
if (opfCloseBufPut (opfPtr2) != 0)
stErrWarn ("Error loading data
}
opfClose (opf_trc);
{
into database.");
{
into database.");
}
stCloseSocketLink ();
}
/**
C--------------------------------------------------------------------C
C Actual work routine
C
C--------------------------------------------------------------------**/
void
amp_ratio_work (float *trace, float *scratch, int nsamps, int ngate,
int imin_samp, int imax_samp, float samprate, float
*ratio_max, float *ratio_time)
{
int
i, istart, iend, ind_max;
float
sum_above, sum_below, rabove, rbelow;
/* Set the starting and end of the zone of interest
istart = 0 - ngate;
iend = nsamps + ngate;
/* Sum the first two gates
sum_above = 0.0;
rabove = 0.0;
*/
*/
sum_below = 0.0;
rbelow = 0.0;
for (i = istart + ngate; i < istart + ngate * 2; i++)
if (i >= 0 && i < nsamps && trace[i] != 0.0) {
sum_below = sum_below + fabs (trace[i]);
rbelow = rbelow + 1.0;
}
for (i = istart + ngate; i < iend - ngate; i++) {
/* Compute the ratio */
if (sum_above > 0.0 && rabove > 0.0 && rbelow > 0.0) {
scratch[i] = (sum_below / rbelow) / (sum_above / rabove);
}
else {
scratch[i] = 0.0;
}
/* Drop a sample from each gate and add the next one
if (i - ngate >= 0) {
Other Docs
*/
Known Problems
ampRatio C Code510
Other Docs
Known Problems
&
&
&
&
&
&
&
LOGICAL USE_GATE
IF ( NARGS .LT. 2 ) THEN
C ......... Nothing was entered on the command line
CALL ST_ERR_FATAL( 'Packet file must be specified' )
ENDIF
C ..... Load the character ARRAY into a character STRING.
C
Be sure that you understand the difference.
CALL U_CARR2STR( CINPUT, CPACKET_FILE, 128 )
C ..... Open the parameter packet file, get back the ID, area, and line
Other Docs
Known Problems
&
&
C
C
C
C
.....
.....
.....
.....
',ID_PACKET,
Initialize the database for this area and line. Note that CAREA
and CLINE are character arrays, not character strings. This
must be called in order for access to parameter files in the
database.
CALL DB_INIT_LINE( CAREA, CLINE, IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_DB_ERR( IERR )
CALL ST_ERR_FATAL( 'Unable to initialize the database' )
ENDIF
.....
.....
.....
.....
Other Docs
Known Problems
&
&
C ......... There had better be two time values (upper and lower gate)
IF ( NTIMES .NE. 2 ) CALL ST_ERR_FATAL(
&
'Invalid gate (must have an upper and lower gate)' )
C ......... We will need the index of the primary and secondary key
C ......... Note: ST_ appended to header calls
CALL ST_HDR_NAMINFO( CPRIM_KEY, CDESC_DB, LENGTH,
&
IFORMAT_PKEY,
&
IH_PKEY, IERR )
IF ( IERR .NE. 0 ) CALL ST_ERR_FATAL(
&
'The primary key of the time gate (' //CPRIM_KEY
&
//') is not in the header' )
&
&
&
&
C ..... See if the user wants to load the results into the trace header
LOAD_HDR = 0
CALL EX_GETPARM( 'LOAD_HDR', 1, LOAD_HDR )
IF ( LOAD_HDR .EQ. 1 ) THEN
C ......... Add new trace header entries
CDESC_HDR = 'Maximum value of amp ratio'
CALL ST_HDR_ADD( 'RATIOMAX', CDESC_HDR, 1, IREAL4pz,
&
IH_RATIO_MAX, IERR )
IF ( IERR .NE. 0 ) THEN
IF ( IERR .EQ. IERR_HDR_EXSTpz ) THEN
C ................. That's OK, but somewhat unexpected
CALL ST_ERR_WARN(
&
'RATIOMAX already exists in header' )
ELSE
C ................. This will virtually never happen, but just in case
CALL ST_ERR_FATAL( 'Error adding header entry' )
ENDIF
ENDIF
CDESC_HDR = 'Time of amp ratio maximum'
CALL ST_HDR_ADD( 'RATIOTIM', CDESC_HDR, 1, IREAL4pz,
&
IH_RATIO_TIME, IERR )
IF ( IERR .NE. 0 ) THEN
IF ( IERR .EQ. IERR_HDR_EXSTpz ) THEN
C ................. That's OK, but somewhat unexpected
CALL ST_ERR_WARN(
&
'RATIOTIM already exists in header' )
ELSE
C ................. This will virtually never happen, but just in case
CALL ST_ERR_FATAL( 'Error adding header entry' )
ENDIF
ENDIF
Other Docs
Known Problems
ENDIF
C ..... See if the user wants to load the results into the database
LOAD_DB = 0
CALL EX_GETPARM( 'LOAD_DB ', 1, LOAD_DB )
IF ( LOAD_DB .EQ. 1 ) THEN
C ......... Open the database to store the amp ratio information
C
against trace
C ......... Note: ST_ instead of EX_ERR_FATAL
IF ( ITRNO_VALIDz .NE. 1 ) THEN
CALL ST_ERR_FATAL( 'Cannot load data into the TRC order'
&
//' without valid trace numbers (geom assigned)' )
ENDIF
C ......... We will need the index of the trace number
CALL ST_HDR_NAMINFO( 'TRACENO ', CDESC_HDR, LENGTH, IFORMAT,
&
IH_TRACENO, IERR )
IF ( IERR .NE. 0 ) CALL ST_ERR_FATAL(
&
'TRACENO not found in header' )
C ......... Lock the TRC order since we will be writing to it
C ......... Note: normal database calls
CALL DB_ORDLOCK( 'TRC', IKEY_TRC, IERR )
IF ( IERR .NE. 0 ) THEN
CALL REPORT_DB_ERR( IERR )
CALL ST_ERR_FATAL( 'Error locking TRC database' )
ENDIF
C ......... Create the new entries in the database
CDESC_DB = 'Maximum value of amp ratio'
CALL DB_PARMCRE( IKEY_TRC, '
', 'F_B_PICK', 'RATIOMAX',
&
CDESC_DB, 1, IREAL4pz, RNULLpz, IERR )
IF ( IERR .NE. 0 .AND. IERR .NE. IERR_DB_PEXSpz ) THEN
CALL REPORT_DB_ERR( IERR )
CALL ST_ERR_FATAL( 'Error creating database entry' )
ENDIF
&
Other Docs
Known Problems
C ....
IF ( USE_GATE ) THEN
C ..... Interpolate the gate times from the table
IF (IFORMAT_PKEY .EQ. IREAL4pz ) PKEYVAL= RTHDR(IH_PKEY)
IF (IFORMAT_PKEY .EQ. INT4pz ) PKEYVAL= ITHDR(IH_PKEY)
IF (IFORMAT_SKEY .EQ. IREAL4pz ) SKEYVAL= RTHDR(IH_SKEY)
IF (IFORMAT_SKEY .EQ. INT4pz ) SKEYVAL= ITHDR(IH_SKEY)
CALL INT_GET( ITBL_HANDLE, 0, 0, PKEYVAL, SKEYVAL,
&
TGATE, IERR )
IF ( IERR .NE. 0 ) CALL ST_ERR_FATAL(
&
'Error interpolating time gate' )
ELSE
C ......... Use the entire trace
TGATE(1) = 0.0
TGATE(2) = FLOAT(NUMSMPz-1) * SAMPRATz
ENDIF
C ..... Convert the time gate values to samples
IMIN_SAMP = NINT( TGATE(1) / SAMPRATz ) + 1
IMAX_SAMP = NINT( TGATE(2) / SAMPRATz ) + 1
C ..... Don't let them go out of bounds
IMIN_SAMP = MAX0( IMIN_SAMP, 1 )
IMIN_SAMP = MIN0( IMIN_SAMP, NUMSMPz )
IMAX_SAMP = MAX0( IMAX_SAMP, 1 )
IMAX_SAMP = MIN0( IMAX_SAMP, NUMSMPz )
IF ( IMIN_SAMP .GT. IMAX_SAMP ) THEN
C ......... Let's assume that they were meant to be reversed
ISAVE = IMIN_SAMP
IMIN_SAMP = IMAX_SAMP
IMAX_SAMP = ISAVE
ENDIF
C ..... Pass
CALL
&
&
&
Other Docs
Known Problems
&
&
&
ENDIF
ENDIF
C ....
C ....
C-----------------------------------------------------------------------------C
C
Actual work routine
C
C------------------------------------------------------------------------------
Other Docs
Known Problems
&
&
&
110
&
120
Other Docs
Known Problems
C
Note that we have not handled the
C ..... edge problem, we have simply made the function undefined.
DO 130 I=1,NSAMPS
IF ( I .LE. ISTART+NGATE-1 ) THEN
TRACE(I) = 0.0
ELSEIF ( I .GE. IEND-NGATE+1 ) THEN
TRACE(I) = 0.0
ELSE
TRACE(I) = SCRATCH(I)
ENDIF
130
CONTINUE
C ..... Find the maximum of the ratio function
RATIO_MAX = TRACE(IMIN_SAMP)
IND_MAX = IMIN_SAMP
DO 140 I=IMIN_SAMP,IMAX_SAMP
IF ( TRACE(I) .GT. RATIO_MAX ) THEN
IND_MAX = I
RATIO_MAX = TRACE(I)
ENDIF
140
CONTINUE
C ..... Convert the index of the maximum to time
RATIO_TIME = FLOAT( IND_MAX - 1 ) * SAMPRATE
RETURN
END
Other Docs
Known Problems
519
global.inc
global.h
Other Docs
Known Problems
global.inc520
global.inc
C-----------------------------------------------------------------------------C
C
This is the global common block for inter-tool communication of
C
processing modules that are linked into the Executive. Note that
C
all global variables end in lower case 'z', and all global parameters
C
end in lower case 'pz'.
C
C-----------------------------------------------------------------------------C ..... These are global character parameters. The common is padded to
C ..... 128 chars to facilitate addition of new parameters.
COMMON /GLOBAL_CHARcz/ CPROJz, CLINEz, CAREAz, CFLOWz,
&
CPAD_GLOBAL_CHAR
CHARACTER CPROJz*16, CLINEz*16, CAREAz*16, CFLOWz*16,
&
CPAD_GLOBAL_CHAR*64
C ..... CPROJz
- the current project name (C*16)
C ..... CLINEz
- the current line name (C*16)
C ..... CAREAz
- the current area name (C*16)
C ..... CFLOWz
- the current flow name (C*16)
C-----------------------------------------------------------------------------C ..... These are miscellaneous global parameters. The common is padded to
C ..... 16 words to facilitate addition of new parameters.
COMMON /GLOBAL_MISCcz/ EXDATUMz, VXDATUMz, IUNITSz, I3Dz,
&
IMULTCz, NTRACEz, ICDPASNz, IGEOASNz, IPAD_GLOBAL_MISC
INTEGER IUNITSz, I3Dz, IMULTCz, NTRACEz, ICDPASNz, IGEOASNz,
&
IPAD_GLOBAL_MISC(8)
REAL EXDATUMz, VXDATUMz
C ..... EXDATUMz
- Final processing datum elevation (if not variable)
C ..... VXDATUMz
- Final datum replacment velocity (if not variable)
C ..... IUNITSz
- Type of units (choices are IENGLISHpz, ISECARCpz
C .....
or IMETRICpz )
C ..... I3Dz
- 3-D flag (I3Dz=1 if data is 3-D, otherwise I3Dz=0)
C ..... IMULTCz
- Multi-component flag (=1 if data is multi-component)
C ..... NTRACEz
- Maximum sequential trace number of unstacked traces
C .....
(this is number of traces that were in the dataset
C .....
that was used to initialize the database)
C ..... ICDPASNz
- CDP bin assigned flag (=1 if CDP bins are assigned)
C ..... IGEOASNz
- Geometry-assigned flag (=1 if the geometry is assigned)
C-----------------------------------------------------------------------------C ..... These are the possible types of units:
#define IENGLISHpz 1 /* flag indicating english units */
#define IMETRICpz 3
/* flag indicating metric units */
C-----------------------------------------------------------------------------C ..... These are the global run-time parameters. The common is padded to
C ..... 32 words to facilitate addition of new parameters.
COMMON /GLOBAL_RUNTIMEcz/ SAMPRATz, NUMSMPz, IPSORTz, MAXDTRz,
&
IDTYPz, NTHz, MODEz, IOUNITz, IPKEYz, ISKEYz, IDATEz,
&
IDOMAINz, CLEANUPz, IERRORz, IGEOM_MATCHz, ITRNO_VALIDz,
&
INIT_ONLYz, IPAD_GLOBAL_RUNTIME
Other Docs
Known Problems
global.inc521
&
&
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
C-----------------------------------------------------------------------------C .....
#define
#define
#define
#define
#define
#define
These are the choices for IPSORTz, the physical primary sort flag
ICDPpz 1
/* CDP bin */
ISINpz 2
/* source index number */
IRECSLOCpz 3 /* receiver surface location */
IOFFSETpz 4 /* offset */
ICHANpz 5
/* channel number */
IUNKNOWNpz 6 /* none of the above */
C-----------------------------------------------------------------------------C .....
#define
#define
#define
#define
#define
#define
#define
#define
#define
These are the choices for IDTYPz, the primary data type:
INORMALpz 0
/* normal unstacked data */
IUP_HOLESpz 1 /* uphole data */
IUS_TRANSpz 2 /* transformed unstacked (e.g., frequency dom.) data */
IST_TRANSpz 3 /* transformed stacked (e.g., frequency domain) data */
ISTACKEDpz 7
/* normal stacked data */
ISNAPSHOTSpz 8 /* movie snapshots from finite difference modeling */
IFIELDpz 9 /* tape types should NOT overlap with primary data types */
IARCHIVEpz 10
IOTHER_TAPEpz 11
Other Docs
Known Problems
global.inc522
C-----------------------------------------------------------------------------C ..... These are the critical global parameters related to geometry.
C ..... The common is padded to 64 words to facilitate addition of new
C ..... parameters.
COMMON /GLOBAL_GEOMcz/
&
MINSLOCz, MAXSLOCz, INCSLOCz, NRCVRSz, MAXTPRz,
&
MINCDPz, MAXCDPz, INCCDPz, NUMCDPz, NTRCDPz,
&
MINSINz, MAXSINz, INCSINz, NSINSz,
MAXCPSz, NSHOTSz,
&
MINOFBz, MAXOFBz, INCOFBz, NOFBINSz, OFFBINCz, OFFMAXz,
&
MINCHNz, MAXCHNz, INCCHNz, NSLOCSz, X3DORIGz, Y3DORIGz,
&
NILINESz, MINILINz, MAXILINz, XILNENDz, YILNENDz, DCDPILNz,
&
NXLINESz, MINXLINz, MAXXLINz, XXLNENDz, YXLNENDz, DCDPXLNz,
&
IPAD_GLOBAL_GEOM
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
Other Docs
Known Problems
global.inc523
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
OFFBINCz
OFFMAXz
MINCHNz
MAXCHNz
INCCHNz
X3DORIGz
Y3DORIGz NILINESz
MINILINz
MAXILINz
XILNENDz
YILNENDz
DCDPILNz
NXLINESz
MINXLINz
MAXXLINz
XXLNENDz
YXLNENDz
DCDPXLNz
C-----------------------------------------------------------------------------C ..... These are the global parameters related to coordinates. The common
C ..... is padded to 8 words to facilitate addition of new parameters.
COMMON /GLOBAL_COORDcz/ AZIMX1z, SLOC1Xz, SLOC1Yz,
&
IPAD_GLOBAL_COORD
C ..... These are the global double precision reference coordinates. The
C ..... common is padded to 8 words to facilitate addition of new parameters.
COMMON /GLOBAL_XYcz / XREFz, YREFz, IPAD_GLOBAL_XY
REAL AZIMX1z, SLOC1Xz, SLOC1Yz
REAL*8 XREFz, YREFz
INTEGER IPAD_GLOBAL_COORD(5), IPAD_GLOBAL_XY(4)
C
C
C
C
C
.....
.....
.....
.....
.....
AZIMX1z
SLOC1Xz
SLOC1Yz
XREFz
YREFz
C-----------------------------------------------------------------------------C ..... These are the global parameters related to acquisition. The common
C ..... is padded to 32 words to facilitate addition of new parameters.
COMMON /GLOBAL_AQUIScz/ ISRCTYPz, IDATRECz, IGAINXz, PREXAMPz,
&
EARLYGz, AAXFILTz, AAXSLOPz, FREQXNz, FXNSLOPz, FREQXLz,
&
FREQXHz, FXLSLOPz, FXHSLOPz, NSRECDz, ORIGDTz, IXFORMz,
&
MANFACTz, ISERIALz, NXAUXSz, RCCONSTz, IPAD_GLOBAL_AQUIS
INTEGER ISRCTYPz, IDATRECz, IGAINXz, NSRECDz, IXFORMz, MANFACTz,
&
ISERIALz, NXAUXSz, IPAD_GLOBAL_AQUIS(12)
REAL PREXAMPz, EARLYGz, AAXFILTz, AAXSLOPz, FREQXNz, FXNSLOPz,
&
FREQXLz, FREQXHz, FXLSLOPz, FXHSLOPz, ORIGDTz, RCCONSTz
C ..... ISRCTYPz - Source type
C ..... IDATRECz - Date recorded
C ..... IGAINXz - Gain mode of field intruments
Other Docs
Known Problems
global.inc524
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
.....
PREXAMPz
EARLYGz
AAXFILTz
AAXSLOPz
FREQXNz
FXNSLOPz
FREQXLz
FREQXHz
FXLSLOPz
FXHSLOPz
NSRECDz
ORIGDTz
IXFORMz
MANFACTz
ISERIALz
NXAUXSz
RCCONSTz
These are the choices for trace type (as defined in the trace header
entry TRC_TYPE):
IAUXpz 0
/* general auxiliary trace */
ILIVEpz 1
/* live data trace */
IDEADpz 2
/* dead trace */
IDUMMYpz 3 /* dummy trace */
ITBREAKpz 4 /* time-break trace */
IUPHOLEpz 5 /* uphole trace */
ISWEEPpz 6 /* sweep trace */
ITIMINGpz 7 /* timing trace */
IWBREAKpz 8 /* water break trace */
IOTHERpz 9 /* any other trace */
IWLOGpz 10 /* well log trace */
Other Docs
Known Problems
global.inc525
C-----------------------------------------------------------------------------C .....
#define
#define
#define
#define
#define
#define
#define
#define
#define
*/
Source file:
/promax/1998.6/port/include/global.inc
Other Docs
Known Problems
cglobal.h526
cglobal.h
/* C globals for ProMAX - equivalent to global.inc */
#ifndef CGLOBAL_H
#define CGLOBAL_H
/* define logical variables as integers */
typedef int logical;
/* character globals */
typedef struct globalCharStruct {
char cproj[16]; /* current project name */
char cline[16]; /* current line name */
char carea[16]; /* current area name */
char cflow[16]; /* current flow name */
char cpad[64]; /* pad to 128 */
} GlobalChar;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalChar GLOBAL_CHARCZ;
GlobalChar *globalChar = &GLOBAL_CHARCZ;
#elif defined (CONVEX)
extern GlobalChar _global_charcz_;
GlobalChar *globalChar = &_global_charcz_;
#elif defined SOLARIS
extern GlobalChar global_charcz_;
GlobalChar *globalChar = &global_charcz_;
#else
extern GlobalChar global_charcz_;
GlobalChar *globalChar = &global_charcz_;
#endif
#else
#if defined (CRAY)
extern GlobalChar GLOBAL_CHARCZ, *globalChar;
#elif defined (CONVEX)
extern GlobalChar _global_charcz_, *globalChar;
#else
extern GlobalChar global_charcz_, *globalChar;
#endif
#endif /* DEFINE_CGLOBALS */
/* miscellaneous globals */
typedef struct globalMiscStruct {
float exdatum; /* final processing datum elevation (if not variable) */
float vxdatum; /* final datum replacement velocity (if not variable) */
int iunits; /* type of units (see choices below) */
logical i3d; /* true if data is 3-D */
logical imultc; /* true if data is multi-component */
int ntrace; /* number of traces used to initialize database */
logical icdpasn; /* true if CDP bins have been assigned */
logical igeoasn; /* true if geometry has been assigned */
Other Docs
Known Problems
cglobal.h527
Other Docs
Known Problems
cglobal.h528
} GlobalRuntime;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalRuntime GLOBAL_RUNTIMECZ;
GlobalRuntime *globalRuntime = &GLOBAL_RUNTIMECZ;
#elif defined (CONVEX)
extern GlobalRuntime _global_runtimecz_;
GlobalRuntime *globalRuntime = &_global_runtimecz_;
#elif defined SOLARIS
extern GlobalRuntime global_runtimecz_;
GlobalRuntime *globalRuntime = &global_runtimecz_;
#else
extern GlobalRuntime global_runtimecz_;
GlobalRuntime *globalRuntime = &global_runtimecz_;
#endif
#else
#if defined (CRAY)
extern GlobalRuntime GLOBAL_RUNTIMECZ, *globalRuntime;
#elif defined (CONVEX)
extern GlobalRuntime _global_runtimecz_, *globalRuntime;
#else
extern GlobalRuntime global_runtimecz_, *globalRuntime;
#endif
#endif /* DEFINE_CGLOBALS */
/* shorthand for easier typing and reading of code */
#define NUMSMPz(globalRuntime->numsmp)
#define SAMPRATz(globalRuntime->samprat)
#define NTHz(globalRuntime->nth)
#define MAXDTRz(globalRuntime->maxdtr)
/* choices for globalRuntime->ipsort - physical primary sort key */
#define ICDP 1 /* cdp bin */
#define ISIN 2 /* source index number */
#define IRECSLOC 3 /* receiver surface location */
#define IOFFSET 4 /* offset */
#define ICHAN 5 /* channel number */
#define IUNKNOWN 6 /* none of the above */
#define IILINE 7 /* 3D inline number */
#define IXLINE 8 /* 3D cross line number */
/* choices for globalRuntime->idtyp - primary data type */
#define INORMAL 0 /* normal unstacked data */
#define IUP_HOLES 1 /* uphole data */
#define IUS_TRANS 2 /* transformed unstacked (e.g., frequency domain) data */
#define IST_TRANS 3 /* transformed stacked (e.g., frequency domain) data */
#define ISTACKED 7 /* normal stacked data */
#define ISNAPSHOTS 8 /* Movie Snap shots from finite difference modeling */
/* tape types (should NOT overlap with primary data types) */
#define IFIELD 9
#define IARCHIVE 10
#define IOTHER_TAPE 11
/* globalRuntime->mode - processing executive mode */
Other Docs
Known Problems
cglobal.h529
Other Docs
Known Problems
cglobal.h530
Other Docs
Known Problems
cglobal.h531
#endif
#else
#if defined (CRAY)
extern GlobalCoord GLOBAL_COORDCZ, *globalCoord;
#elif defined (CONVEX)
extern GlobalCoord _global_coordcz_, *globalCoord;
#else
extern GlobalCoord global_coordcz_, *globalCoord;
#endif
#endif
typedef struct globalXYStruct {
double xref; /* X reference point for the line */
double yref; /* Y reference point for the line */
int ipad[4]; /* pad to 8 words */
} GlobalXY;
#ifdef DEFINE_CGLOBALS
#if defined (CRAY)
GlobalXY GLOBAL_XYCZ;
GlobalXY *globalXY = &GLOBAL_XYCZ;
#elif defined (CONVEX)
extern GlobalXY _global_xycz_;
GlobalXY *globalXY = &_global_xycz_;
#elif defined SOLARIS
extern GlobalXY global_xycz_;
GlobalXY *globalXY = &global_xycz_;
#else
extern GlobalXY global_xycz_;
GlobalXY *globalXY = &global_xycz_;
#endif
#else
#if defined (CRAY)
extern GlobalXY GLOBAL_XYCZ, *globalXY;
#elif defined (CONVEX)
extern GlobalXY _global_xycz_, *globalXY;
#else
extern GlobalXY global_xycz_, *globalXY;
#endif
#endif /* DEFINE_CGLOBALS */
/* acquisition globals */
typedef struct globalAcquisStruct {
int isrctyp; /* source type */
int idatrec; /* date recorded */
int igainx; /* gain mode of field instruments */
float prexamp; /* instrument preamp gain constant */
float earlyg; /* instrument early or initial gain */
float aaxfilt; /* instrument anti-alias filter frequency */
float aaxslop; /* instrument anti-alias filter slope */
float freqxn; /* instrument notch filter frequency */
float fxnslop; /* instrument notch filter slope */
float freqxl; /* instrument low-cut filter frequency */
Other Docs
Known Problems
cglobal.h532
Other Docs
Known Problems
cglobal.h533
Other Docs
Known Problems
cglobal.h534
#endif
#else
#if defined (CRAY)
extern GlobalSpace SPACEZ, *globalSpace;
#elif defined (CONVEX)
extern GlobalSpace _spacez_, *globalSpace;
#else
extern GlobalSpace spacez_, *globalSpace;
#endif
#endif
/* macros to assist C programmer in declaring saved parameters */
/* Note: NSAVEDPARMS must match dimension of SAVE_AR in global.inc */
#define NSAVEDPARMS 1000
#if defined (CRAY)
struct {
float buffer[NSAVEDPARMS];
} SAVED_PARMS;
#define ENDPARMS(p) } *(p)=(void*)(&SAVED_PARMS.buffer[0]);
#elif defined (CONVEX)
extern struct block {
float buffer[NSAVEDPARMS];
} _saved_parms_;
#define ENDPARMS(p) } *(p)=(void*)(&_saved_parms_.buffer[0]);
#else
extern struct {
float buffer[NSAVEDPARMS];
} saved_parms_;
#define ENDPARMS(p) } *(p)=(void*)(&saved_parms_.buffer[0]);
#endif
#define BEGINPARMS static struct { float _save1z_;
#define NPARMS(p) (1+sizeof(*p)/sizeof(float));
/* last-trace-in-ensemble flag */
#define LASTTR 1
#define NLAST 0
/* trace type */
#define IAUX 0 /* general auxiliary trace */
#define ILIVE 1 /* live data trace */
#define IDEAD 2 /* dead trace */
#define IDUMMY 3 /* dummy trace */
#define ITBREAK 4 /* time-break trace */
#define IUPHOLE 5 /* uphole trace */
#define ISWEEP 6 /* sweep trace */
#define ITIMING 7 /* timing trace */
#define IWBREAK 8 /* water break trace */
#define IOTHER 9 /* any other trace */
#define IWLOG 10 /* well log trace */
#define ICORRUPTED 11 /* corrupted header (internal use only) */
/* tool types */
#define ISIMPLE 1 /* simple (trace in, trace out) tool */
#define IENSEMBLE 2 /* ensemble tool */
Other Docs
Known Problems
cglobal.h535
#define
#define
#define
#define
#define
#define
#define
Other Docs
Known Problems
cglobal.h536
Other Docs
Known Problems
537
db_disp.f
comp_opf.menu
comp_opf.c
Other Docs
Known Problems
db_disp.f538
db_disp.f
PROGRAM DB_DISP
C ..... Utility to poke around in the database
IMPLICIT NONE
#include "global.inc"
CHARACTER CORDNAM*3, CINFO*8, CNAME*8, CREPLY*1, CWORK*144,
&
CFORMAT*9, CNULL*1
CHARACTER*8 CINFOBUF(100), CNAMEBUF(100)
CHARACTER*80 CDESCBUF(100)
CHARACTER CAREA(16), CLINE(16)
INTEGER IWORDBUF(100), IFORMBUF(100), INULLBUF(100),
&
IBUFF(100000), IERR, INUL, IKEY, LMIN, LMAX, LINC,
&
NSTORED, IGDATE, IGTIME, NGTRACE, NFOUND, I, IREPLY,
&
IRFIRST, IRLAST, IRFLAG, NVALS, IND, IRETURN, IDATEBUF(100)
REAL RBUFF(100000), RNUL, SOFTRLSE
REAL*8 RCBUFF(500)
EQUIVALENCE (INUL,RNUL)
EQUIVALENCE (IBUFF,RBUFF)
EQUIVALENCE (IBUFF,RCBUFF)
C ..... Initialize:
IKEY = 0
IERR = 0
CNULL = CHAR(0)
CINFO = '
CNAME = '
'
'
C ..... Call a crude function to let the user select an area and line
50
CALL DB_CHOOSE_AL( CAREA, CLINE, IRETURN )
C ..... If return status is not 0, act accordingly
IF ( IRETURN .EQ. 1 ) THEN
WRITE (*,*) 'No areas exist'
STOP
ELSEIF ( IRETURN .EQ. 2 ) THEN
C ......... User wants to quit
STOP
ENDIF
C ..... Initialize the area and line
CALL DB_INIT_LINE( CAREA, CLINE, IERR )
90
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
Other Docs
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
(*,*)
LIN (line)'
TRC (trace)'
SRF (surface location)'
SIN (source)'
CDP'
CHN (channel)'
start over'
Known Problems
db_disp.f539
WRITE
WRITE
WRITE
WRITE
Other Docs
(*,*)
(*,*) 'Select an option:'
(*,*)
(*,*) '1) Review ordered database global parameters'
Known Problems
db_disp.f540
WRITE
WRITE
WRITE
WRITE
WRITE
WRITE
&
=
=
=
=
',
',
',
',
LMIN
LMAX
LINC
NSTORED
&
WRITE (*,*)
WRITE (*,*) 'Infotype
Name
Length Format'
//'
Null value
Date created'
WRITE (*,*)
DO 130 I=1,NSTORED
............. Give the character name of the format
IF ( IFORMBUF(I) .EQ. INT4pz ) THEN
CFORMAT = 'INTEGER'
ELSEIF ( IFORMBUF(I) .EQ. IREAL4pz ) THEN
CFORMAT = 'REAL'
Other Docs
Known Problems
db_disp.f541
&
&
&
&
130
140
150
Other Docs
Known Problems
db_disp.f542
&
170
DO 170 I=1,NSTORED
WRITE (*,*) 'Name= ', CNAMEBUF(I),
'
Date created= ', IDATEBUF(I)
WRITE (*,'(1X,A13,A65)') 'Description: ', CDESCBUF(I)
CONTINUE
Other Docs
Known Problems
db_disp.f543
Other Docs
Known Problems
db_disp.f544
C ......... Exit
C ......... Unlock the database (call DB_ORDUNLK)
CALL DB_ORDUNLK( IKEY, IERR )
STOP
ELSE
WRITE (*,*) 'ERROR - invalid response'
ENDIF
GO TO 110
END
Other Docs
Known Problems
comp_opf.menu545
comp_opf.menu
'(
name: COMP_OPF
label: "OPF Compare for QC*"
value_tab: 50
parameter: AREA2
text: "Comparison Area name"
type: edit:
type_desc: (28 80 5 " FORMAT: string
EXAMPLE: test_area1
HELP: EMACS Editor Widget (scroll with down/up arrow keys)
CURSOR MOVEMENT: Use the arrow keys:->,<-,etc.;Point the mouse cursor,click B1
CM: Ctrl-AMove the cursor to the BEGINNING of the current line
CM: Ctrl-EMove the cursor to the END of the current line
EDITING: All keyboard entry is in 'insert' mode
E: Backspace, Delete keysDelete one character to the LEFT of the cursor
E: Ctrl-D Delete one character to the RIGHT of the cursor
E: Ctrl-KKILL to the end of the line (from the cursor)
E: Ctrl-YYANK back the contents of the kill buffer; 'Cut and
paste'; (Can move the cursor first) " 3 )
value: "test_area"
mouse_text: "Enter name of the area containing the OPF to compare. "
parameter: LINE2
text: "Comparison Line name"
type: edit:
type_desc: (28 80 5 " FORMAT: string
EXAMPLE: test_line
HELP: EMACS Editor Widget (scroll with down/up arrow keys)
CURSOR MOVEMENT: Use the arrow keys:->,<-,etc.;Point the mouse cursor,click B1
CM: Ctrl-AMove the cursor to the BEGINNING of the current line
CM: Ctrl-EMove the cursor to the END of the current line
EDITING: All keyboard entry is in 'insert' mode
E: Backspace, Delete keysDelete one character to the LEFT of the cursor
E: Ctrl-D Delete one character to the RIGHT of the cursor
E: Ctrl-KKILL to the end of the line (from the cursor)
E: Ctrl-YYANK back the contents of the kill buffer; 'Cut and
paste'; (Can move the cursor first) " 3 )
value: "test_line"
mouse_text: "Enter name of the line containing the OPF to compare. "
parameter: OPF_NAME
text: "OPF type"
type: edit:
type_desc: (28 80 5 " FORMAT: string
EXAMPLE: SIN or TRC
HELP: EMACS Editor Widget (scroll with down/up arrow keys)
CURSOR MOVEMENT: Use the arrow keys:->,<-,etc.;Point the mouse cursor,click B1
CM: Ctrl-AMove the cursor to the BEGINNING of the current line
CM: Ctrl-EMove the cursor to the END of the current line
EDITING: All keyboard entry is in 'insert' mode
E: Backspace, Delete keysDelete one character to the LEFT of the cursor
E: Ctrl-D Delete one character to the RIGHT of the cursor
E: Ctrl-KKILL to the end of the line (from the cursor)
Other Docs
Known Problems
comp_opf.menu546
E:
implicit: "STAND_ALONE")
implicit: "/promax/1998.6/rs6000/exe/comp_opf.exe")
Other Docs
%I%
%G%")
Known Problems
comp_opf.menu547
("AREA2
"
("LINE2
"
("OPF_NAME"
("PARMNAME"
("INFOTYPE"
("TOLERANC"
implicit:
implicit:
implicit:
implicit:
implicit:
implicit:
(value
(value
(value
(value
(value
(value
'AREA2
'LINE2
'OPF_NAME
'PARMNAME
'INFOTYPE
'TOLERANC
))
))
))
))
))
))
)
)
)
Other Docs
Known Problems
comp_opf.c548
comp_opf.c
/*
/*
/*
/*
/*
/*
/*
/*
/*
----------------------------------------------------------------*/
comp_opf
this is a stand-alone ProMAX module for comparing opf files
in separate areas and lines and primarily for use in QC of
promax processing modules.
original code by B. Fuller, 31-oct-94 (BOO!)
----------------------------------------------------------------*/
#include
#include
#include
#include
"cglobal.h"
"cpromax.h"
<stdio.h>
<math.h>
Other Docs
Known Problems
comp_opf.c549
uParGetString("OPF_NAME",
uParGetString("PARMNAME",
uParGetString("INFOTYPE",
uParGetFloat ("TOLERANC",
&opfName );
&parmName );
&infoType );
&tolerance );
/* initialize the global variables and open the OPF for line2 */
db_init_line_( area2, line2, &errCode );
if( errCode != 0 ){
uErrFatal("Error initializing the database for %s, %s.", area2, line2);
}
opfPntr2 = opfOpen( opfName );
if( opfPntr2 == NULL ){
uErrFatal("Error opening %s database file in %s %s", opfName, area2, line2
);
}
parmPntr2 = opfInitBufGet( opfPntr2, infoType, parmName );
if( parmPntr2 == NULL ){
uErrFatal("Error opening paramter %s in %s %s \n", parmName, area2, line2
);
}
Other Docs
Known Problems
comp_opf.c550
Other Docs
Known Problems
551
EXAMPLE.menu
Other Docs
Known Problems
EXAMPLE.menu552
EXAMPLE.menu
(
name: PROG_NAME
label: Sample ProMAX Menu
value_tab: 48
parameter: CHOOSE1
text: This is an item you can choose
type: choose:
type_desc: (
(Item 1 1 Mouse pointing help for Item 1. )
(Item 2 2 Mouse pointing help for Item 2. )
(Item 3 3 Mouse pointing help for Item 3. ) )
value: 3
mouse_text: This is the mouse pointing help you see when you point to the This
is an item you can choose text.
parameter: CHOOSE2
text: This menu entry will generate a pop choose
type: pop_choose:
type_desc: (
(Item 1 1 Mouse pointing help for Item 1. )
(Item 2 2 Mouse pointing help for Item 2. )
(Item 3 3 Mouse pointing help for Item 3. ) )
value: 3
mouse_text: This is the mouse pointing help you see when you point to the menu
line.
parameter: CIRCULAR1
text: This item rotates in a circular fashion
type: circular:
type_desc: (
(Item 1 1 Mouse pointing help for Item 1. )
(Item 2 2 Mouse pointing help for Item 2. ) )
value: 3
mouse_text: This is the mouse pointing help you see when you point to the menu
line.
parameter: SIMPLE_REAL
text: This is a simple REAL number item
type: real:
value: 1.0
mouse_text: Mouse pointing help goes here (simple reals are 10 characters wide
and have no input test limits).
parameter: FANCY_REAL
text: This is a sophisticated REAL number item
type: typein:
type_desc: ( real: 6 1.0e-4 nil )
value: 2.0
Other Docs
Known Problems
EXAMPLE.menu553
mouse_text: Mouse pointing help goes here (this real is 6 characters wide, test
limits are 1.0E-4 (lower) with no upper limit).
parameter: SIMPLE_INTEGER
text: This is a simple INTEGER number item
type: int:
value: 3
mouse_text: Mouse pointing help goes here (simple integers are 8 characters wide
and have no input test limits).
parameter: FANCY_INTEGER
text: This is a sophisticated INTEGER number item
type: typein:
type_desc: ( int: 3 nil 999999 )
value: 4
mouse_text: Mouse pointing help goes here (this integer is 8 characters wide,
test limits are 999999 (upper) with no lower limit).
parameter: BOOLEAN1
text: This is a BOOLEAN (true/false) type
type: boolean:
value: nil
mouse_text: This mouse pointing help explains the item (note: default value:
can be t (true) or nil (false).
parameter: STRING1
text: This is a STRING type
type: typein:
type_desc: (string: 30)
value: Initial default goes here
mouse_text: This mouse pointing help should normally include the input format
and an example.
parameter: EDIT_STRING
text: This is an EDITOR field type
type: edit:
type_desc: (30 80 5 Format: Enter format example here, followed by a carriage
return
Example: Enter Example here
HELP: EMACS Editor Widget (scroll with down/up arrow keys)
CURSOR MOVEMENT: Use the arrow keys:->,<-,etc.;Point the mouse cursor,click B1
CM: Ctrl-AMove the cursor to the BEGINNING of the current line
CM: Ctrl-EMove the cursor to the END of the current line
EDITING: All keyboard entry is in insert mode
E: Backspace, Delete keysDelete one character to the LEFT of the cursor
E: Ctrl-D Delete one character to the RIGHT of the cursor
E: Ctrl-KKILL to the end of the line (from the cursor)
E: Ctrl-YYANK back the contents of the kill buffer; Cut and
paste; (Can move the cursor first) 3 )
value: Initial default goes here
mouse_text: This item calls the EDIT function. The type_desc: dictates an
editor 80 characters by 5 lines (30 chars to show on the menu.
Other Docs
Known Problems
EXAMPLE.menu554
parameter: DATA_FILE
text: Used to select a trace data file
type: function:
type_desc: (dataset_list datasets)
value: no entry
selected_item: INVALID
mouse_text: Use Mouse Button 1 to select a dataset file description from the
DATASETS menu.
parameter: HEADER_SELECT
text: Used to select a trace header word
type: function:
type_desc: (header_list headers)
value: SOURCE
selected_item: Live source number
mouse_text: This option calls a C language function that presents the user
with a list of trace header words to choose from.
parameter: TIME_GATES
text: Used to select a TIME GATE parameter file
type: function:
type_desc: ((parm_list GAT) parms)
value: no entry
selected_item: * No Parameter File has been Selected *
mouse_text: Use Mouse Button 1 to select a gate parameter file from the
parameter file menu.
parameter: MUTE_FILE
text: Used to select a MUTE TIMES parameter file
type: function:
type_desc: ((parm_list MUT) parms)
value: no entry
selected_item: * No Parameter File has been Selected *
mouse_text: Use Mouse Button 1 to select a MUTE parameter file from the
parameter file menu.
parameter: VEL_FILE
text: Used to select a VELOCITY parameter file
type: function:
type_desc: ((parm_list VEL) parms)
value: no entry
selected_item: * No Parameter File has been Selected *
mouse_text: Use Mouse Button 1 to select a VELOCITY parameter file from the
parameter file menu.
parameter: HORIZON_FILE
text: Used to select an AUTOSTATICS HORIZON file
type: function:
type_desc: ((parm_list AHZ) parms)
value: no entry
selected_item: * No Parameter File has been Selected *
mouse_text: Use Mouse Button 1 to select an AUTOSTATICS HORIZON file from the
parameter file menu.
Other Docs
Known Problems
EXAMPLE.menu555
parameter: KILL_FILE
text: Used to select a TRACE KILL parameter file
type: function:
type_desc: ((parm_list KIL) parms)
value: no entry
selected_item: * No Parameter File has been Selected *
mouse_text: Use Mouse Button 1 to select a TRACE KILL parameter file from the
parameter file menu.
parameter: REVERSE_FILE
text: Used to select a TRACE REVERSAL parameter file
type: function:
type_desc: ((parm_list RVS) parms)
value: no entry
selected_item: * No Parameter File has been Selected *
mouse_text: Use Mouse Button 1 to select a TRACE REVERSAL parameter file from
the parameter file menu.
exec_data: (PROG_NAME
(GENERAL
(version implicit: @(#)EXAMPLE.menu 40.1 11/24/92 )
(PARM1 implicit: (value CHOOSE1))
(PARM2 implicit: (value CHOOSE2))
(PARM3 implicit: (value CIRCULAR1))
(PARM4 implicit: (value SIMPLE_REAL))
(PARM5 implicit: (value FANCY_REAL))
(PARM6 implicit: (value SIMPLE_INTEGER))
(PARM7 implicit: (value FANCY_INTEGER))
(PARM8 implicit: (if (value BOOLEAN1) 1 0 ))
(PARM9 implicit: (value STRING1))
(PARM10 implicit: (value EDIT_STRING))
(PARM11 implicit: (value DATA_FILE))
(PARM12 implicit: (value HEADER_SELECT))
(PARM13 implicit: (value TIME_GATES))
(PARM14 implicit: (value MUTE_FILE))
(PARM15 implicit: (value VEL_FILE))
(PARM16 implicit: (value HORIZON_FILE))
(PARM17 implicit: (value KILL_FILE))
(PARM18 implicit: (value REVERSE_FILE))
)
)
rules: (
(rule1 ( = ( value SIMPLE_INTEGER ) 3 ) (do_show FANCY_REAL) (do_not_show
FANCY_REAL))
(rule2 ( > ( value FANCY_INTEGER ) 0 ) (do_show SIMPLE_REAL) (do_not_show
SIMPLE_REAL))
(rule3 (value BOOLEAN1) (progn (do_not_show STRING1)
(do_not_show EDIT_STRING)
(do_not_show HEADER_SELECT))
(progn (do_show STRING1)
(do_show EDIT_STRING)
(do_show HEADER_SELECT)))
)
)
Other Docs
Known Problems
EXAMPLE.menu556
Other Docs
Known Problems
557
Other Docs
Error Routines502
Control Functions503
Parameter Input505
Configuration506
Database507
Memory Allocation/Management516
Trace Headers520
Trace Muting522
Velocity (Geophysical Routines)523
Vector Routines525
Parameter Lists525
Packet Files527
Parameter Interpolation528
Unix Interface529
IPCTools531
Parameter Tables537
PVM549
Matrix Functions556
Interpolation Routines559
Math Functions568
Signal Processing573
Known Problems
558
Plotting575
Data Structures576
Sorting and Searching580
Other Docs
Known Problems
Error Routines559
Error Routines
Error Routines
Other Docs
Subroutine
Description
exErrFatal
exErrMessage
exErrWarn
exErrStop
exErrHelp
uErrFatal
uErrMessage
uErrWarn
uErrStop
uErrHelp
Known Problems
Control Functions560
Control Functions
Control Functions
Other Docs
Subroutine
Description
exFillMode
exFlushMode
exPipeMode
exPushMode
exQuitMode
exTraceHeadersOnlyOK
exPanelParms
memCheckResBuf
Known Problems
Parameter Input561
Parameter Input
Parameter Input
Other Docs
Subroutine
Description
exParInfo
exParNOccurs
exParNValues
exParExists
exParFormat
exParWordsPerValue
exParGetInt
exParGetIntN
exParGetFloat
exParGetFloatN
exParGetDouble
exParGetString
exParGetStringN
getPar
exParReturnInt
exParReturnFloat
exParReturnString
Known Problems
Configuration562
Configuration
Configuration
Other Docs
Subroutine
Description
configDevList
Known Problems
Database563
Database
Database
Other Docs
Subroutine
Description
opfCreate
opfExists
opfParmInfo
opfParmFormat
opfParmLength
opfParmExists
dbCloseDomainProject
dbInitDomainProject
dbCloseEnsembleMap
dbInitEnsembleMap
dbCloseTraceMap
dbInitTraceMap
dbDomainProject
dbEnsembleMap
dbTraceMap
opfOpen
opfClose
opfPut
Known Problems
Database564
Database (Continued)
Other Docs
Subroutine
Description
opfGet
opfGetChar
opfGetAll
opfGetRange
opfLock
opfParmCreate
opfParmDelete
opfInitBufGet
opfInitBufPut
opfBufGet
opfBufPut
opfBufPutFloat
opfBufPutFloats
opfBufGetInt
opfBufPutInt
opfBufPutInts
opfBufGetDouble
opfBufPutDouble
opfBufPutDoubles
opfCloseBufGet
opfCloseBufPut
opfInitGetXY
opfCloseGetXY
opfGetXY
dbLineParmPut
getHashName
Known Problems
Database565
Database (Continued)
Subroutine
Description
getFullName
opfGetParmDesc
opfPutFloat
opfPutFloats
opfPutDouble
opfPutDoubles
opfPutInt
opfPutInts
opfPutChar
opfPutAll
opfPutRange
opfInitPseudoLine
opfDeinitPseudoLine
Other Docs
opfDomain
opfLastErr
opfLocMin
opfLocMax
opfNStored
opfParmList
dbDataInt
dbDataChar
dbCreateParmFile
dbOpenParmFile
Known Problems
Database566
Database (Continued)
Other Docs
Subroutine
Description
dbRewindParmFile
dbInitSRFtoCDPmap
dbSRFtoCDPmap
dbCDPtoSRFmap
promaxPath
scratchSpace
opfLocInc
opfSoftRlse
Returns the software release in use when the OPF was cre
opfIgDate
opfIgTime
opf
datasetHeaderFileExists
datasetReadHeaderFile
Reads the header file associated with a table into the Para
datasetWriteHeaderFile
d3CDPToXY
d3XYToCDP
d3XYToXline
d3XYToInline
d3LinesToCDP
d3CDPToLines
d3LinesToXY
Known Problems
Memory Allocation/Management567
Memory Allocation/Management
Memory Allocation/Management
Other Docs
Subroutine
Description
promaxCheckmem
promaxRealloc
promaxMalloc
promaxCalloc
promaxFree
alloc1
realloc1
free1
alloc2
free2
alloc3
free3
alloc4
free4
alloc1int
realloc1int
free1int
alloc2int
free2int
alloc3int
free3int
alloc1float
realloc1float
free1float
alloc2float
Known Problems
Memory Allocation/Management568
Other Docs
Subroutine
Description
free2float
alloc3float
free3float
alloc1double
realloc1double
free1double
alloc2double
free2double
alloc3double
free3double
alloc1complex
realloc1complex
free1complex
alloc2complex
free2complex
alloc3complex
free3complex
memAllAllocated
memArenaSize
memBytesAllocated
memAlloc1
memRealloc1
memFree1
Known Problems
Trace Headers569
Trace Headers
Trace Headers
Other Docs
Subroutine
Description
hdrInfo
hdrIndexInfo
hdrExists
hdrIndexExists
hdrDesc
hdrIndexName
hdrIndexDesc
hdrLength
hdrIndexLength
hdrFormat
hdrIndexFormat
hdrIndex
hdrAdd
hdrAddStd
defStdHdr
initStdHdr
initHdrs
initHeaderManip
headerInterpolate
headerStack
headerStackN
isStdHdrName
Known Problems
Trace Muting570
Trace Muting
Trace Muting
Other Docs
Subroutine
Description
muteAlloc
stMuteAlloc
muteFree
muteGetTimes
Gets tapered mute start and end times from trace header.
muteSetTimes
muteApply
muteSlide
muteFindZeros
muteRezero
Known Problems
Other Docs
Subroutine
Description
convertVTable
vIntStepConv
resampleTbl
convert_v_table_
tblToMatrix
matrixToTbl
smoothVelMatrix
getTblAvg
getResampTblAvg
tblMixInterpXYu
avgTbl
tblAvg
apertureVIT
apertureVID
checkMigVelTbl
interpVrmsPairsToVint
Known Problems
Vector Routines572
Vector Routines
Vector Routines
Other Docs
Subroutine
Description
vClr
Clears a vector.
vMov
vsMul
vAdd
vsMA
vFill
Known Problems
Parameter Lists573
Parameter Lists
Parameter Lists
Other Docs
Subroutine
Description
listAlloc
listAllocInts
listFree
listReady
listDescribe
listAdd
listAddInts
listFromDatabase
listToDatabase
listDecode
listInfoUpdate
listGet
listGetInts
listCheck
listCheckInts
Known Problems
Packet Files574
Packet Files
Packet Files
Other Docs
Subroutine
Description
pktFileClose
pktFileCreate
pktFileOpen
pktInit
pktGroupInit
pktOutParmN
Puts multiple values for one parameter into the packet file
pktOutInt
pktOutFloat
pktOutDouble
pktOutString
pktGetNGroups
pktGroupCopy
pktParmInfo
pktGroupInfo
pktGetMaxParmLength
Known Problems
Parameter Interpolation575
Parameter Interpolation
Parameter Interpolation
Other Docs
Subroutine
Description
intGet
intVecX1X2
intVec
interp
Known Problems
Unix Interface576
Unix Interface
Unix Interface
Other Docs
Subroutine
Description
maybeSearchPath
promaxHostPath
promaxPathName
promaxPath
promax_path_
promaxHostExtPath
promaxExtPath
promaxLinePath
promaxFlowPath
diskAvail
cpusec
cputime
wallsec
walltime
Known Problems
IPC Tools577
IPC Tools
IPC Tools
Other Docs
Subroutine
Description
isParallelTool
pstConnectToServer
stConnectToServer
stSetToolName
stGetTrace
stEOFReached
stGetEnsemble
pstGetEnsemble
stPutTrace
stPutEnsemble
pstPutEnsemble
stCloseSocketLink
stStopFlow
stPassSocketLink
Closes the socket link to the ProMAX flow, but has the flo
pass traces so the flow continues without this tool.
stEndInitialization
stInputTool
stEnableExitContinue
stGetStdHdr
stHdrAdd
stHdrIndexName
stHdrAddStd
stHdrExists
stHdrDesc
stHdrIndex
Known Problems
IPC Tools578
Other Docs
Subroutine
Description
stHdrLength
stHdrFormat
stSetOutPanels
stSetPanels
stGetPanel
stPutPanel
stErrFatal
stErrMessage
stErrWarn
stErrHelp
stCheckConnection
stSetDiskIter
Causes Disk Data Input to iterate over the list of input tra
stStatMemReserve
Tells the executive how much memory the IPC tools will
calls increment the memory usage.
st_connect_to_server_
st_set_tool_name_
st_get_trace_
st_eof_reached_
st_get_ensemble_
st_put_trace_
st_put_ensemble_
Known Problems
IPC Tools579
Other Docs
Subroutine
Description
st_close_socket_link_
st_end_init_
st_input_tool_
st_hdr_add_
st_hdr_std_add_
st_set_panels_
st_get_panel_
st_put_panel_
Known Problems
Parameter Tables580
Parameter Tables
Parameter Tables
Other Docs
Subroutine
Description
tblAllocate
tblAllocTb3
tblAllocTmp
tblFree
tblFetchTb3
tblSetExtrap
tblResolveX1X2
tblAddXY
tblAddXYs
tblGetX
tblGetEnsemble
tblCopy
Copies all groups from tbl2 to tbl1. tbl1 does not have to
tblRMStoDIP
tblGetXYs
Gets X-Y-Z group from a table. This routine does not gua
functions are retrieved in order of increasing X.
tblDeleteXY
tblDeleteX
tblClear
tblInterpXY
tblInterpXYu
dbTblUpdate
tblDescFromDatabase
Known Problems
Parameter Tables581
Other Docs
Subroutine
Description
tblGetType
tblSetType
tblFromDatabase
tblToDatabaseHashName
tblToDatabase
tblHeaderFileExists
tblReadHeaderFile
Reads the header file associated with a table into the Para
tblWriteHeaderFile
tblFromVelPar
tblXMin
tblXMax
tblMinMax
tblX1Min
tblX1Max
tblX2Min
tblX2Max
tblYMin
tblYMax
tblZMax
tblZMin
tblCountX
tblCountMaxY
tblCountZ
Known Problems
Parameter Tables582
Other Docs
Subroutine
Description
tblDesc
tblDescX
tblDescY
tblDescZ
tblEqual
tblSetYZ
tblDeleteYZ
tblDelete
tblInterpZ
tblIndexX
tblGetYZ
tb3Alloc
tb3Free
Frees a table.
tb3SetData
tb3SetYZ
tb3SetExtrapY
tb3GetTri
tb3GetData
tb3GetYZ
tb3GetZ
tb3GetExtrapY
tb3InterpZ
tb3DeleteData
tb3DeleteYZ
tb3Delete
tb3CleanData
tb3CleanYZ
Known Problems
Parameter Tables583
Other Docs
Subroutine
Description
tb3NearestX
tb3NearestY
tb3UniformY
tb3CountX
tb3CountY
tb3CountZ
tb3CountMaxY
tb3DeltaY
tb3FirstY
tb3IndexX
tb3IndexY
tb3HasX
tb3HasY
tb3InsideX
tb3InsideY
tb3InsideMinY
tb3InsideMaxY
tb3InsideLinY
tb3MinMax
makeSamples
killSamples
Frees samples.
sortSamples
removeDuplicateSamples
uniformSamples
Known Problems
Parameter Tables584
Other Docs
Subroutine
Description
setSample
deleteSample
findSample
locateSample
makeNode
killNode
makeSortedNodes
killSortedNodes
findNode
initNodeState
cleanNodes
makeTempBoundaryNodes
killTempBoundaryNodes
interpNode
makeInterpABC
updateInterpNodes
makeInterp
killInterp
updateInterp
Known Problems
PVM585
PVM
PVM
Other Docs
Subroutine
Description
pvm_pvmd
pvm_rMinContext
pvm_rMaxContext
pvm_rMinMsgtag
pvm_rMaxMsgtag
pvm_rmsgtomsg
pvm_rnewContext
pvm_rcurrentContext
pvm_rsetContext
pvm_rbufinfo
pvm_rsend
pvm_rmcast
pvm_rbcast
pvm_rrecv
pvm_rnrecv
Non-blocking receive
pvm_rrecvm
pvm_rnrecvm
pvm_rprobe
pvm_rprobem
pvm_crecv
Known Problems
PVM586
PVM (Continued)
Other Docs
Subroutine
Description
pvm_rcrecv
pvm_rcrecvm
pvm_rmrecv
pvm_rmnrecv
pvm_rcmrecv
packenvstring
getenvstring
parenviron
initPvmtool
setPvmtoolType
execPvmtool
endPvmtool
Tells exec that this tool has finished, and leaves PVM
ptAtEOF
ptGetTrace
ptPutTrace
ptGetEnsemble
ptPutEnsemble
ptSetPanels
ptSetOutPanels
ptGetPanel
ptPutPanel
ptSndPromaxHeader
Known Problems
PVM587
PVM (Continued)
Other Docs
Subroutine
Description
ptRcvPromaxHeader
ptSndPromaxGlobals
ptRcvPromaxGlobals
ptSndPromaxToolType
ptRcvPromaxToolType
dbInitLine
rcvProtocolInfo
rcvPacketFile
sndDone
socket_send
socket_recv
unixSocketConnect
inetSocketConnect
pkPromaxHeader
upkPromaxHeader
pkGlobalAcquis
upkGlobalAcquis
pkGlobalChar
upkGlobalChar
pkGlobalCoord
upkGlobalCoord
pkGlobalGeom
upkGlobalGeom
pkGlobalMisc
upkGlobalMisc
pkGlobalRuntime
upkGlobalRuntime
pkGlobalXY
upkGlobalXY
Known Problems
Matrix Functions588
Matrix Functions
Matrix Functions
Other Docs
Subroutine
Description
dgefa
dgeco
dgesl
sgefa
sgeco
sgesl
sqrdc
sqrsl
sqrst
stoepd
tridif
vanded
vandef
isamax
sasum
saxpy
scopy
sdot
Known Problems
Matrix Functions589
Other Docs
Subroutine
Description
snrm2
sscal
sswap
Known Problems
Interpolation Routines590
Interpolation Routines
Interpolation Routines
Other Docs
Subroutine
Description
cmonot
cakima
csplin
dsinc
fsinc
intcub
intl2b
intl2bx
intl2by
intlin
ints8c
ints8r
intt8c
intt8r
mksinc
yclip
yxtoxy
tinAlloc
tinFree
tinAdd
tinAddWithData
Known Problems
Interpolation Routines591
Other Docs
Subroutine
Description
tinData
tinDelete
tinInterp
tinInterpRange
tinInterpZ
tinTri
interp0
interp1
makeNodeData
makeTempNodeData
deleteNode
killNodeData
naborNodes
makeGradients
shfs8r
triAlloc
triFree
Frees a triangulation
triAddNode
triDeleteNode
triNearestNode
triNearestNodes
triLocatePoint
triBaryCoords
triAddTempBoundaryNode
triTempBoundaryNode
triIsBoundaryNode
triIsTempBoundaryNode
Known Problems
Interpolation Routines592
Other Docs
Subroutine
Description
insertNodeBefore
killNode
makeNabor
makeNaborAfter
killNabor
naborForNode
makeNodeInside
makeNodeOutside
makeNodeOnLine
makeNodeOffLine
afterMakeNode
beforeKillNodeInside
beforeKillNodeOutside
killNodeInside
killNodeOutside
killTempBoundaryNodes
killNodeOnLine
killNodeOffLine
oppositeNode
swapTest
Known Problems
Interpolation Routines593
Other Docs
Subroutine
Description
swapTestDelete
swapEdge
locatePoint
locateOutside
visibleNodes
otherNodesColinear
circum
nodeInCircum
nodeInTri
perturb
checkNode
checkTri
ct2Init
ct2Transform
ress8c
ress8r
Known Problems
Math Functions594
Math Functions
Math Functions
Other Docs
Subroutine
Description
tokensCreate
tokensCompress
tokenInt
tokenPairInt
tokenReplicatedInt
tokenIteratedInt
tokenDecodeInts
tokenFloat
tokenPairFloat
tokenReplicatedFloat
tokenIteratedFloat
tokenDecodeFloats
tioOpen
tioOpenU
tioClose
stateFromHandle
tioPrintOpenFiles
tioSetSwapflag
tioUnsetSwapflag
tioReadSwapflag
tioResizeBuff
Known Problems
Math Functions595
Other Docs
Subroutine
Description
tioEof
tioSync
tioSetLock
tioCheckLock
tioFcntl
airya
airyap
airyb
airybp
idamax
dasum
daxpy
dcopy
ddot
dnrm2
dscal
dswap
frannor
srannor
franuni
sranuni
quest
questalloc
questupdate
questfree
Known Problems
Signal Processing596
Signal Processing
Signal Processing
Other Docs
Subroutine
Description
antialias
bfdesign
bfhighpass
bflowpass
hankelalloc
hankelfree
hankel0
hankel1
hilbert
holbergd1
mkdiff
mkhdiff
abelalloc
abelfree
abel
xcor
conv
npfa
Returns smallest valid n not less than nmin for prime fact
npfao
npfar
npfaro
pfa2cc
pfa2cr
pfa2rc
Known Problems
Signal Processing597
Other Docs
Subroutine
Description
pfacc
pfacr
pfamcc
pfarc
Known Problems
Plotting598
Plotting
Plotting
Other Docs
Subroutine
Description
scaxis
pp1d
pplot1
Known Problems
Data Structures599
Data Structures
Data Structures
Other Docs
Subroutine
Description
heapFree
heapSetGrow
heapIsEmpty
heapCount
heapInsert
heapRemove
heapDelete
heapReSort
llAllocNode
llFreeNode
llInit
llEmpty
llInsert
llAppend
llDelete
llGet
llNext
llFree
queueAlloc
queueFree
Frees a queue
queueEmpty
queueAdd
queuePop
queueGet
queueCount
dequeAlloc
dequeFree
Frees a deque
dequeEmpty
Known Problems
Data Structures600
Other Docs
Subroutine
Description
dequeAdd
dequePush
dequePop
dequeGet
dequeCount
stackAlloc
stackFree
Frees a stack
stackEmpty
stackPush
stackPop
stackGet
stackCount
pqFree
pqSetGrow
pqIsEmpty
pqCount
pqInsert
pqRemove
bmalloc
bmfree
bmread
bmwrite
rbtFree
rbtFind
Finds data
rbtMin
rbtMax
rbtAfter
rbtBefore
rbtInsert
Inserts data into tree. If the same data already exists in tre
is inserted.
Known Problems
Data Structures601
Other Docs
Subroutine
Description
rbtInsertUnique
rbtDelete
Known Problems
Other Docs
Subroutine
Description
hpsort
Sorts an array so that a[0] <= a[1] <= ... <= a[n-1]
qkipart
qkiinss
qkisort
qkifind
qkpart
qkinss
qksort
Sorts an array such that a[0] <= a[1] <= ... <= a[n-1]
qkfind
xindex
Known Problems
603
Other Docs
Area/Line(Survey)/Flow584
Configuration589
Database Orders589
Domain Mapping592
Miscellaneous 1593
Trace I/O594
Trace Executive596
Trace Headers596
Memory Management597
Mute/Kill599
Statics600
Summing600
Error Routines600
Parameter Tables604
Tables Obsolete608
Parameter Interpolation608
Parameter Lists610
String Decoding613
Miscellaneous 2614
Known Problems
604
Other Docs
Parameter Input618
Packet Files619
Character Routines621
Seg-Y Disk622
Geophysical Routines622
Signal Processing627
Disk I/O634
SEG Vector Routines636
Resource Reporting642
UNIX Interface643
Known Problems
Area/Line(Survey)/Flow605
Area/Line(Survey)/Flow
Area/Line(Survey)/Flow
Other Docs
Subroutine
Description
DB_AREACOUNT
DB_AREALIST
DB_CREATE_AREA
DB_DELETE_AREA
DB_MOVE_AREA
DB_COPY_AREA
DB_LINECOUNT
DB_LINELIST
DB_CREATE_LINE
DB_DELETE_LINE
DB_COPY_LINE
DB_MOVE_LINE
DB_INIT_LINE
DB_FLOWCOUNT
DB_FLOWLIST
DB_CREATE_FLOW
DB_DELETE_FLOW
Deletes a flow
DB_COPY_FLOW
DB_MOVE_FLOW
DB_DATACOUNT
DB_PARMCOUNT
DB_TBL_COUNT
Known Problems
Area/Line(Survey)/Flow606
Area/Line(Survey)/Flow (Continued)
Other Docs
Subroutine
Description
DB_FOREIGN_COUNT
DB_RE_FILE_COUNT
DB_LIST_COUNT
DB_DATALIST
DB_PARMLIST
DB_TBL_LIST
DB_FOREIGN_LIST
DB_RE_FILE_LIST
DB_LIST_LIST
DB_DELETE_DATA
DB_INIT_DATA
DB_MOVE_DATA
DB_COPY_DATA
DB_DELETE_PARM
DB_INIT_PARM
DB_MOVE_PARM
DB_COPY_PARM
DB_THDRCOUNT
DB_THDRCOUNT_STK
DB_THDRLIST
Known Problems
Area/Line(Survey)/Flow607
Area/Line(Survey)/Flow (Continued)
Other Docs
Subroutine
Description
DB_THDRLIST_STK
DB_DATA_INFO
DB_INIT_CHECK
Known Problems
Configuration608
Configuration
Configuration
Other Docs
Subroutine
Description
CONFIG_GET_INT
CONFIG_GET_FLOAT
CONFIG_GET_STR
CONFIG_INFO
CONFIG_DEV_COUNT
CONFIG_DEV_LIST
Known Problems
Database Orders609
Database Orders
Database Orders
Other Docs
Subroutine
Description
LINEDB_PARMPUT
DB_ORDLIST
DB_ORDCRE
DB_ORD_MINMAX
DB_ORDINFO
DB_ORDPARM
DB_ORDOPEN
DB_ORDLOCK
DB_ORDCLOSE
DB_ORDUNLK
DB_PARMCRE
DB_PARMINFO
DB_PARMPUT
DB_PARMGET
DB_PARMDEL
DB_INFOLIST
DB_INFOTYPS
DB_ORDADD
DB_BUFFRDPUT
Known Problems
Database Orders610
Other Docs
Subroutine
Description
DB_BUFFRDGET
DB_FIELD2NAMES
Known Problems
Domain Mapping611
Domain Mapping
Domain Mapping
Subroutine
Description
DB_ENSEMBLE_MAP
DB_TRACE_MAP
DOMAIN_PROJECT
Other Docs
Known Problems
Miscellaneous 1612
Miscellaneous 1
Miscellaneous 1
Subroutine
Description
DB_FILNAME
DB_GLOBAL_GETPATH
DB_MISC_FNAME
DB_TBL_GET
DB_LIST_GET
DB_TBL_PUT
DB_LIST_PUT
Other Docs
DB_CHOOSE_AL
Prompts the user to select an area and line via I/O to stand
DB_CHOOSE_DATA
D3_CDP_TO_XY
D3_XY_TO_CDP
D3_XY_TO_XLINE
D3_XY_TO_INLINE
D3_LINES_TO_CDP
D3_CDP_TO_LINES
Known Problems
Trace I/O613
Trace I/O
Trace I/O
Other Docs
Subroutine
Description
DISKIO_GET_TR
DISKIO_GET_HDR
DISKIO_PUT_HDR
DISKIO_CLOSE
DISKIO_OPEN
DISKIO_CREATE
DISKIO_GET_NDFILES
DISKIO_DESC_GET
DATASET_INFO_ALL
DATASET_INFO
DISKIO_THDR_SETUP
Creates all of the trace header words that exist in the data
map of header words from how they existed on disk to how
exist
Known Problems
Trace Executive614
Trace Executive
Trace Executive
Other Docs
Subroutine
Description
EX_PANEL_PARMS
EX_BUFF_PARMS
EX_SET_DISKITER
Causes Disk Data Input to iterate over the list of input tra
Known Problems
Trace Headers615
Trace Headers
Trace Headers
Other Docs
Subroutine
Description
HDR_ADD
U_HDR_DELETE
HDR_DELETE_UPDATE
HDR_NAMINFO
HDR_INDINFO
HDR_STD_ADD
HDR_STD_INIT_VALS
IS_STD_HDR_NAME
EX_GET_INTKEY
EX_GET_REALKEY
EX_HDR_DELETE
KILL_TRACE
Known Problems
Memory Management616
Memory Management
Memory Management
Other Docs
Subroutine
Description
BV_FREE
BV_PUT
BV_GET
BV_SORT
BV_REORDER
MEM_RESBUFF
MEM_FREEBUFF
MEM_FREEBUFF_ALL
MEM_GROWBUFF
MEM_TRAP
Known Problems
Mute/Kill617
Mute/Kill
Mute/Kill
Other Docs
Subroutine
Description
REMUTE_INIT
REMUTE
RESET_MUTES
REMUTE_CHANGE
Known Problems
Statics618
Statics
Statics
Other Docs
Subroutine
Description
STAT_SHIFT
FRAC_STAT_APPLY
Known Problems
Summing619
Summing
Summing
Other Docs
Subroutine
Description
AT_WMEAN
AT_MEAN
HRZ_SMOOTH
Known Problems
Error Routines620
Error Routines
Error Routines
Other Docs
Subroutine
Description
REPORT_PROMAX_ERR
U_ERR_STOP
U_ERR_FATAL
U_ERR_POPWARN
U_ERR_WARN
U_ERR_HELP
RM_SCRATCH_FILE
U_ERR_SUPPRESS_WAR
N
EX_ERR_RESTART
EX_ERR_STOP
EX_ERR_FATAL
EX_ERR_POPWARN
Known Problems
Error Routines621
Other Docs
Subroutine
Description
EX_ERR_WARN
EX_ERR_MSG
EX_ERR_HELP
Known Problems
Parameter Tables622
Parameter Tables
Parameter Tables
Other Docs
Subroutine
Description
TBL_VAL_DECODE
TBL_GATE_DECODE
TBL_VEL_DECODE
TBL_ALLOCATE
TBL_ALLOC_TMP
TBL_FETCH_TB3
TBL_SET_EXTRAP
TBL_RESOLVE_X1_X2
TBL_ADD_XY
TBL_ADD_XYS
TBL_GET_X
TBL_GET_XYS
TBL_DELETE_XY
TBL_DELETE_X
TBL_COPY
Copies all groups from tbl2 to tbl1. tbl1 does not have to
TBL_CLEAR
TBL_INTERP_XY
TBL_INTERP_XY_U
TBL_FROM_VEL_PAR
TBL_X_MIN
TBL_X_MAX
TBL_MIN_MAX
TBL_X1_MIN
Known Problems
Parameter Tables623
Other Docs
Subroutine
Description
TBL_X1_MAX
TBL_X2_MIN
TBL_X2_MAX
TBL_Y_MIN
TBL_Y_MAX
TBL_Z_MIN
TBL_Z_MAX
TBL_COUNT_X
TBL_COUNT_MAX_Y
TBL_COUNT_Z
TBL_DESC
TBL_TO_DATABASE
TBL_DESC_FROM_DB
TBL_SET_YZ
TBL_DELETE_YZ
TBL_DELETE_POS_
TBL_INTERP_Z
TBL_INDEX_X
TBL_GET_YZ
EX_TBL_BUILD
Known Problems
Tables Obsolete624
Tables Obsolete
Tables Obsolete
Other Docs
Subroutine
Description
TBL_VAL_DECODE
TBL_GATE_DECODE
TBL_VEL_DECODE
Known Problems
Parameter Interpolation625
Parameter Interpolation
Parameter Interpolation
Subroutine
Description
INT_GET
INT_VEC
See also:
TBL_OPEN,TBL_WRITE,TBL_CLOSE,TBL_INIT,TBL
ADD,
TBL_GET,TBL_DELETE,TBL_END,TBL_FREE,INT_
INT_PS_KEYS
Other Docs
Known Problems
Parameter Lists626
Parameter Lists
Parameter Lists
Other Docs
Subroutine
Description
LIST_INIT_INTS
LIST_INIT
Initializes a totally new list for use with floating point val
LIST_INFO
LIST_DESC_REPLACE
LIST_FREE
LIST_ADD
LIST_DELETE
LIST_END
LIST_CHECK
LIST_LEVEL_CHECK
LIST_GET
LIST_DECODE
LIST_SORT
LIST_BV_SORT
LIST_SELECT
Known Problems
Parameter Lists627
Other Docs
Subroutine
Description
LIST_GL_GRAB
LIST_BUILD
Known Problems
String Decoding628
String Decoding
String Decoding
Other Docs
Subroutine
Description
PAIR_DECODE
FLOAT_DECODE
DECODE_PREP
FLOAT_MAX_DECODE
HDR_LIST_DECODE
Known Problems
Miscellaneous 2629
Miscellaneous 2
Miscellaneous 2
Subroutine
Description
PROMAX_PATH
REGEXP_MATCH
VAX_TO_IEEE
IEEE_TO_VAX
CONVEX_TO_IEEE
IEEE_TO_CONVEX
CONVEX64_TO_IEEE
IEEE_TO_CONVEX64
HEAPSORT
HEAPSORT2
HEAPSORT_INT
HEAPSORT2_INT
IMEDIAN
ISWAP
U_DOUBLE2INT
U_DOUBLELOAD
U_DOUBLE2REAL
Other Docs
Known Problems
Miscellaneous 2630
Miscellaneous 2 (Continued)
Other Docs
Subroutine
Description
U_SWAPENDS4
U_SWAPMOVE4
U_SWAPENDS2
U_SWAPMOVE2
U_SWAPENDS8
U_SWAPMOVE8
QUAD_INTERP
FIND_NEAR_IVAL
FIND_NEAR_RVAL
Known Problems
Parameter Input631
Parameter Input
Parameter Input
Other Docs
Subroutine
Description
EX_PARMINFO
U_PARMINFO
EX_PARMINFO_GRP
EX_GETPARM
EX_CGETPARM
U_GETPARM
U_CGETPARM
EX_GETPARM_GRP
EX_GRP_OCCUR
EX_PARM_OCCUR
EX_PARM_OCCUR_GRP
Known Problems
Packet Files632
Packet Files
Packet Files
Other Docs
Subroutine
Description
PKT_ENDSWAP
PKT_HANDLE
PKT_INIT
PKT_GROUPINIT
PKT_OUTPARM
PKT_FILCLOSE
PKT_FILOPEN
PKT_TOOLNAM
PKT_LOAD
PKT_GET_NGROUPS
PKT_GROUPINFO
PKT_PINFO
PKT_GET_PARM
PKT_OPEN_LOAD
PKT_COPY
PKT_SETID
PKT_GETID
Known Problems
Character Routines633
Character Routines
Character Routines
Other Docs
Subroutine
Description
PROMAX_SEGY_OPEN
PROMAX_SEGY_CLOSE
PROMAX_SEGY_INIT
PROMAX_SEGY_RINIT
PROMAX_SEGY_WRITE
PROMAX_SEGY_READ
Known Problems
Seg-Y Disk634
Seg-Y Disk
Seg-Y Disk
Other Docs
Subroutine
Description
PROMAX_SEGY_OPEN
PROMAX_SEGY_CLOSE
PROMAX_SEGY_INIT
PROMAX_SEGY_RINIT
PROMAX_SEGY_WRITE
PROMAX_SEGY_READ
Known Problems
Geophysical Routines635
Geophysical Routines
Geophysical Routines
Other Docs
Subroutine
Description
STAT_AGC_RUNAVG
STAT_AGC_RUNAVG1
MEDIAN_SMOOTH
RAGC_TRACE
AGC_TRACE
CONVERT_V_TABLE
INT_MIX_VEC
OPERDECON
MEMCOF
DECON_WORK_TIME
NMO_APPLY
NMO_UNAPPLY
SPLIN1
Known Problems
Geophysical Routines636
Other Docs
Subroutine
Description
SPLIN2
Inputs data X,Y pairs in XARR and YARR and the secon
Y2ARR, and outputs a Y value (ANS) for X
SPLINE1
SYNTRC
TRGEN
CONV_JC
QUAD
PHASOR
LOWPASS
ORMSBAND
POLDIV
GEOPH
RICKER
GET_RICKER_LEN
BUTTERLP
KLAUDER
WAVTAPER
CMPLX_FILTER_WORK
FGEN
FGEN_BW
TD_FILTER
FD_FILTER
FILTER_WORK
Known Problems
Signal Processing637
Signal Processing
Signal Processing
Subroutine
Description
CRFFT
F_AUTO_COR
GET_NFFT
MEMSPECT
MIN_PHZ_GEN
PHASEFILTER
RCFFT
EUREKA
RMEDIAN
HILBRT_FILT
COVARY
Other Docs
Known Problems
Signal Processing638
Description
PICK_CORR
RANDOM_VALS
FILT_SPIKE
MEAMGVZ
DECON_APPLY
FILT_2D_HORZ
FILT_2D_W_HORZ
FILT_2D_C_HORZ
FILT_2D
FILT_2D_SLOW
FILT_2D_W
FILT_2D_W_SLOW
FILT_2D_C
WAT_MEAN
Other Docs
Known Problems
Signal Processing639
Description
MED_TRACE_AMP
Other Docs
GATE_AMP_EST
MIN_PHZ_EQV
BOXCAR_SMOOTH
TRIANG_SMOOTH
BOXCAR_FILTER
TRIANG_FILTER
NORM_TO_ONE
DC_FILTER
WINDOW
Known Problems
Disk I/O640
Disk I/O
Disk I/O
Other Docs
Subroutine
Description
FILE_OPEN
FILE_CLOSE
FILE_READ
FILE_WRITE
FILE_SEEK
FILE_CHECK
TIO_OPEN
TIO_OPENU
TIO_CLOSE
TIO_SET_SWAPFLAG
TIO_READ_SWAPFLAG
CHAR_WRITE
TIO_SYNC
TIO_SET_LOCK
TIO_CHECK_LOCK
TIO_FCNTL
Known Problems
Description
ACOR
ACORF
ACORT
ASPEC
BLKMAN
CCOR
CCORF
CCORT
CDOTPR
CFFT
CFFTB
CFFTSC
COHER
CONV
CRVADD
CRVDIV
CRVMUL
CRVSUB
CSPEC
CVABS
CVADD
CVCMA
CVCMPX
CVCMUL
CVCONJ
CVDIV
CVEXP
CVEXPM
Other Docs
Known Problems
Description
CVFILL
CVMA
CVMAGS
CVMGSA
CVMOV
CVMUL
CVNEG
CVPHAS
CVRCIP
CVSQRT
CVSUB
DEQ22
DESAMP
DOTPR
FLNZ
HAMM
HANN
HIST
LVEQ
LVGE
LVGT
LVLE
LVLT
LVNE
LVNOT
MAXMGV
MAXV
MINMGV
MINV
MVE
Other Docs
Known Problems
Description
MVEMG
MVESQ
MVESSQ
NZCROS
POLAR
RECT
RFFT
RFFTB
RFFTSC
RMVESQ
SVDIV
SVE
SVEMG
SVESQ
SVESSQ
TCONVL
TRANS
VAAM
VABMRG
VABS
VADD
VAIMAG
VAINT
VAM
VAMERG
VASBM
VASM
VATAN
VATAN2
VAVEXP
Other Docs
Known Problems
Description
VAVLIN
VCLIP
VCLR
VCMERG
VCMPRS
VCOS
VDBCON
VDIV
VDIVZ
VERROR
VEXP
VEXP10
VFILL
VFILL8
VFLOAT
VFLOT2
VFRAC
VGATHR
VGEN
VGENP
VICLIP
VINDEX
VINT
VINT2
VINTB
VLINT
VLMERG
VLOG
VLOG10
VLOGZ
Other Docs
Known Problems
Description
VMA
VMAX
VMAXMG
VMIN
VMINMG
VMMA
VMMSB
VMOV
VMSA
VMSB
VMUL
VNABS
VNEG
VNINT
VNINT2
VPMERG
VPOLY
VPYTHG
VQINT
VRAMP
VREAL
VRECIP
VRSUM
VRVRS
VSADD
VSBM
VSBSBM
VSBSM
VSCATR
VSDIV
Other Docs
Known Problems
Description
VSIMPS
VSIN
VSMA
VSMSA
VSMSB
VSMUL
VSQ
VSQRT
VSQRTZ
VSSQ
VSUB
VSWAP
VTAN
VTHR
VTHRSC
VTMERG
VTRAPZ
VXCS
WIENER
VCHARMOV
Other Docs
CVMAG
VIRAMP
Known Problems
Resource Reporting647
Resource Reporting
Resource Reporting
Other Docs
Subroutine
Description
U_STATMEM_RESERVE
U_DYNMEM_RESERVE
U_RESERVE
Known Problems
UNIX Interface648
UNIX Interface
UNIX Interface
Subroutine
Description
C_FILECHECK
C_DIRCHECK
DISK_SPACE_SCRATCH
DISK_SPACE_ADDL
SPAWN
ALT_SHELL
C_RWNFLAG
C_RONFLAG
C_WONFLAG
C_RWOFLAG
C_ROOFLAG
C_WOOFLAG
C_RWRRMODE
C_RWXMODE
C_RWXNMODE
C_CHARTIME
C_TIME_CARR
C_TIMES
C_TIME
C_UTIME
Other Docs
C_TMPNAM
SHELL_COMMAND
SHELL_COMM_STAT
C_SYSTYPE
CHTIME
Known Problems
UNIX Interface649
Other Docs
Subroutine
Description
CHDATE
UNIX_COM
Known Problems
UNIX Interface650
Other Docs
Known Problems
Index651
Index
Symbols
$PROMAX_HOME
.inc file
.promax
_mem
A
aliases
alloc
Alternate Executive
aman
amp_ratio (IPC FORTRAN example)
amp_ratio menu code (IPC example)
amp_ratio.f
amp_ratio.inc
amp_ratio.menu
ampRatio (IPC C example)
ampRatio.c
area, line, flow
FORTRAN subroutines
areas
atopdir
AVO ensemble tools
avo.f
avo.inc
avo.menu
avoC.c
C
C environment
C library summary
C programming examples
C structure names
canned command sequence (CCS)
cglobal.h (global include file example)
cglobal.h (include file example)
character routines (FORTRAN)
cleanup condition
Other Docs
coding standards
C
FORTRAN
overview
common blocks
communication
inter-process
trace headers
comp_opf.c
comp_opf.menu
complex tools
examples
options
configuration
C subroutines
FORTRAN subroutines
control functions (C)
converting to new system
cpromax.h
ctopdir
customizing the system
D
data structures (C)
database
C subroutines
OPF examples
orders (FORTRAN subroutines)
overview
db_disp.f
dbx
debugging
defun
Delaunay triangles
deque
directory
hierarchy
Landmark version
machine-dependent
Makefile options
Known Problems
Index652
Makefile rules
Master version
naming conventions
product-dependent
third-party software
User version
directory structure
development files
expanded
disk I/O (FORTRAN)
disk iteration examples
disk_iter.c
disk_iter.menu
domain mapping (FORTRAN)
double buffer tools
examples
E
ealloc
ens_define.f
ens_define.inc
ens_define.menu
ensemble definition programs
ensemble tools
examples
environmental variable
error routines
C subroutines
FORTRAN subroutines
EXAMPLE.menu (Lisp)
exec subroutine
Executive
execution routine
functions
initialization routine
tools
expanded directory structure
F
features, ProMAX System
files
changing, inline tool
changing, overview
changing, stand-alone or IPC tool
Other Docs
flow builder
flow execution
flows
FORTRAN
coding standards
library summary
subroutines
FrameMaker
autosave files
backup files
creating new file in
editing a file in
lock status
recover files
starting
working with files in
function, of ProMAX
G
geophysical routines (FORTRAN)
global include file examples
global parameters
global parameters, overview
global variables, overview
global.inc
gmake
GNU make
H
header entries
headers, overview
heap
helpfiles
common error messages
customizing the User Interface
example
FrameMaker-formatted
hypertext
interactive display
organization
parameters
references
theory section
usage section
Known Problems
Index653
hypertext
I
include files
examples
index values
trace headers
init subroutine
functions
inline tools, files to change
input tools
examples
overview
interp_db.c
interp_db.menu
interp_sb.c
interp_sb.menu
interpolation routines (C)
inter-process communication
trace headers
IPC
menu code
IPC C code
IPC FORTRAN code
IPC tools
C subroutines
examples
files to change
ISPACEz
iteration tools
L
libraries
library summary
C
FORTRAN
lines
linked lists
linking C and Fortran
Lisp
example
M
machine-dependent directories
Other Docs
make system
Makeadvance
User setup
Makeexec
steps
Makefile
conventions
directory
header files
options
rules
techniques
template instantiation
terms
variable prefixes
variables
Makefile_poststack
Makefile_prestack
man pages
math functions (C)
matrix functions (C)
memory management
_mem
alloc
C
C subroutines
deque
ealloc
FORTRAN
FORTRAN subroutines
heap
linked lists
multi-dimensional arrays
overview
priority queues
promax
queues
reallocation
routine names
RSPACEz and ISPACEz
stack
menus
adding
creating
files
multi-dimensional arrays
Known Problems
Index654
N
non-portable scripts
O
OPF, ordered parameter files
examples
for inter-tool communication
overview
overview of ProMAX system
P
packet files (C)
packet files (FORTRAN)
panel tools
examples
panel_test.f
panel_test.inc
panel_test.menu
panelTest.c
parameter input (C)
parameter input (FORTRAN)
parameter interpolation (C)
parameter interpolation (FORTRAN)
parameter list (C)
parameter list (FORTRAN)
parameter tables
Delaunay triangles
extrapolation
interpolation
overview
rules
structure
subroutine categories
x values
parameter tables (C)
parameter tables (FORTRAN)
parms structure
in re-entrancy
plotting (C)
portable code, rules for
portable scripts
poststack.c
Other Docs
poststack.f
prefixes, Makefile variable
prest_interp.c
pre-stack interpolation programs
prestack.f
prestack.menu
prestk_interp.f
prestk_interp.inc
prestk_interp.menu
priority queues
Processes file
processing pipeline
promax memory management routines
PVM (C)
Q
queues
R
reallocation, memory
recompilation
re-entrancy
regular expression
resource reporting (FORTRAN)
RSPACEz
S
sc_amp.f
sc_amp.inc
sc_amp.menu
scripts
non-portable
portable
SEG vector routines (FORTRAN)
Seg-Y disk (FORTRAN)
semblance.f
semblance.inc
semblance.menu
setup
Solaris
System Administrator
User
signal processing (C)
signal processing (FORTRAN)
Known Problems
Index655
T
tables obsolete (FORTRAN)
third-party software
toggling products, .promax
tool anatomy
tools
adding
communication between
complex
complex, examples
Other Docs
complex, options
double buffer
double buffer examples
ensemble
ensemble, examples
executive
files to change
input
input, examples
IPC
IPC, examples
iteration
panel
panel, examples
simple
simple, examples
single buffer
single buffer, examples
stand-alone
stand-alone, examples
types
trace executive (FORTRAN)
Trace Headers
trace headers
alphabetical list
C subroutines
FORTRAN subroutines
geometry-related
index values
input-related
mute-related
special applications-related
special geometry-related
standard
statics-related
system-related
usage
trace I/O (FORTRAN)
trace interpolation examples
trace muting (C)
transform.c
transform.f
transform.inc
transform.menu
Known Problems
Index656
U
UNIX interface (C)
UNIX interface (FORTRAN)
User Interface
User setup
utopdir
V
variables, Makefile
vector routines (C)
vel_io.f
velocity (C)
Other Docs
Known Problems