setenv  COL_REFINEMENT  <column-sampling factor (default 100)>
    setenv  ROW_REFINEMENT  <row-sampling factor (default 100)>
    setenv  GRIDDESC     <path name>
    setenv  MATRIX       <path name>
    setenv  MATTXT       <path name>, or "NONE"
    MTXCALC [INGRID OUTGRID] <and respond to the prompts>
where INGRID and OUTGRID are the GRIDDESC names of the input and output grids for the transformation.


The MTXCALC program calculates an approximate sparse grid-to-grid transform matrix for specified input and output grids, and writes the result to an I/O API sparse-matrix output file for file-to-file/grid-to-grid conversions in programs MTXCPLE and MTXBLEND, and optionally to output an ASCII "fractions" file such as is used by program MTXBUILD and for quality assurance. The approximation algorithm used is to sub-sample each input cell using a subsampled grid of user-selected refinement ratios COL_REFINEMENT by ROW_REFINEMENT (which default to 100 × 100).

Requires Fortran-90 for compilation. The following input and output coordinate systems are supported:

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

    "setenv <lname> <pname>"
The program will prompt you, if needed, for the GRIDDESC names of the input and output grids if these are not found on the command line.

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 RT45 to grid NC12:

#  Script to run /env/proj/ppar/smoke/Run.MTXCALC 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/shared
setenv  GRIDDESC     ${DATA}/GRIDDESC.realtime
setenv  MATRIX       ${DATA}/RT45_to_NC12.matrix.ncf
setenv  MATTXT       ${DATA}/RT45_to_NC12.matrix.txt
unsetenv LOGFILE
set UI=/tmp/MTXCALC.$$
echo "Yes, continue with program"  > ${UI}
echo "RT45"                  >> ${UI}
echo "NC12"                  >> ${UI}
echo " "                     >> ${UI}
echo '------------------------------------------------------------------'
echo '------------------------------------------------------------------'
echo "UI command-line input:"
cat ${UI}
echo '------------------------------------------------------------------'

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

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

exit ( ${errornum} )

See Also:

Previous: MTXBUILD


Up: Related Programs

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