DOCUMENTATION
SYNOPSIS
PROGRAM NAME: immodpg
AUTHOR: Juan Lorenzo
DATE: Feb 6 2020
DESCRIPTION:
Version: 0.0.1
USE
NOTES
Original Fortran code is by Emilio Vera
and is called mmodpg
Modeling of Traveltime (T-X) Curves
LDG:146O , 1984-1989
BOIGM, 1993
Depto. de Geofisica, U. de Chile, 1996-**
Computations are carried out for a model consisting
of a mixture of horizontal constant velocity, and
constant velocity gradient layers.Low velocity zones
can be included. Each layer is specified by its top
and bottom velocity. Rays are traced using equispaced
ray parameterss.
Data traces are presented as a grey scale plot.
TODO: _Vbot vs. _Vbot_current may confuse
key _Vbot is used only initially herein
_Vbot_current is the latest value in the gui
The following order of operations is needed
to prevent the fortran programs from quickly
reading the change (yes) BEFORE the options
and values are written out.
_setVtop( $immodpg->{_Vtop_current} );
_set_option($changeVtop_opt);
_set_change($yes);
Examples
CHANGES and their DATES
V0.2 April 4, 2021
April 2021: controlled data input errors Added model values to namespace of immodpg.pm
private anonymous array
Define private variables
Coded user options Only used in message files for communication with immopg.for 'change*_opt' subs change values of repeatedly used variables whereas other subs change values of variables more frequently modified by user
sub Step collects switches and assembles bash instructions by adding the program name
sub note collects switches and assembles bash instructions by adding the program name
sub _checkVbot When you use setVbot check what the current Vbot value is compared to former Vbot values
sub _checkVbot_upper_layer
When you use setVbot_upper_layer check what the current setVbot_upper_layer value is compared to former setVbot_upper_layer values
sub _checkVincrement
When you use Vincrement check what the current Vincrement value is compared to former Vincrement values
sub _checkVtop
When you modify, enter or leave VtopEntry widget check what the current Vtop value is compared to former Vtop values
sub _checkVtop_lower_layer
When you use Vtop_lower_layer check what the current Vtop_lower_layer value is compared to former Vtop_lower_layer values
sub _checkVbotNtop_factor
When you enter or leave check what the current VbotNtop_factor value is compared to former VbotNtop_factor values
sub _check_clip
When you enter or leave check what the current clip value is compared to former clip values
sub _check_layer
When you enter or leave check what the current layer value is compared to former layer values
If you enter the LayerEntry widget it will check before you change its value
If you enter another widget that now has the focus you will have to recall the current and prior values of the layerEntry widget
sub _check_thickness_m
When you modify, enter or leave thickness_mEntry widget check what the current thickness_m value is compared to former thickness_m values
sub _check_thickness_increment_m
When you enter or leave check what the current thickness_increment_m value is compared to former thickness_increment_m values
sub _get_control find corrected value
sub _get_control_clip adjust clip value
sub _get_control_layer adjust layer number
sub _get_data_scale
get scalco or scalel from file header
instantiate class
_get_initial_model
PERL PERL PROGRAM NAME: _get_initial_model
AUTHOR: Juan Lorenzo
DATE: May 21 2020
DESCRIPTION:
read Fortran 77 unformatted binary model file
from mmodpg
USE
Number of layers is passed as a variable Number of layers is read from an ascii version of the model data file
NOTES
Examples
CHANGES and their DATES 3.31.21 Consider storing model values and their changes within this namespace
_get_initial_model4gui
PERL PERL PROGRAM NAME: _get_initial_model4gui
AUTHOR: Juan Lorenzo
DATE: May 21 2020
DESCRIPTION:
read Fortran 77 unformatted binary model file
from mmodpg
USE
Number of layers is passed as a variable Number of layers is read from an ascii version of the model data file
NOTES
Examples
CHANGES and their DATES 3.31.21 Consider storing model values and their changes within this namespace
determine number of layers from model.text file
sub _getVp_ref_dz_ref Collect the currently update values in the model for layers and their velocities and thicknesses
sub _getVp_ref_dz_scalar Collect the currently update values in the model for layers and their velocities and thicknesses
sub _get_initialVp_dz4gui
sub _messages Show warnings or errors in a message box Message box is defined in main where it is also made invisible (withdraw) Here we turn on the message box (deiconify, raise) The message does not release the program until OK is clicked and wait variable changes from yes to no.
sub _setVbot
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _setVbot_upper_layer
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files _setVbot_upper_layer
instantiate classes
Define local variables
sub _setVbotNtop_factor
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files _setVbotNtop_factor
instantiate classes
Define local variables
sub _setVbotNtop_multiply Verify another lock file does not exist and only then: Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files _setVbotNtop_multiply
instantiate classes
Define local variables
sub _setVincrement
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _set_control Correct improper values
sub _set_initialVp_dz Establish the initial values from the model that will be used in the gui initially
sub _setVp_dz Dynamically collect values layers, layer velocities and thicknesses during interaction with user
sub _setVtop
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _setVtop_lower_layer
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _set_change
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _set_clip
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _set_thickness_m
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _set_thickness_increment_m
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _fortran_layer
set layer Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub set_working_model_bin
sub set_working_model_text
sub _set_clip_control value adjusts to current clip value in use
sub _set_layer_control value adjusts to current layer number in use
sub _get_model_control is there an error with the model?
sub set_model_control find out if there is an error in the binary fortran model
_set_model_layer Set the number of layers in mmodpg
sub _set_option
Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub _updateVbot
keep tabs on Vbot values and changes in the values in the GUI Also updates an shared copy of the model properties
use App::SeismicUnixGui::misc::control '0.0.3' method to check for bad values;
sub _updateVbot_upper_layer
keep tabs on upper layer Vbottom values and changes in the values in the GUI current layer must >0
sub _update_Vincrement
keep tabs on Vincrement values and changes in the values in the GUI
sub _updateVtop
keep tabs on Vtop values and changes in the values in the GUI Also updates an shared copy of the model properties
sub _updateVtop_lower_layer
keep tabs on Vtop_lower_layer values and changes in the values in the GUI Also updates an shared copy of the model properties
sub _updateVbotNtop_factor
keep tabs on VbotNtop_factor values and changes in the values in the GUI
sub _updateVbotNtop_multiply
keep tabs on Vbot AND Vtop values together and changes in the values in the GUI Also updates an shared copy of the model properties
sub _update_clip
keep tabs on clip values and changes in the values in the GUI
sub _update_thickness_m
keep tabs on thickness_m values and changes in the values in the GUI Also updates an shared copy of the model properties
sub _update_thickness_increment_m_in_gui
keep tabs on thickness_increment_m values and changes in the values in the GUI
sub _update_layer_in_gui
keep tabs on layer values and changes in the values in the GUI
update prior in advance of _check_layer
sub _update_lower_layer_in_gui
keep tabs on lower_layer values and changes in the values in the GUI
sub _update_upper_layer_in_gui
keep tabs on upper_layer values and changes in the values in the GUI
sub _writeVincrement
write out Vincrement
sub _writeVbotNtop_factor
write out VbotNtop_factor
sub _write_clip
write out clip
sub _write_thickness_increment_m
write out thickness_increment_m
sub _write_config
write out the new values as well as old values and their names to the configuration file called immodpg.config External parameter names do not agree always with variable names used inside the programs e.g., starting_layer versus layer or data_x_inc_m_m versus thickness_increment_m
correct errors
sub _set_simple_model_text
write out the model in ASCII format
sub get_initialVp_dz4gui
set_defaults 1. Get starting configuration parameters from configuration file directly and independently of main
Error control - clip ( ne 0) - layer number can be no smaller than 1 or greater than max-1
clip >=0
sub setVbot_minus
update Vbot value in gui update private value in this module
output option for immodpg.for
sub setVbot_plus
update Vbot value in gui update private value in this module output option for immodpg.for
sub setVtop_minus
update Vtop value in gui update private value in this module
output option for immodpg.for
sub setVtop_plus
update Vtop value in gui update private value in this module
output option for immodpg.for
sub cdp
sub clean_trash delete remaining locked files reset default files as well
sub clear
subroutine exit
sub get_control_clip adjust clip value
sub get_control_layer Layer value is adjustable Working layer number must be >= 1
sub get_max_index
max index = number of input variables -1
sub initialize_messages Create widgets that show messages Show warnings or errors in a message box Message box is defined in main where it is also made invisible (withdraw) Here we turn on the message box (deiconify, raise) The message does not release the program until OK is clicked and wait variable changes from yes to no.
message box withdraw temporarily while filling with widgets
Pack message box This Toplevel window has geometry that is independent of the main window widget. Upper frame contains message. Lower frame contains ok button.
sub initialize_model
Load into namespace the immodpg model to establish the first set of layers their velocities and thickness
sub get_number_of_layers
determine number of layers from model.text file
sub get_replacement4missing
sub setVbot
When you enter or leave check what the current Vbot value is compared to former Vbot values.
Vtop value is updated for immodpg.for through a message in file= "Vbot"
sub setVbot_upper_layer
When you enter or leave check what the current Vbot_upper_layer value is compared to former Vbot_upper_layer values Vtop value is updated in immodpg.for through a message in file= "Vbot_lower" (&_setVbot_upper_layer)
setVbotNVtop_lower_layer_minus update Vbot value in gui update Vtop_lower_layer value in gui update private value in this module
output option for immodpg.for
setVbotNVtop_lower_layer_plus update Vbot value in gui update Vtop_lower_layer value in gui update private value in this module
output option for immodpg.for
sub setVtopNVbot_upper_layer_minus update Vtop value in gui update Vbot_upper_layer value in gui update private value in this module
output option for immodpg.for
sub setVtopNVbot_upper_layer_plus
update Vtop value in gui update Vbot_upper_layer value in gui update private value in this module
output option for immodpg.for
sub setVincrement
When you enter or leave check what the current Vincrement value is compared to former Vincrement values
sub setVtop
When you enter or leave, check what the current Vtop value is compared to former Vtop values
Vtop value is updated in immodpg.for through a message in file= "Vtop" (&_setVtop)
sub setVtop_lower_layer
When you enter or leave check what the current Vtop_lower_layer value is compared to former Vtop_lower_layer values Vtop value is updated in immodpg.for through a message in file= "Vtop_lower_layer" (&_setVtop_lower_layer)
sub setVbotNtop_factor
When you enter or leave check what the current VbotNtop_factor value is compared to former VbotNtop_factor values
sub setVbotNtop_multiply Multiply Vbot and Vtop with factor
_updateVbotNtop_multiply gui values for widgets VbotEntry and VtopEntry
output option for immodpg.for
sub setVbotNtop_minus
update Vbot and Vtop values in gui update private svalue in this module output option for immodpg.for
sub setVbotNtop_plus
update Vbot and Vtop values in gui update private svalue in this module output option for immodpg.for
sub invert
sub lmute
sub premmod
prepare su file as a binary file for (i)mmodpg This program read a SU file, and creates the file: datammod which is a binary fortran file containing the SU file with no headers, and that can be read by program mmodpg. It also create the ascii file: parmmod containing basic parameters of the SU file (ntr,ns,dt) also used by mmodpg.
sub set_clip
When you enter or leave check what the current clip value is compared to former clip values
sub set_layer When you enter or leave check what the current layer value is compared to former layer values
Get model values from immodpg.out for initial settings in GUI If the layer changes, also change associated velocity values and thickness values of the new layer
sub set_layer_control Value adjusts to current layer number in use
sub set_missing
set_model_layer Set the number of layers in mmodpg
sub set_replacement4missing
sub set_thickness_m_minus
update _thickness_m value in gui update private value in this module
output option for immodpg.for
sub set_thickness_m_plus
update _thickness_m value in gui update private value in this module
output option for immodpg.for
sub set_update Save all values in the immodpg gui to immodpg.config
sub set_base_file_name
sub set_change verify another lock file does not exist and only then:
create another lock file while change file is written. that revents fortran file from reading Then delete lock file Aavoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub set_clip_control value adjusts to current clip value in use
sub set_option Verify another lock file does not exist and only then:
Create another lock file while change file is written that prevents fortran file from reading. Then, delete the lock file Avoids crash between asynchronous reading (fortran) and writing (Perl) of files
instantiate classes
Define local variables
sub smute
sub sscale
sub set_thickness_m
When you enter or leave, check what the current thickness_m value is compared to former thickness_m values
thickness_m value is updated in immodpg.for through a message in file="thickness_m" ($_set_thickness_m)
sub set_thickness_increment_m When you enter or leave check what the current thickness_increment_m value is compared to former thickness_increment_m values
thickness_increment_m value is updated in immodpg.for through a message in file= "thickness_increment_m" (&_set_thickness_increment_m)
sub tnmo
sub upward
sub vnmo
sub vnmo_mps
sub voutfile
3 POD Errors
The following errors were encountered while parsing the POD:
- Around line 82:
=pod directives shouldn't be over one line long! Ignoring all 2 lines of content
- Around line 4474:
=pod directives shouldn't be over one line long! Ignoring all 2 lines of content
- Around line 4557:
=pod directives shouldn't be over one line long! Ignoring all 2 lines of content