ROUTINE
-------

INT_ ug_io_write_func_file (char Func_File_Name[],
                            INT_ Message_Flag,
                            INT_ NDim,
                            INT_ Number_of_Nodes,
                            INT_ Number_of_U_Scalars,
                            INT_ Number_of_U_Vectors,
                            INT_ Number_of_U_Matrixes,
                            INT_ Number_of_U_Metrics,
                            CHAR_21 * U_Scalar_Labels,
                            CHAR_21 * U_Vector_Labels,
                            CHAR_21 * U_Matrix_Labels,
                            CHAR_21 * U_Metric_Labels,
                            INT_1D * U_Scalar_Flags,
                            INT_1D * U_Vector_Flags,
                            INT_1D * U_Matrix_Flags,
                            INT_1D * U_Metric_Flags,
                            DOUBLE_1D * U_Scalars,
                            DOUBLE_1D * U_Vectors,
                            DOUBLE_1D * U_Matrixes,
                            DOUBLE_1D * U_Metrics)

DESCRIPTION
-----------

Write function data to a standard UG function file.

INPUT ARGUMENTS
---------------

Func_File_Name           : Function data file name.
                           If the function data file name is blank or NULL then
                           nothing is done.

Message_Flag             : Output message flag.
                           If Message_Flag =  0 then no information messages
                           are written.
                           If Message_Flag >= 1 then information messages are
                           written to standard output.

NDim                     : Geometry dimension flag.
                           If NDim = 2 then the geometry is 2D.
                           If NDim = 3 then the geometry is 3D.

Number_of_Nodes          : Number of nodes.

Number_of_U_Scalars      : Number of scalar function data variables.

Number_of_U_Vectors      : Number of vector function data variables.

Number_of_U_Matrixes     : Number of matrix function data variables.

Number_of_U_Metrics      : Number of metric function data variables.

U_Scalar_Labels          : Label for each scalar function data variable.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Scalars-1.

U_Vector_Labels          : Label for each vector function data variable.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Vectors-1.
                           Number_of_U_Scalars-1.

U_Matrix_Labels          : Label for each matrix function data variable.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Matrixes-1.

U_Metric_Labels          : Label for each metric function data variable.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Metrics-1.

U_Scalar_Flags           : Flag for each scalar function variable available.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Scalars-1.
                           If U_Scalar_Flags[U_Scalar_Index] = 1 then the
                           scalar variable associated with U_Scalar_Index is
                           allocated and will be written.
                           If U_Scalar_Flags[U_Scalar_Index] = -1 then the
                           scalar variable associated with U_Scalar_Index is
                           allocated and will not be written.
                           If U_Scalar_Flags[U_Scalar_Index] = 0 then the
                           scalar variable associated with U_Scalar_Index is
                           not allocated.

U_Vector_Flags           : Flag for each vector function variable available.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Vectors-1.
                           If U_Vector_Flags[U_Vector_Index] = 1 then the
                           vector variable associated with U_Vector_Index is
                           allocated and will be written.
                           If U_Vector_Flags[U_Vector_Index] = -1 then the
                           vector variable associated with U_Vector_Index is
                           allocated and will not be written.
                           If U_Vector_Flags[U_Vector_Index] = 0 then the
                           vector variable associated with U_Vector_Index is
                           not allocated.

U_Matrix_Flags           : Flag for each matrix function variable available.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Matrixes-1.
                           If U_Matrix_Flags[U_Matrix_Index] = 1 then the
                           matrix variable associated with U_Matrix_Index is
                           allocated and will be written.
                           If U_Matrix_Flags[U_Matrix_Index] = -1 then the
                           matrix variable associated with U_Matrix_Index is
                           allocated and will not be written.
                           If U_Matrix_Flags[U_Matrix_Index] = 0 then the
                           matrix variable associated with U_Matrix_Index is
                           not allocated.

U_Metric_Flags           : Flag for each metric function variable available.
                           This array uses "C" style indexing with a primary
                           index which ranges from zero to
                           Number_of_U_Metrics-1.
                           If U_Metric_Flags[U_Metric_Index] = 1 then the
                           metric variable associated with U_Metric_Index is
                           allocated and will be written.
                           If U_Metric_Flags[U_Metric_Index] = -1 then the
                           metric variable associated with U_Metric_Index is
                           allocated and will not be written.
                           If U_Metric_Flags[U_Metric_Index] = 0 then the
                           metric variable associated with U_Metric_Index is
                           not allocated.

U_Scalars                : Scalar function data variables.
                           This array uses "FORTRAN" style indexing with an
                           index which ranges from one to Number_of_Nodes. Array
                           location zero is not used.
                           Scalar function data are stored one after another
                           with Number_of_Nodes entries for each.

U_Vectors                : Vector function data variables.
                           This array is stored as a DOUBLE_3D (U_Vectors[][3]).
                           This array uses "FORTRAN" style indexing with a
                           primary index which ranges from one to
                           Number_of_Nodes. Array location zero is not used.
                           The secondary index uses "C" style indexing with an
                           index which ranges from zero to two corresponding to
                           the three coordinates (X,Y,Z) for a particular node.
                           Vector function data are stored one after another
                           with 3*Number_of_Nodes entries for each.

U_Matrixes               : Matrix function data variables.
                           This array is stored as a DOUBLE_9D (U_Matrixes[][9]).
                           This array uses "FORTRAN" style indexing with an
                           index which ranges from one to Number_of_Nodes. Array
                           location zero is not used. The secondary index uses
                           "C" style indexing with an index which ranges from
                           zero to eight corresponding to the nine coefficients
                           in the matrix. The matrix coefficients are stored as
                           shown below.

                                     --                      --
                                    | met[0]   met[1]   met[2] |
                                M = | met[3]   met[4]   met[5] |
                                    | met[6]   met[7]   met[8] |
                                     --                      --

                           Matrix function data are stored one after another
                           with 9*Number_of_Nodes entries for each.

U_Metrics                : Metric function data variables.
                           This array is stored as a DOUBLE_6D (U_Metrics[][6]).
                           This array uses "FORTRAN" style indexing with an
                           index which ranges from one to Number_of_Nodes. Array
                           location zero is not used. The secondary index uses
                           "C" style indexing with an index which ranges from
                           zero to five corresponding to the six coefficients in
                           the symmetric metric for a particular node. The
                           metric coefficients are stored as shown below.

                                     --                      --
                                    | met[0]   met[1]   met[2] |
                                M = | met[1]   met[3]   met[4] |
                                    | met[2]   met[4]   met[5] |
                                     --                      --

                           Metric function data are stored one after another
                           with 6*Number_of_Nodes entries for each.

RETURN VALUE
------------

0                        : No errors occurred writing function data file.
<0                       : The function data file name is blank, NULL, or is not
                           a standard UG node data file. Nothing is done in this
                           case.
                           The return value will be -1.
>0                       : Errors occurred writing function data file.
                           The return value will be between 600 and 699.
