BEDFORMS 1.0 for PC

Computer Programs for Simulation of

 Bedforms and Cross-Bedding,

Companion Diskette to Cross-Bedding, Bedforms, and Paleocurrents

David M. Rubin

with Programming Assistance from Alan Federman and Rex Sanders

U.S. Geological Survey MS-999
345 Middlefield Rd.
Menlo Park, California 94025
dr@octopus.wr.usgs.gov

SOCIETY OF ECONOMIC PALEONTOLOGISTS AND MINERALOGISTS
Tulsa, Oklahoma

NOTICE

	Although this software has been tested and reviewed, SEPM makes no representation of warranties and specifically disclaims any implied warranties of quality, performance, merchantability, or fitness for any particular purpose.  In no event shall SEPM be liable for any direct, indirect, incidental, special, or consequential damages arising from the purchaser's use of the program or its documentation.

TABLE OF CONTENTS

INTRODUCTION...............................................................................	1
	
INSTALLATION AND OPERATION........................................................	3

INPUT VARIABLES............................................................................4

Hardware Requirements and Run Times....................................	15

SOFTWARE SOURCES......................................................................	15

ACKNOWLEDGMENTS.....................................................................	15

REFERENCE...................................................................................	15

INTRODUCTION

	This disk contains a program for mathematically simulating bedforms and cross-bedding.  The disk also contains input files that can be used to reproduce the illustrations published by Rubin (1987).  The bedform program can be used experimentally to create cross-bedding produced by bedforms with a known morphology and behavior or can be used by trial and error to recreate the morphology and behavior of bedforms that produced specific deposits.  Examples of the modeling, comparison with real structures, and results of computer experiments are discussed by Rubin (1987).
	The bedform program is written in FORTRAN 77.  The program generates bedform topography, computes the x-y-z coordinates of the surface, and converts the three-dimensional coordinates of the simulated structures to the corresponding two-dimensional coordinates on the page (while performing hidden-line removal), and covers the topography with a mesh or shaded surface.  The program uses sine curves to create surfaces that approximate the shape of bedforms.  Displacement of the sine curves simulates bedform migration, changing amplitude simulates changing bedform height, and combining sets of sine curves simulates superpositioning of bedforms.  The equations that generate these mathematical surfaces can be inspected in the program source code, but such inspection is not necessary to use the programs.
	The program can be used to produce block diagrams that display vertical sections through cross-bedding; mesh surfaces and shaded surfaces of bedform topography (cover illustration and Fig. 1A); horizontal sections through the bedforms (Fig. 1B); horizontal sections through the underlying strata (Fig. 1C); and plots that show bedform migration directions, trends of trough axes, cross-bed and bounding-surface poles, and rose diagrams of cross-bed and bounding-surface azimuths (Fig. 2).

	The bedform migration directions plotted in the dip plots are those specified in the input file.  Trough-axis trends are the calculated from paths of the main scour pits (those that occur in the troughs of the first set of bedforms).  This includes scour pits formed where troughs of superimposed bedforms intersect troughs of the main bedforms and includes scour pits formed by out-of-phase crestlines. Trough axes produced by scour pits that are independent of the troughs of the main bedforms are not plotted.  In all cases, the trough-axis trends that are plotted are the mean trends; changes through time in the direction of scour-pit migration are not considered.  In plots of cross-bed and bounding-surface dips, azimuth is given by the direction from the center of the plot to each point, and inclination is proportional to the distance from the center. Inclinations are relative; actual values are not assigned because the computer model does not incorporate such processes as avalanching.
	Because bounding surfaces are commonly diachronous, determining their orientation is quite complicated.  The mathematical solution requires solving for a plane from three points, but because bounding surfaces do not always originate everywhere at the same time, bounding surfaces must be correlated between three vertical arrays. To avoid miscorrelations between arrays, the program does not attempt to recognize bounding surfaces in a very small percentage of occurrences where their vertical spacing is very slight (such as where two or more bounding surfaces converge at the site of the imaginary borehole).
	The dip-plotting program also plots rose diagrams of cross-bed and bounding-surface azimuths (in 10˚ azimuth classes).  To create these plots, every bed encountered in the vertical profiles is weighted in proportion to the bed inclination of the bed.  Weighting the beds by inclination has two benefits.  The weighted rose diagrams are more representative (volumetrically) of the computer-generated structures, and by emphasizing steeper dips the measurements are similar to those made by field geologists.

