General remarks on the SW3D software

How to start with SW3D software?

We recommend to start with compilation and linking of SW3D Fortran 77 packages. After downloading the packages, please check the format (DOS, UNIX) of the ASCII files on your system. The use of UNIX files under DOS or Windows or the use of DOS files under UNIX may cause errors. Instructions how to compile and link executable programs are included in the description of each package. Instructions how to run programs using the history files are also given in the documentation of each package. In the next step we recommend to choose, study and run the history file (*.h) or Perl script (*.pl) that seems to be the nearest one to the problem you want to study (see package DATA). You may find useful a step by step example how to run history file len-mod.h. If you wish to prepare your own model of a geological structure, we again recommend to choose a similar model in the package DATA and to modify it towards your new model of the geological structure. Never forget to check your new model by program modchk.for.

Numerical Recipes

If you wish to compile programs grdfft.for, grdran2d.for, grdran.for, matmul.for, matlin.for, matfun.for, matinv.for, smpower.for, smeigen.for, trsmsm.for (of package FORMS) and programs crtpts.for, green.for (of package CRT) you need also few subroutines of the Numerical Recipes and the corresponding licence. References to subroutine files required by each of the above mentioned main programs are included at the end of the file containing the program. The subroutines from Numerical Recipes required by the above mentioned programs are collected in package NR.

Remarks concerning Fortran compilers

Some older Fortran compilers do not conform to the ANSI Fortran 77 standard to that extent they could correctly compile packages like MODEL or CRT (they incorrectly compile DO loops). Some compilers do not write files to unit 6 correctly. The authors use compilers by Lahey under MS-DOS, GNU gfortran under Linux (part of Linux distributions) and under MS Windows (e.g. gfortran is included in Strawberry Perl). For the compiler options please see Perl script

Perl scripts

Perl scripts are used to control the compilation of the Fortran code, to run the programs according to the history files and sometimes to complete some system-dependent tasks.

Perl interpreter is usually a part of the Unix installation and is available for most other operating systems. Perl interpreter should be available at for most operating systems.


Plotting programs generate 2-D plots (e.g., synthetic seismograms) in PostScript. The figures may be printed on any PostScript printer, viewed on the screen, included into papers, etc. There are also several PostScript figures on the compact disk. To view the figures on the screen, it is not bad to have installed a PostScript viewer and to enable it in the HTML browser as a helper. The authors use GhostScript or GhostView.


PostScript files containing papers and some extensive data files are compressed using the GZIP program. The GZIPped files have extension .gz. Use command gzip -adN name.gz to decompress file name.gz. Program GZIP should be available at for most operating systems.


Virtual Reality Modeling Language (VRML) is a powerful tool to display 3-D models, rays and other 3-D objects relevant to seismic modelling. In particular, we recommend VRML97 (Virtual Reality Modeling Language ISO/IEC 14772). Packages FORMS and MODEL are equipped with the programs to triangulate structural interfaces and velocity sections and display them together with rays and source and receiver points in 3-D by means of VRML. The compact disk contains examples of generated VRML files, see package DATA.

To see the VRML files, it is recommended to have installed a VRML97 browser. Under Linux and MS Windows the authors use browser vrmlview (freeware, discontinued), eventhough it has several bugs. (For example, the ambient light makes all objects white, so it cannot be used. The ambient light is thus poorly simulated by sets of directional lights on this compact disc.) Other alternative is VRML/X3D browser view3dscene (free software).


Visualization software GOCAD (Geological Object Computer Aided Design) is a product of the RING-GOCAD consortium. In 2013, GOCAD merged with Paradigm SKUA and licenses for the GOCAD-SKUA software may be independently purchased from Paradigm Geophysical. GOCAD is an integrated and geologically oriented CAD software that provides various tools to construct a wide range of earth models, for application in geology, geophysics and reservoir engineering. GOCAD has been developed for many operating systems. Packages FORMS and MODEL are equipped with the programs for conversion of points, lines, triangulated surfaces and 3-D grid of points into GOCAD. The compact disk contains examples of generated GOCAD files. For the discussion how to display 3-D seismic models through the VRML and GOCAD refer to Bucha (2001).