1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Array Arguments</TITLE>
<META NAME="description" CONTENT="Array Arguments">
<META NAME="keywords" CONTENT="lug_l2h">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="lug_l2h.css">
<LINK REL="next" HREF="node117.html">
<LINK REL="previous" HREF="node115.html">
<LINK REL="up" HREF="node110.html">
<LINK REL="next" HREF="node117.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html5845"
HREF="node117.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next_motif.png"></A>
<A NAME="tex2html5839"
HREF="node110.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up_motif.png"></A>
<A NAME="tex2html5833"
HREF="node115.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="previous_motif.png"></A>
<A NAME="tex2html5841"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents_motif.png"></A>
<A NAME="tex2html5843"
HREF="node152.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index_motif.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html5846"
HREF="node117.html">Work Arrays</A>
<B> Up:</B> <A NAME="tex2html5840"
HREF="node110.html">Design and Documentation of</A>
<B> Previous:</B> <A NAME="tex2html5834"
HREF="node115.html">Problem Dimensions</A>
  <B> <A NAME="tex2html5842"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html5844"
HREF="node152.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION03516000000000000000"></A><A NAME="subsecarrayargs"></A>
<BR>
Array Arguments
</H2>
<P>
Each two-dimensional array argument<A NAME="19524"></A> is
immediately followed in the
argument list by its leading dimension<A NAME="19525"></A>, whose
name has the form LD<B><</B>array-name<B>></B>. For example:
<DIV ALIGN="CENTER">
</DIV><TABLE WIDTH="547">
<TR><TD>
<DT>A
<DL COMPACT><DD>(input/output) REAL/COMPLEX array, dimension (LDA,N)
<BR>
...
<P>
<DT>LDA
<DD>(input) INTEGER
<BR>
The leading dimension of the array A. LDA <IMG
WIDTH="18" HEIGHT="30" ALIGN="MIDDLE" BORDER="0"
SRC="img913.png"
ALT="$\geq$">
max(1,M).
</DL>
</TD></TR>
</TABLE>
<DIV ALIGN="CENTER">
</DIV>
<P>
It should be assumed, unless stated otherwise, that vectors and
matrices are stored in one- and two-dimensional arrays in the
conventional manner. That is, if an array X of dimension (N) holds
a vector <B><I>x</I></B>, then X(i) holds <B><I>x</I><SUB><I>i</I></SUB></B> for
<!-- MATH
$i = 1, \ldots, n$
-->
<IMG
WIDTH="92" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
SRC="img915.png"
ALT="$i = 1, \ldots, n$">.
If a two-dimensional array A of dimension (LDA,N) holds an <B><I>m</I></B>-by-<B><I>n</I></B>
matrix <B><I>A</I></B>,
then A(<B><I>i</I>,<I>j</I></B>) holds <B><I>a</I><SUB><I>ij</I></SUB></B> for
<!-- MATH
$i = 1, \ldots, m$
-->
<IMG
WIDTH="96" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
SRC="img916.png"
ALT="$i = 1, \ldots, m$">
and
<!-- MATH
$j = 1, \ldots, n$
-->
<IMG
WIDTH="94" HEIGHT="31" ALIGN="MIDDLE" BORDER="0"
SRC="img917.png"
ALT="$j = 1, \ldots, n$">
(LDA must be at least <B><I>m</I></B>).
See Section <A HREF="node121.html#secstorage">5.3</A> for more about
storage of matrices.
<P>
Note that<A NAME="19549"></A>
array arguments are usually declared in the software as assumed-size arrays
(last dimension *), for example:
<PRE>
REAL A( LDA, * )
</PRE>
although the documentation gives the dimensions as (LDA,N). The latter
form is more informative since it specifies the required minimum value of
the last dimension. However
an assumed-size array declaration has been used in the software,
in order to overcome some
limitations in the Fortran 77 standard. In particular it allows the
routine to be called when the relevant dimension (N, in this case) is zero.
However actual array dimensions in the calling program must be at
least 1 (LDA in this example).
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html5845"
HREF="node117.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next_motif.png"></A>
<A NAME="tex2html5839"
HREF="node110.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up_motif.png"></A>
<A NAME="tex2html5833"
HREF="node115.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="previous_motif.png"></A>
<A NAME="tex2html5841"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents_motif.png"></A>
<A NAME="tex2html5843"
HREF="node152.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index_motif.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html5846"
HREF="node117.html">Work Arrays</A>
<B> Up:</B> <A NAME="tex2html5840"
HREF="node110.html">Design and Documentation of</A>
<B> Previous:</B> <A NAME="tex2html5834"
HREF="node115.html">Problem Dimensions</A>
  <B> <A NAME="tex2html5842"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html5844"
HREF="node152.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
<I>Susan Blackford</I>
<BR><I>1999-10-01</I>
</ADDRESS>
</BODY>
</HTML>
|