Figure 1. Examples of images produced by the Bedforms program.  Cross-bedding is the same in all three figures, but the elevation of the horizontal section differs.  In (A) the elevation of the horizontal section was specified as 1.0 (corresponding to the highest point on the bedform surface); in (B) the elevation was specified as 0.5 (midway between the deepest trough and highest crest); in (C) the elevation was specified as 0.0 (the elevation of the lowest point of the trough).  The directional orientation block was added using a PostScript drawing program. 

Figure 2.  Dip plot created by the Bedforms program.  Input parameters that describe bedform shape and behavior are the same as in Figure 1.

PROGRAM INSTALLATION
AND OPERATION

	Use the following sequence of steps to install the Bedforms program:
1) Create a directory for the Bedforms program on the hard disk.
	(ex.   md bedforms)
2) Place the installation diskette into the drive. 3) Copy appropriate files.
	(ex.   copy b:\*.* c:\bedforms)
	Two versions of the compiled program are provided on the disk.  BEDFORM is compiled for 386, 486, or machines with math co-processors.  BEDFORMX is for machines without a math co-processor, and will run exceedingly slowly.  The files in the "SOURCE" directory are not necessary for program operation; they are provided for those who wish to examine the source code.

	Use the following command lines to run the program:
	CD BEDFORMS
	RUN BEDFORM
The program begins by reading an input file that defines a list of variables used by the program to simulate bedform shape and behavior.  (These variables are described in the next section.)  The program will then prompt the user for the following choices:
1) Name of input file to use
2) Kind of image to create (bedform image or dip plot)
3) Kind of output (screen drawing or PostScript file)
4) If a screen drawing is specified, the user is asked to choose the kind of VGA.
5) If a PostScript file is specified, the user is prompted for the kind of bedform surface (mesh or shaded) and the name of the output file to be created.

	To test the operation of the program, try the following selections:

File name:   	input.dat
Program to run:	DIPS (2)
Output to:	SCREEN (1)
Use BIOS:	YES (0)

INPUT VARIABLES

	If this program is used merely to reproduce bedforms specified in the input files supplied on the disk, it is not necessary to examine this files.  But if the program is to be used as a research tool (to search by trial and error for the shape and behavior of bedforms that produced a real deposit), most of the work involves creating or modifying the input files.  It is the responsibility of the user to create an input file that describes the shape and behavior of the bedforms envisioned.  Warning: it is quite easy to create bedforms with a physically unreasonable behavior, such as dunes that migrate in the opposite direction from that indicated by their asymmetry.  The following discussion describes, line by line, what variables must be specified in an input file.  The easiest way to create an input file is to edit an existing one, replacing old values of the input variables with the desired ones.  Unless otherwise specified, all of the input variables are real numbers; those that are integers, logical, or character variables are noted.
	The input files provided in the folder named "Input Files" on the disk were designed for high-resolution POSTSCRIPT plotting and are not optimized for drawing on the screen.  These files require unnecessarily long running times and will plot lines that are too close together for drawing on the screen.  To convert the files for screen drawing, however, requires only that two lines be changed: the variable on line 80 should be increased by a factor of 2-4 and the variable on line 85 should be increased to 4, 5, or 10.  Three such files are provided in the folder named "Test Input Files".  The following list describes the input variables that are contained in all input files.
