Program MTXBUILD

Usage

    setenv  <coefffile>  <path name> or "NONE"
    setenv  <outfile>    <path name>
    setenv  GRIDDESC     <path name>
    
    mtxbuild <and respond to the prompts>
where coefffile and outfile are the logical names of the input ASCII transform-coefficient file and the output sparse-matrix transform file.

Summary

The MTXBUILD program reads in an ASCII list-formatted file specifying the transform coefficients for the grid transformation being constructed, and then builds an I/O API sparse-matrix output file for the transform matrix, as might be used by program MTXCPLE or by the SMOKE emissions modeling system.

The ASCII transform coefficients file should optionally have a header consisting of lines beginning with the character "#" and including fields

#INGRID  input grid name
#OUTGRID output grid name
specifying the names of the input and output groid, as these are found in the GRIDDESC file, The transform coefficients file should also contain data lines with the following fields, formatted according to Fortran list-formatting conventions (fields delimited by whitespace or commas):
  1. output grid row numbe
  2. output grid column number
  3. input grid row number
  4. input grid column number
  5. transform-coefficient
These lines should be sorted into lexicographic order relative to the first two fields (i.e., output rows should be in increasing order, and for each output row, the output columns should likewise bein increasing order).

Requires Fortran-90 for compilation.

Before you run the program, you need to assign logical names to the physical file names of both files and to the GRIDDESC file, according to Models-3 conventions, using the operation

    "setenv <lname> <pname>"
The program will prompt you for the logical names you have chosen for the input and output files, and for the GRIDDESC names of the input and output grid if these are not found in the input file header

If you want to run this program in batch mode (from a script), the recommended way to develop the script is to run the program once interactively noting the pattern of responses to prompts which generate the particular execution you want. The pattern of responses then becomes either a command-input file which you may redirect into the program in the script, or may become a "here-document" fed into the execution by the script. One such script, to build a sparse transform matrix to be used by program MTXCPLE to interpolate from grid EU50_131X110 to grid UK108_25X28, using coefficient file FRACTIONS computed by an off-line GIS computation, is given below:

#!/bin/csh
#
#  Script to run /env/proj/ppar/smoke/Run.mtxbuild for the 
#  INNOGY UK108_25X28 test case
#
limit stacksize unlimited
limit memoryuse unlimited
#
#	Directory for executables:
#
setenv BIN   /env/proj/ppar/IRIX6n32f90
#
setenv DATA  /env/data/coats/EU
#
setenv  GRIDDESC     ${DATA}/GRIDDESC.EU
setenv  FRACTIONS    ${DATA}/EU_coeffs.UK108_25X28
setenv  MATRIX_FILE  ${DATA}/EU_to_UK108_25X28.matrix.ncf
#
unsetenv LOGFILE
set UI=/tmp/mtxbuild.$$
echo "Yes, continue with program"  > ${UI}
echo "FRACTIONS"                  >> ${UI}
echo "EU50_131X110"               >> ${UI}
echo "UK108_25X28"                >> ${UI}
echo " "                          >> ${UI}
echo '------------------------------------------------------------------'
env
echo '------------------------------------------------------------------'
echo "UI command-line input:"
cat ${UI}
echo '------------------------------------------------------------------'

${BIN}/mtxbuild < ${UI}
set errornum=${status}

echo '------------------------------------------------------------------'
rm ${UI}
if ( ${errornum} != 0 )  echo "ERROR ${errornum} on program "

exit ( ${errornum} )

See Also:


Previous: M4FILTER

Next: MTXCALC

Up: Related Programs

To: Models-3/EDSS I/O API: The Help Pages