PURPOSE

To write a block of data to a FMS Matrix or Vector File

SYNOPSIS

CALL FMSPUT (LUFMS, NROWS, NCOLS, IROW1, JCOL1, A(NROWS,NCOLS), LDA)

INPUT PARAMETERS

OUTPUT PARAMETERS

None.

FMS PARAMETERS

The following FMS Parameters are especially important to this routine:
Parameter Description
LOWASM First changed equation for nonlinear assembly.
IOKIDS Allow children to access a file

DESCRIPTION:

This subroutine provides write access to FMS Matrix and Vector files. The array DATA(NROWS,NCOLS) is transferred directly to the file LUFMS without buffering.

To use this subroutine, you must first open file LUFMS using subroutine RSDI, RNDI, CHDI, CSDI, CNDI for matrix files, or subroutine FMSOV or FMSOV2 for vector files.

You then initialize FMSPUT to receive data by making one of the following calls:

CALL FMSPUT LUFMS contents
CALL FMSPUT (LUFMS, 0, 0, 0, 0, 0, 0) Vector file
Nonsymmetric matrix file
Symmetric matrix defined by terms in the upper triangle.
CALL FMSPUT (LUFMS, 0, 0, 1, 0, 0, 0) Symmetric matrix defined by terms in the lower triangle.
The 0 value arguments direct FMS to initialize the files to receive data. This call must precede calls to FMSPUT which transfer data.

For symmetric matrices, you may either define the terms in the upper OR lower triangle, but not both. If you use the first form to initialize FMSPUT with IROW1=0, FMSPUT will only transfer terms in the upper triangle and diagonal. Any term in array DATA which falls in the lower triangle is ignored. If you use the second form to initialize FMSPUT with IROW1=1, FMSPUT will only transfer terms in the lower triangle and diagonal. Any term in array DATA which falls in the upper triangle is ignored.

FMS stores data in matrix files in a direction proceeding toward the diagonal. Therefore if your DATA array is not square, one of the options for defining symmetric matrix data will be more efficient than the other. If NROWS>NCOLS, it is more efficient to populate the upper triangle. If NCOLS>NROWS, it is more efficient to populate the lower triangle.

The second step is to call FMSPUT as many times as you want to define the data. FMS does not initialize the file to zero or check if all the data on the file is defined. It is your responsibility to define all the data.

The final step is to direct FMS to release any storage. This is accomplished by making the following call:

        CALL FMSPUT (LUFMS, 0, 0, NUMEQ+1, 0, 0, 0)

where the value of IROW1=NUMEQ+1 is greater than the number of equations.

At this point the data has been transferred to the FMS file. For vector files and incore matrix files, the operation is complete. For disk-based matrix files, however, the data is not standard FMS file format. This conversion will happen automatically during matrix assembly/factoring when subroutine RSDAF, RNDAF, CHDAF, CSDAF ,CNDAF is called. When calling the assemble/factor subroutine, you specify this matrix file LUFMS as an input matrix file.

You may call FMSPUT from subroutines you are running in parallel (which you started by calls to FMSPAR). This can reduce the time required to fill the matrix and vector arrays. To use this feature, you must direct FMS to open the file LUFMS for access by multiple processes. Use the FMS Parameter IOKIDS before the call which opens file LUFMS. The first and last calls to FMSPUT, which are used for setup and completion, must be called by the parent process before and after the calls to FMSPAR respectively.

Examples

Example 13 further illustrates how to use FMSPUT to populate a matrix and vectors.