(1) Name of the input file.  This is a character variable with a maximum length of 31 characters.  This variable is included in the input file so that the name of the file can be retained within the input file and plotted on the output figure.  Changing the Macintosh system name of the file does not change the name that is plotted on the output image.  Note that if the file name contains two words separated by a space, the second word will not be printed unless the name is bracketed by quotes.
(2) Caption to be printed on the output figure.  This is a character variable with a maximum length of 80 characters.  This character variable should be contained in quotes.
Lines (2-86) in the input file include a character variable that is used so that each line of the file can include a brief description of the variable that occurs on that line (see any of the example input files). 
The following group of variables describes the first set of bedforms.
(3) Bedform wavelength.  The sides of the block diagrams drawn by the dunes program are defined to have lengths equal to 100.0 units.  All variables that specify length (or length components of variables that specify velocity) are expressed in the same arbitrary units. Bedforms with spacings of 100.0 units and 50.0 units are shown in Figure 3.
(4) Bedform phase (in degrees).  This variable specifies the position of the bedforms (at time=zero) within the block diagram.  Where the spacing of the bedforms is equal to 100.0, phase of the bedforms has no effect on the actual structure that is produced; the variable merely controls the placement of the structure within the block.  Where the spacing is greater than 100.0, the phase determines which part of the structure is included within the block.  Bedforms with phases equal to 0.0 and 90.0 are shown in Figure 4.

(5) Bedform symmetry or asymmetry (an arbitrary, dimensionless, real variable).  A value of 1.0 produces bedforms that are asymmetric (Fig. 5A), and a value of 0.0 produces symmetrical bedforms (Fig. 5B); values between 0.0 and 1.0 produce intermediate amounts of asymmetry.  Note that if a positive value is specified, the steeper flank will face in the direction defined by positive bedform migration (as should normally be the situation); where a negative value is specified, the steeper flank will face in the opposite direction (Fig. 5C).  In situations where asymmetry varies through time, the value specified here defines the mean asymmetry.  Asymmetry at any one instant is the sum of this value and a cyclic component that is described by the following three variables.  Asymmetry is simulated mathematically by summing two sinusoidal components.  The first has a wavelength equal to the bedform wavelength; the second component has a wavelength of one-half the bedform wavelength.  The relative phase of the two components determines bedform asymmetry.
(6) Amplitude of bedform-asymmetry cycle (same dimensionless units as in 5, above).  During each complete cycle, asymmetry varies between (5) plus (6) and (5) minus (6). A value of 0.0, which produces no change in asymmetry, should be used to create bedforms that do not vary through time.  Values greater than approximately 0.5 or 1.0 often produce peculiar results and should not be used without carefully inspecting the results.
(7) Period of bedform-asymmetry cycle.  This variable (and all others that specify periods or velocities) can be based on any arbitrary units of time, provided that these units are consistent throughout the input file.
(8) Phase in the asymmetry cycle at time = zero.  Values are in degrees; when this term is 90.0, asymmetry at time = zero is a maximum [equal to the mean asymmetry (5) plus the amplitude of asymmetry change (6)].
(9) Bedform steepness.  Neglecting the effects of bedform superpositioning, a value of 1.0 causes bedform height to be approximately equal to 1/15 of the bedform wavelength.  When other variables remain constant, bedform height is proportional to the value chosen.  This variable defines the mean bedform steepness; where height varies through time, the instantaneous height also is a function of the next three variables.
(10) Amplitude of bedform-steepness cycles; units are the same as for mean height (9, above).  During a complete height-fluctuation cycle, height varies between (9) plus (10) and (9) minus (10).  To create bedforms that do not change in height, this term should be equal to zero.
(11) Period of time during which bedform steepness changes.
(12) Phase at time = zero in the steepness-fluctuation cycle.  Values are in degrees.  A value of 0.0 produces bedforms with a steepness that is a minimum in the cycle.
(13) Wavelength of the first set of plan-form sinuosities.  Values have the same units of length as all other lengths. Each set of bedforms can have as many as two sets of plan-form sinuosities.  By specifying the appropriate values for the wavelength and amplitude of these sinuosities (as discussed in the descriptions in 17-19, below), it is possible to create sinuous, linguoid, or lunate plan forms.  Bedforms with sinuosity spacings of 100.0 and 50.0 are illustrated in Figure 6.  Note that if either this term or the following term is equal to zero, no sinuosities are created.
(14) Amplitude (measured in plan form) of the first set of sinuosities.  Bedforms with sinuosity amplitudes of 5.0 and 10.0 are illustrated in Figure 7.
(15) Phase (along-crest placement) of first set of plan-form sinuosities (Fig. 8).  To create in-phase bedforms, this term should have the same value as (38), the analogous  term for the second set of bedforms; to create out-of-phase bedforms, the two terms should differ by 180.0.
(16) Migration speed (along crest) of the first set of plan-form sinuosities; units are in length/time.  For the most natural-looking results, this term should have a value less than approximately 3.0 to 4.0.  Positive values cause the sinuosities to migrate toward a direction 90˚ clockwise of the migration direction specified for the bedform (21); negative values cause the sinuosities to migrate 90˚ counterclockwise.
(17) Wavelength of the second set of plan-form sinuosities.  To create sine-shaped plan-form sinuosities, this term should have a value of 0.0.  For lunate or linguoid bedforms this term should have a value equal to half of (13).

