SEP 2000

Abstract
========

The ideal software system for geoscience R&D should be functional for
seismic and non seismic data analysis, processing and interpretation,
yet open and flexible for unpredicted computing environment in user
interface, graphics, and parallel computing.

One way to do it is via a set of separate libraries with minimal
dependency, and having the application program on top of the libraries
free to choose some and not others.


Who's on Top?
=============

If the software environment is such that the application programmer writes
the Unix main() and can optionally choose libraries to link to then the
application is on top.

If the application programmer writes one or some subroutines to be called
by the system then the system is on top.

The advantage of system on top is that it saves the application programmer
the knowledge of what is going in the system.  The disadvantage is that
the system becomes more complex and less flexible when it comes to
handling data flows that were not foreseen by the system designers.
System programmers usually prefer the system on top, researchers and
application programmers usually prefer the application on top.

Seplib started in the late seventies with the application on top.
When I started to program here in 1982, I found getpar in libc,
where Rob Clayton put it.  Getpar and some other utilities were
libraries that the user might use if he wanted.

In 1983 Stew Levin made a revolution and the system went on top;
the application programmers started to #include <sep.main> and
wrote a subroutine called MAIN() which was called by the main()
in sep-main.  It became very hard, practically impossible to use
seplib without #including <sep.main>.  It usually worked well, but
if it did not and Stew was not around you were stuck.  And it was
a pain to debug because of the unusual #include and because so much was
happening before your code has even started.

(Other systems require application programmers to write two subroutines;
one to be called for initial user interface and another to be called
after everything is set up and when the data are flowing.  This obviates
the hclose() that was required in MAIN().)

In 1984 Einar Kjartansson started SU while on a summer appointment at SEP.
SU differed from SEPlib in two main features (1) it relied on trace headers
while SEPlib relied on external header files (2) the application was on top.
I liked SU better.  I thought it was because I found the trace headers
useful for processing field data with irregular geometry.  Now I know
that it was in spite of the trace headers which made SU specialized for
seismic processing while SEPlib was more generic.  It had nothing to do
with the trace headers, it had everything to do with the fact that as
an application programmer I prefered the application on top.

Today the requirements from a software system for the geoscientist are
much more extensive than they were in the early eighties.  The system
is required to be more flexible and handle other data types than 3-D cubes
in which SEPlib was good at, and trace data in which SU was good at.  Well log
data, potential data, reservoir and velocity models, geographical information,
and other examples, are neither cubes nor seismic traces.  Flexibility is
also required by the graphics and the graphical user interface in which
X seems to be dominant (on Unix) but not supreme, its coverage of hard
copy lacking and non standard, and there are competing widget sets
and toolkits on top of X.  Another reason for flexibility
is that programming for parallel computing is not standard, and while
many people are certain they know what the future is, it is certain that
some of them are wrong.

To keep our options open we should minimize the dependencies between
components in the system.  Two different applications may use the same
command line interface (getpar) but one's data flow may be seplib cubes
and the other's may be SEGY traces.  A third application may input
prestack data in SEGY traces and output a SEPlib cube stack.  Two other
application may share the same user and data interface but one would
parallelize via MPI and the other via a Fortran 90 compiler.

Schematically:

  /---------------\ /---------------\             /---------------\
  | Application 1 | | Application 2 |             | Application 3 |
  \---------------/ \---------------/             \---------------/
       |     \  \      /        | \                  /      |   
       |      \  \----------\   |  \---------\      /       |
       |       \     /       \  |             \    /        |
       |        \   /         \ |              \  /         |
/-----------\ /-----------\ /-----------\ /-----------\ /-----------\
| Library 1 | | Library 2 | | Library 3 | | Library 4 | | Library 5 |
\-----------/ \-----------/ \-----------/ \-----------/ \-----------/


A system which is a big blob of inter-dependent functions which
is an all or nothing choice is less flexible and the choice might
very well be nothing because one component does not fit.

This also has the advantage of easier distributed development.


Components
==========

/------------- Command Line User Interface ------------------------------\
|                                                                        |
| Consolidate Getpar, Getoption, Self-doc, Error/Warning diagnostics     | CLUI
|                                                                        |
\------------------------------------------------------------------------/

/------------- Graphical User Interface ---------------------------------\
|                                                                        |
| Direct for interactive programs                                        |
|                                                                        |
| Job builder for batch programs                                         | GUI
|                                                                        |
| Tcl/Xtpanel/CGI/Java built-ins/ ...                                     |
|                                                                        |
\------------------------------------------------------------------------/

/------------- Graphics -------------------------------------------------\
|                                                                        |
| Vplot/Widget set/...                                                   |
|                                                                        |
\------------------------------------------------------------------------/

/------------- Math -----------------------------------------------------\
|                                                                        |
| BLAS, FFT, convolutions, Wiener-Levinson, Interpolation, ...           |
|                                                                        |
\------------------------------------------------------------------------/

/------------- Solvers and optimizers -----------------------------------\
|                                                                        |
| Vectors (N-D cubes, scatters, mixed axis, ...) with I/O methods!       |
|                                                                        |
| Operators (Matrices, Sparse matrices, Aprod) optional I/O methods      |
|                                                                        | HCL?
| Solvers (Page Saunders, cgstep, IRLS, ...)                             |
|                                                                        |
| Optimizers (Cyclic Coordinates, Gauss Seidell, CG, Monte-Carlo, ...)   |
|                                                                        |
\------------------------------------------------------------------------/

/------------- SEGY (SU) ------------------------------------------------\
|                                                                        |
| Gettr, Puttr, SEGY Header utilities, applications, GUI job builder     | SU++
|                                                                        |
\------------------------------------------------------------------------/

/------------- LIS/LAS/DLIS ---------------------------------------------\
|                                                                        |
| I/O to/from scatters                                                   |
|                                                                        |
\------------------------------------------------------------------------/

/------------- Parametric Modeling --------------------------------------\
|                                                                        |
| XoX or alike                                                           |
|                                                                        |
\------------------------------------------------------------------------/
