Program scan_matlabfile Author: Douglas Guptill copyright (c) 2011 Douglas Guptill --------------- Program outputs --------------- scan_matlabfile produces two kinds of output: 1) layer height and extent 2) surface height and velocity ---------- User Input ---------- The user input parameters are read from a file. The filename is expected to be "scan_matlabfile.input", unless it is given as a parameter when running the program. Lines like the following are valid. Parameter lines can be in any order. Blank lines will be ignored. There are three sections in the input file. Each section begins with the section name, and is terminated by "[end]". The [layer] and [surface] sections are optional. Any string parameters containing special characters (like `/') REQUIRE surrounding "". This will usually applies to: directory output_units [input_files] directory directory of input files. timestep_digits number of digits allowed for timestep in the names of the matlab files. Usually 4 or 5. ma_format format for Ma part of output filename. e.g. "f6.2" ts_first first timestep to read. ts_last last timestep to read. ts_incr increment used between ts_first and ts_last; like a FORTRAN do loop. y_plane This will be repeated in the output files. Default: "0.d0" output_time "model" => Time, in the output filenames, is taken from the input files. "geologic" => Time, in the output filenames, is taken from the input files, and modified. The last timestep is given time = 0 The first timestep is given time = (time of ts_last) The times - in the output filenames - will therefore start at some positive number, and decrease to zero, as the timesteps increase from ts_first to ts_last. [end] [layer] write_layer_file "yes" => the layer file will be created. "no" => the layer file will not be created. Default: "no" combine_segments "yes" will ensure there is only one segment in each column. Default: "yes" fieldname The name of an integer-valued elemental data field. The file 'nnnnn.ml' will be read. Default (and only valid value) : "color1" fieldvalue the input file will be scanned for eulerian elements with this value. Default: "3" [end] [surface] write_surface_files "yes" => three files containing surface height and velocities will be created. "no" => those three files will not be created. Default: "no" x_velocity_offset "left" => the x velocities will be offset by the value of the leftmost column "minimum" => the x velocities will be offset by the minimum of all x velocities in the current time step. Default: "minimum" "none" => no offset applied to the x velocities. positive_offset "no" => If the x velocity offset is positive, it will not be applied. "yes" => The offset will be applied. Default: "no" output_units units of the velocity output. Valid values: "m/s" - meters/second "cm/y" - centimeters/year "km/Ma" - kilometers/million years Default: "km/Ma" subsidence "yes" => will be subtracted from the z coordinates (sopale y coordinates) before being written to the *Ma_coordinates.xyz" files. "no", (or anything but "yes") => the z coordinates will be left as is. Default: "no" model_height See "subsidence". Default: "0.0" [end] Example input file ------------------ [input_files] directory ../../test/sb200_2_matlab_p00 ma_format f10.4 ts_first 1 ts_last 10 ts_incr 1 [end] [layer] fieldvalue 20 [end] [surface] [end] Output file: Layer height and extent ------------------------------------- The output is in files - one for each time step - containing the x position, extent, top and bottom of any layer where fieldname = fieldvalue. For example, where color1 = 20. The output filename is constructed from the time (of the data) and the fieldvalue, or material number. ========== (start) tt.ttMa_mat20 ========================= #Material 20# x [m] y [m] thickness [m] z-top [m] z-bottom [m] 45500. 0. 120. -350. -470. 46500. 0. 121. -391. -512. ... ========== (end) tt.ttMa_mat20 ========================= Output file: Surface height and velocity of each Eulerian column ---------------------------------------------------------------- The surface height (z) and velocities (vx and vz) at the center of each Eulerian column will be output. In all three cases, the output value will be the average of the left and right edge values. The output files - three of them for each timestep: =========== (start) tt.ttMa_coordinates ===================== column1-x y-from-user-input column1-z column2-x y-from-user-input column2-z .... =========== (end) tt.ttMa_coordinates ===================== =========== (start) tt.ttMa_xveloc ========================== column1-x y-from-user-input column1-xvelocity column2-x y-from-user-input column2-xvelocity ... =========== (end) tt.ttMa_xveloc ========================== =========== (start) tt.ttMa_zveloc ========================== column1-x y-from-user-input column1-zvelocity column2-x y-from-user-input column2-zvelocity ... =========== (end) tt.ttMa_zveloc ========================== Offsets ------- All the x velocities are offset. The offset value is either: 1) the minimum (of all columns) velocity for the current time step, or 2) the velocity of the first column. The calculation is: x_velocity = x_velocity - offset Coordinate Systems ------------------ Sopale, and sopale_nested, operate in an x-y coordinate system. In the above, an x-y-z coordinate system is used. The y's are not the same. Sopale's y is z in the system above. Said another way, the "z" above corresponds to sopale's "y".