Figure 3.  Bedforms with spacings of 100.0 units (A) and 50.0 units (B).  The block diagram is 100 units square.

Figure 4. Bedforms with phases of 0.0° (A) and 90.0° (B).  Phase controls the placement of bedforms within the block diagram.

Figure 5. Bedforms with asymmetries of 1.0 (A), 0.0 (B), and -1.0 (C).  Migration directions are left to right in all three examples.

Figure 6. Bedforms with plan-form sinuosities having wavelengths of 100.0 units (A) and 50.0 units (B).

Figure 7.  Bedforms with plan-form sinuosities having amplitudes of 10.0 units (A) and 5.0 units (B).

Figure 8.  Bedforms with plan-form sinuosities having phases of 0.0° (A) and 90.0° (B).

(18) Amplitude (plan form) of the second set of sinuosities. To create lunate or linguoid bedforms with a realistic curvature, a good value for this term is 1/4 of the value of (17).
(19) Phase (along-crest placement) of plan-form sinuosities.  To create lunate bedforms, this term should have a value equal to (15)+270.0.  To create linguoid bedforms, this term should have a value equal to (15)+90.0.
(20) Migration speed (along crest) of the second set of plan-form sinuosities.  By specifying this value to differ from (16), bedform plan-form shape can be caused to vary through time.
(21) Migration direction of the first set of bedforms.  Migration directions are normal to the bedform crestlines. Thus, specifying the migration direction also sets the bedform orientation.  Directions are defined as shown in Figure 1.
(22) Mean migration speed of the first set of bedforms.  For the most realistic results, this value should be less than approximately 3.0 or 4.0.
(23) Amplitude of migration-speed cycles; units are the same units of velocity as in (22).  The value specified here should have a value of 0.0 if a constant migration speed is desired.
(24) Period of migration-speed cycle.
(25) Phase at time = zero in the migration-speed cycle.  A value of 0.0 produces bedforms that at time = zero have a minimum speed.
The following group of variables describes the second set of bedforms. All terms are analogous to the corresponding terms defined above.
(26) Bedform wavelength.
(27) Bedform phase.
(28) Mean asymmetry.
(29) Amplitude of asymmetry cycle.
(30) Period of asymmetry cycle.
(31) Phase of asymmetry cycle.
(32) Mean steepness of second set of bedforms.  The steepness specified is that of the bedforms before they are superimposed on the first set.  Superpositioning can change the bedform steepness as discussed in the comments about the type of superpositioning (72).
(33) Amplitude of bedform-steepness cycle.
(34) Period of steepness cycle.
(35) Phase of steepness cycle.
(36) Wavelength of first set of plan-form sinuosities.
(37) Amplitude of first set of plan-form sinuosities.
(38) Phase of first set of plan-form sinuosities.  To create in-phase bedforms, this term should have the same value as (15); to create out-of-phase bedforms, the two terms should differ by 180.0.
(39) Migration speed (along crest) of first set of plan-form sinuosities.
(40) Wavelength of second set of plan-form sinuosities.
(41) Amplitude of second set of plan-form sinuosities.
(42) Phase of second set of plan-form sinuosities.
(43) Migration speed (along crest) of second set of plan-form sinuosities.
(44) Migration direction of second set of bedforms.
(45) Mean migration speed.
(46) Amplitude of migration-speed cycles.
(47) Period of speed cycles.
(48) Phase of speed cycles.
The following group of variables describes the third set of bedforms. All terms are analogous to the corresponding terms defined in (3)-(25).
(49) Bedform wavelength.
(50) Bedform phase.
(51) Mean asymmetry.
(52) Amplitude of asymmetry cycle.
(53) Period of asymmetry cycle.
(54) Phase of asymmetry cycle.
(55) Mean steepness.
(56) Amplitude of steepness fluctuations.
(57) Period of steepness cycle.
(58) Phase of steepness cycle.
(59) Wavelength of first set of plan-form sinuosities.
(60) Amplitude of first set of plan-form sinuosities.
(61) Phase of first set of plan-form sinuosities.
(62) Migration speed (along crest) of first set of plan-form sinuosities.
(63) Wavelength of second set of plan-form sinuosities.
(64) Amplitude of second set of plan-form sinuosities.
(65) Phase of second set of plan-form sinuosities.
(66) Migration speed (along crest) of second set of plan-form sinuosities.
(67) Migration direction of third set of bedforms.
(68) Mean migration speed.
(69) Amplitude of migration-speed cycle.
(70) Period of speed cycle.
(71) Phase of speed cycle.
The following terms define characteristics that apply to the entire depositional situation that is being modeled.
(72) Integer variable that determines the geometric rules used to superimpose the second and third sets of bedforms on the first set.  If this variable is equal to 1, superimposed bedforms are added to main bedforms by simple addition.  If equal to 2, the local height of the superimposed bedforms is proportional to the local elevation of the main bedform. Steepnesses of superimposed bedforms thus vary from zero in the troughs of the main bedforms to a maximum at the crests of the main bedforms.  The mean steepness of the superimposed bedforms is thus 1/2 of their steepness specified on lines (32) and (55).  If the variable defined on line (72) of the input file is equal to 3, the elevations of all bedforms are calculated separately, and the elevation at any point on the surface is chosen to be that of whatever bedform is locally highest.  This is the value to use to produce out-of-phase sinuous, lunate, or linguoid bedforms.  Mean steepness of the resulting bedforms varies with the steepness, spacing, and phase relations of the various sets of bedforms.  If the variable on line (72) is equal to 4, the height of the superimposed bedforms is inversely proportional to the local elevation of the main bedform.  Steepnesses of superimposed bedforms vary from those specified on lines (32) and (55) in the troughs of the main bedforms to zero at the crests of the main bedforms. The mean steepness of the superimposed bedforms is thus 1/2 of the specified value.  If the variable on line (72) is equal to 5, two sets of superimposed bedforms are created following the rules as if the variable were equal to 3; that assemblage is then added to the main bedforms as if the variable were equal to 1.  If the variable on line (72) is equal to 6, the first set of superimposed bedforms is summed as if the variable were 2, and the second set is added as if the variable were 1.
(73) Integer variable that can be used to rotate all bedforms and migration directions such that trough axes are normal or parallel to the sides of the block diagrams.  If equal to 0, no rotation is performed.  Values of 1, 2, 3, or 4 can be selected to cause scour pits to migrate out of any of the four vertical sides of the block (1 for the back right, 2 for the front right, 3 for the front left, and 4 for the back left).
(74) Elevation of interdune flats.  A value of less than -1.0 will generally produce no interdune flats. A value of 0.0 will cause approximately half of the surface area to be occupied by interdune flats.
(75) Mean rate of deposition; same units of length/time as migration rates.
(76) Amplitude of cycle in the rate of deposition; same units of length/time as migration rates.
(77) Period of cycle in the rate of deposition; same units as all other time periods.
(78) Phase of cycle in the rate of deposition (in degrees).  If equal to 0.0˚, the rate of deposition is at a minimum at time = zero.
(79) Integer number of steps backward through time to the beginning of the depositional event that is being simulated.
(80) Integer interval between the plotting of foresets. This term is normally equal to 1 for POSTSCRIPT files, but can be in increased for drawing on the screen or if bedforms move so slowly that the resulting foresets are too close to each other.  Larger numbers require less computing time but produce less detailed images.
(81) Integer that specifies the time of the end of the depositional episode (i.e., the time when the surface is illustrated).  Changing this number causes a change in location of the bedforms within the block diagram.  For making single images, this term need not differ from 0.  In animation sequences, this number is automatically incremented from frame to frame.
(82) Logical variable that, if true, causes the figure caption (2) to be plotted.
(83) Logical variable that, if true, causes the name of the input file (1) to be plotted.
(84) Logical variable that has been discontinued but was kept so that old input files will remain compatible.  Can be either ".true." or ".false." .
(85) Integer variable that chooses between long computation times (with high precision of plots) and shorter computation times (accompanied by lower precision); the value of this variable must equal 1, 2, 4, 5, or 10.  In the bedform-drawing program, this variable specifies the spacing of the grid used to compute bedform topography and used to create the surface mesh or shading.  Small values create more natural-looking images (smoother curves, particularly in horizontal sections) but take longer to run and require more disk space for each image.  In the dip-plotting program, this variable determines the number of imaginary boreholes (24 boreholes if the value equals 1; 16 if the value equals 2; 10 if the value equals 4; and 6 if the value equals 5 or 10).  The exception to this rule is where bedforms are two-dimensional and non-stationary.  In this situation, only four boreholes are used.  Plotted migration vectors and cross-bed dips are unaffected by this variable.  In general, values of 2, 4, and 5 are good starting points for this variable.  The high precision (and longer computation times) specified by a value of 1 is probably necessary only for publication-quality images of bedforms and bedding or for statistical studies of bounding-surface distribution.
(86) Elevation of the horizontal section, expressed in non-dimensional units (relative to 0.0 at the lowest point on the bedform surface and 1.0 at the highest point).  A value of 1.0 will cause the horizontal section to be equal to the highest point on the bedform surface; the entire bedform surface will be shown in a mesh diagram (Fig. 1A).  A value of 0.0 will cause the elevation of the horizontal section to coincide with the lowest elevation of the bedform surface; the top of the block diagram will consist entirely of a horizontal section (Fig. 1C).  Intermediate values will produce block diagrams that are capped by a horizontal section at the specified elevation; lower elevations of the bedform surface appear in mesh form (Fig. 1B).  In animation sequences the initial value of this variable is defined in the input file but can be changed using the adjustments to input dialog box (Fig. 3).  Subsequent frames in the sequence can be programmed to vary using the animation script dialog box (Fig. 4).  To plane the bedforms from trough to crest, the initial value must be 1.0 and the value for the final frame must be 0.0.  The value that should be entered in the animation script dialog box is therefore -1.0 divided by the number of frames in the scene.

