UG LIBRARY        : UNSTRUCTURED GRID GENERAL PURPOSE ROUTINES
-------------------------------------------------------

The following routines can be used to check, free, get, initialize, malloc,
read, set, and write UG parameters, free, malloc, and realloc arrays, write
error messages, write messages, and determine machine round-off.

  ug_case_name                    : Set or get case name.
  ug_copy_argv                    : Make a copy of the argument vector.
  ug_basename                     : Get base name from full file name with path.
  ug_check_param                  : Check UG parameters.
  ug_check_prog_param             : Check program arguments.
  ug_free_argv                    : Free argument vector.
  ug_free_param                   : Free UG parameter structure arrays.
  ug_get_char_param               : Get the value of a UG type char parameter.
  ug_get_double_param             : Get the value of a UG type double parameter.
  ug_get_double_param_vector      : Get the values for a UG type double
                                    parameter vector.
  ug_get_int_param                : Get the value of a UG type int parameter.
  ug_get_int_param_vector         : Get the values for a UG type int parameter
                                    vector.
  ug_get_param_from_value         : Get a UG parameter from a given value
                                    sub-string.
  ug_get_param_name_from_alt_names: Get corresponding UG parameter name from a
                                    list of alternative names.
  ug_get_param_name_from_string   : Get UG parameter name from a given string.
  ug_initialize_aflr_param        : Set the name, flag, default value, minimum
                                    allowable value, maximum allowable value,
                                    and description for common AFLR grid
                                    generation parameters.
  ug_initialize_param             : Set the name, flag, default value, minimum
                                    allowable value, maximum allowable value,
                                    and description for all common input
                                    parameters.
  ug_malloc_param                 : Malloc UG parameter structure arrays.
  ug_read_arg_file                : Read an input argument file (*.arg) and set
                                    the input argument vector.
  ug_read_param_file              : Read an input parameter file (*.par) and set
                                    the input argument vector.
  ug_realloc_param                : Realloc UG parameter structure arrays.
  ug_set_char_param               : Set the value of a UG type char parameter.
  ug_set_char_param_struct        : Set and initialize param structure for a
                                    given Char_Param.
  ug_set_double_param             : Set the value of a UG type double parameter.
  ug_set_double_param_struct      : Set and initialize param structure for a
                                    given Double_Param.
  ug_set_double_param_vector      : Set the values for a UG type double
                                    parameter vector.
  ug_set_int_param                : Set the value of a UG type int parameter.
  ug_set_int_param_struct         : Set and initialize param structure for a
                                    given Int_Param.
  ug_set_int_param_vector         : Set the values for a UG type int parameter
                                    vector.
  ug_set_double_vector            : Set double vector values in a char
                                    parameter.
  ug_set_int_vector               : Set integer vector values in a char
                                    parameter.
  ug_set_param_def                : Set UG parameter variables to default
                                    values.
  ug_set_params_from_arg          : Search the input arguments for UG parameters
                                    to read and re-set.
  ug_set_prog_param               : Malloc and initialize program related
                                    parameter structure arrays.
  ug_write_arg_file               : Write an input argument file.
  ug_write_param_info             : Write information about UG parameters to
                                    standard output.
  ug_write_prog_info              : Write usage and input parameter information
                                    on a given program.

  ug_add_arg
  ug_add_double_arg               : Add a type double argument.
  ug_add_double_vector_arg        : Add a type double vector argument.
  ug_add_flag_arg                 : Add a flag argument.
  ug_add_int_arg                  : Add a type int argument.
  ug_add_int_vector_arg           : Add a type int vector argument.
  ug_add_new_arg                  : Add a new argument to the argument vector.

  ug_rerun                        : Rerun with a new executable and the same
                                    options.
  ug_shutdown                     : Shut off memory and file status monitors and
                                    close output file.
  ug_startup                      : Start memory and file status monitors and
                                    create tmp directory using parameter options
                                    obtained from the argument vector.

  ug_malloc
  ug_free                  : Free array space.
  ug_calloc                : Allocate and initialize array space.
  ug_malloc                : Allocate array space.
  ug_realloc               : Re-allocate array space.

  ug_fio
  ug_file_format               : Check file format suffix and set byte order.
  ug_file_status_monitor       : Turn file status monitor on or off.
  ug_fclose                    : Close a binary socket, TMP, or regular file.
  ug_fopen                     : Open a binary socket, TMP, or regular file.
  ug_fread                     : Read from binary socket, TMP, or regular file.
  ug_fwrite                    : Write to binary socket, TMP, or regular file.
  ug_get_file_name_mode_flag   : Determine if a file name is associated with a
                                 binary socket, TMP, or neither.
  ug_get_file_stream_mode_flag : Determine if a file stream is associated with a
                                 binary socket, TMP, or neither.
  ug_rewind                    : Rewind a binary socket, TMP, or regular file.

  ug_fio_byte_order
  ug_get_byte_order        : Set host byte ordering.
  ug_reverse_byte_order    : Reverse byte order if file format and host byte
                             ordering differs.
  ug_set_byte_order        : Set file format and host to big or little endian
                             byte ordering.

  ug_fio_socket_file
  ug_close_socket_file                 : Close a binary socket file.
  ug_free_socket_files                 : Close all binary socket files and free
                                         socket file arrays.
  ug_get_file_name_socket_file_index   : Get index for a binary socket file that
                                         corresponds to a file name.
  ug_get_file_stream_socket_file_index : Get index for a binary socket file that
                                         corresponds to a file stream.
  ug_open_socket_file                  : Create a named binary socket file and
                                         open the file or return file stream
                                         only if it exists.
  ug_socket_file_read                  : Read from a binary socket file.
  ug_socket_file_write                 : Write to a binary socket file.
  ug_rewind_socket_file                : Rewind a binary socket file by closing
                                         existing socket and creating a new one
                                         linked to the original file stream.
  ug_fio_tmp_file
  ug_check_tmp_file                 : Check a binary TMP file by name.
  ug_close_data                     : Close a binary TMP file by file name.
  ug_close_dataf                    : Close a binary TMP file by file name but
                                      don't delete the file or remove it from
                                      the data structure. If the file is not a
                                      true file then it is rewound.
  ug_close_tmp_file                 : Close a binary TMP file by file stream.
  ug_free_tmp_files                 : Close all binary TMP files and free TMP
                                      file arrays and remove TMP directory.
  ug_get_file_name_tmp_file_index   : Get index for a named binary TMP file that
                                      corresponds to a file name.
  ug_get_file_stream_tmp_file_index : Get index for a named binary TMP file that
                                      corresponds to a file stream.
  ug_get_tmp_file_name              : Set binary TMP file name including
                                      directory path.
  ug_open_tmp_file                  : Create or attach a named binary TMP file
                                      and open the file or return file stream
                                      only if it exists.
  ug_remove_tmp_file                : Remove a binary TMP file by name if it is
                                      a true file.
  ug_rewind_data                    : Rewind a binary TMP file by file name.
  ug_set_tmp_file_dir               : Set binary TMP file directory and create
                                      it if directory doesn't exist.

  ug_cpu_message           : Write CPU time to standard output.
  ug_error_message         : Write a message to standard error output.
  ug_message               : Write a message to standard output.
  ug_open_output_file      : Open UG output file and set standard output flag.
  ug_system                : System level routines. They are named ug_### where
                             ### is typically the standard name. See files
                             ug_system.txt and ug_system.c for more information.

                             Routines that directly call system level routines.
                                ug_chdir
                                ug_chmod
                                ug_execv
                                ug_fileno
                                ug_fstat
                                ug_getcwd
                                ug_getenv
                                ug_getpid
                                ug_mkdir
                                ug_pclose
                                ug_popen
                                ug_rmdir
                                ug_remove
                                ug_rename
                                ug_stat
                                ug_system
                                ug_srandom
                                ug_random
                                ug_unlink

                             Routines that perform basic functions and call
                             system level routines.
                                ug_get_binary_file_mode
                                ug_get_cwd
                                ug_get_fullpath
                                ug_get_home_dir
                                ug_get_sys_info
                                ug_get_tmpdir
                                ug_open_tmpdir
                                ug_register_signal_cleanup
                                ug_remove_dir
                                ug_remove_file
                                ug_rename_file
                                ug_signal
                                ug_signal_handler
                                ug_signal_message
                                ug_splitpath
                                ug_splitdir
                                ug_splitname

  ug_date_time             : Get current date and time.
  ug_get_arch_info         : Get system architecture information for naming UG
                             architecture dependent directories.
  ug_get_items_from_list   : Get vector of items in a list.
  ug_find_file_in_path_list: Find given file in a directory included in a given
                             path list.
  ug_parse_text_string     : Write input string to standard output using one or
                             more lines of the default max line length or less.

  ug_mp
  ug_mp_setup              : Setup parallel processing mode.
  ug_mp                    : Perform parallel processing task.

  ug_get_double_array      : Get double array data from a tmp file.
  ug_get_int_array         : Get integer array data from a tmp file.
  ug_save_double_array     : Save double array data in a tmp file.
  ug_save_int_array        : Save integer array data in a tmp file.

  ug_get_data_size         : Get data read size from a tmp file.
  ug_get_double_data       : Incrementally get double array data from a tmp
                             file.
  ug_get_int_data          : Incrementally get integer array data from a tmp
                             file.
  ug_save_double_data      : Incrementally save double array data in a tmp
                             file.
  ug_save_int_data         : Incrementally save integer array data in a tmp
                             file.

  ug_copy_double           : Copy double array.
  ug_copy_int              : Copy integer array.
  ug_set_double            : Set double array.
  ug_set_int               : Set integer array.
  ug_iaib                  : Create an inverse list.
  ug_ivivm                 : Set map of non-sequential values to sequential
                             values.
  ug_avg_double            : Get average value in an DOUBLE array
  ug_lim_double            : Limit maximum value in an DOUBLE array
  ug_lim_int               : Limit maximum value in an INT array
  ug_max_double            : Get maximum value in a double array.
  ug_max_int               : Get maximum value in an INT_ array.
  ug_min_double            : Get minimum value in a double array.
  ug_min_int               : Get minimum value in an INT_ array.
  ug_random_list           : Create a random list of numbers.
  ug_renumber_int_values   : Renumber a list of integer values so that the
                             values are in either consecutive and ascending
                             order 1,2,3... or consecutive and first
                             encountered
                             order and save a map of the new values.
  ug_sort_double_list      : Sort a list of double values and create a
                             corresponding index.
  ug_sort_int_list         : Sort a list of integer values and create a
                             corresponding index.
  ug_sort_string_list      : Sort a list of integer values and create a
                             corresponding index.

  ug_backup_file           : Backup file.
  ug_check_file            : Check if file exists.
  ug_compress_file         : Compress file.
  ug_copy_file             : Copy file.
  ug_uncompress_file       : Uncompress file.

  ug_round_off_error       : Determine machine round-off error.

  ug_version               : Get compile date and OS for ug library.
  ug_version_info          : Write library version information.

To use these routines, the UG libraries must be linked using the following
compiler flags.

   -Lsimsys_sys_dir -lug

The directory simsys_sys_dir is the SimSys system directory. C or C++ source
code that contain a call to one of the UG routines must have the following
include statement.

   #include "simsys_sys_dir/src/ug/UG_LIB.h"

The UG include file, simsys_sys_dir/ug/UG_LIB.h, includes UG library routine
header files along with UG library macro function definitions (see ug_macro.h
and ug_macro.txt), type definitions (see ug_typedef.h and ug_typedef.txt), and
structures (see UG_Param_Struct.h).

All UG related code use the UG library routines for all memory management
(ug_free, ug_malloc, and ug_realloc), all standard output (ug_message), and all
standard error output (ug_error_message). These basic routines can be modified
to change memory management, redirect standard output, and/or redirect standard
error output for all UG related code.

A testing routine is also provided in directory simsys_sys_dir/src/ug/. This
routine is commented and provide examples of implementing all of the UG library 
routines. The executable ug.exe can be used to test ug routines. The testing
routine is listed below.

  ug.c                       : This is a testing program that calls all of the
                               UG_LIB routines except ug_pclose, ug_popen,
                               ug_shutdown, and ug_startup.