Hardware Requirements and Run Times

	The Bedform program requires VGA video, 5 megabytes of hard disk space, and one-half megabyte of free memory to run the program.  Times required to run the program vary considerably, depending on the kind of computer and the kind of image being created.  Input files that specify a coarse grid, short depositional episode (few steps through time), and bedform surface rather than a horizontal section enable the bedform program to run in times as short as a few tens of seconds. Finer grid spacing, longer depositional episodes, horizontal sections and a slow computer can increase running times to as much as several hours.  Because running times are so long on a slow machine, we recommend a math co-processor and at least a 386DX, 33 megahertz machine.

SOFTWARE SOURCES

	At the time of this printing, software updates are maintained on a USGS file server that can be accessed via anonymous ftp.  The file server address is walrus.wr.usgs.gov, and the files are located in the directory /pub/pc/bedforms.  Macintosh versions are available in the directory  /pub/mac/bedforms.  The PC and Macintosh files (as well as completed QuickTime movies and gif images of real and simulated structures) are accessible on the WWW at:http://walrus.wr.usgs.gov/docs/ seds/Sedimentology.html.

ACKNOWLEDGMENTS

	John Dingler and Andy Stevenson (U.S. Geological Survey) tested the program and reviewed the documentation.

 REFERENCE

Rubin, D.M., 1987, Cross-Bedding, Bedforms, and Paleocurrents: Society of Economic Paleontologists and Mineralogists, Tulsa, Oklahoma, Concepts in Sedimentology and Paleontology, v. 1, 187 p.