<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?>
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve"><head><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><title>D02NUF : NAG Library, Mark 22</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a class="rout" href="../../pdf/D02/d02nuf.pdf">D02NUF (PDF version)</a></div><div><a class="chap" href="d02conts.xml">D02 Chapter Contents</a></div><div><a class="chapint" href="d02intro.xml">D02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div><hr/><h1 class="libdoc">NAG Library Routine Document<br/><br/>D02NUF</h1><div class="paramtext"><div class="header"><b>Note:</b>&#160; before using this routine, please read the Users' Note for your implementation to check the interpretation of <span class="bitalic">bold italicised</span> terms and other implementation-dependent details.</div></div> 
<div class="htmltoc">
<h2 class="htmltoc"><span class="htmltochead" onclick="showLevel('htmltoc');"><span class="htmltocplus" id="htmltocplus">+</span><span class="htmltocminus" id="htmltocminus">&#8722;</span></span>&#160;Contents</h2>
<div class="htmltocitem" id="htmltoc">
<div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#purpose">1&#160;&#160;<b>Purpose</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#specification">2&#160;&#160;<b>Specification</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#description">3&#160;&#160;<b>Description</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#references">4&#160;&#160;<b>References</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#parameters">5&#160;&#160;<b>Parameters</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#errors">6&#160;&#160;<b>Error Indicators and Warnings</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#accuracy">7&#160;&#160;<b>Accuracy</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#fcomments">8&#160;&#160;<b>Further Comments</b></a>
</div><div class="htmltoc">
<span class="htmltocplus">&#160;&#160;&#160;</span>
<a class="htmltoc" href="#example">9&#160;&#160;<b>Example</b></a>
</div>
</div>
</div><h2 class="standard"><a class="sec" name="purpose" id="purpose"/>1&#160;&#160;Purpose</h2>
<div class="paramtext">D02NUF is a setup routine which must be called prior to an integrator in <a class="chap" href="../D02/d02conts.xml">sub-chapter D02M&#8211;N</a>, if sparse matrix linear algebra is required.</div><h2 class="standard"><a class="sec" name="specification" id="specification"/>2&#160;&#160;Specification</h2>
<table class="fspec"><tr><td class="tdfspec1">SUBROUTINE&#160;D02NUF&#160;(</td><td class="tdfspec2"><a class="arg" href="#NEQ">NEQ</a>, <a class="arg" href="#NEQMAX">NEQMAX</a>, <a class="arg" href="#JCEVAL">JCEVAL</a>, <a class="arg" href="#NWKJAC">NWKJAC</a>, <a class="arg" href="#IA">IA</a>, <a class="arg" href="#NIA">NIA</a>, <a class="arg" href="#JA">JA</a>, <a class="arg" href="#NJA">NJA</a>, <a class="arg" href="#JACPVT">JACPVT</a>, <a class="arg" href="#NJCPVT">NJCPVT</a>, <a class="arg" href="#SENS">SENS</a>, <a class="arg" href="#U">U</a>, <a class="arg" href="#ETA">ETA</a>, <a class="arg" href="#LBLOCK">LBLOCK</a>, <a class="arg" href="#ISPLIT">ISPLIT</a>, <a class="arg" href="#RWORK">RWORK</a>, <a class="arg" href="#IFAIL">IFAIL</a>)</td></tr><tr><td class="tdfspec1">INTEGER</td><td class="tdfspec2">NEQ, NEQMAX, NWKJAC, IA(NIA), NIA, JA(NJA), NJA, JACPVT(NJCPVT), NJCPVT, ISPLIT, IFAIL</td></tr><tr><td class="tdfspec1"><b><i>double&#160;precision</i></b></td><td class="tdfspec2">SENS, U, ETA, RWORK(50+4*NEQMAX)</td></tr><tr><td class="tdfspec1">LOGICAL</td><td class="tdfspec2">LBLOCK</td></tr><tr><td class="tdfspec1">CHARACTER*1</td><td class="tdfspec2">JCEVAL</td></tr></table><h2 class="standard"><a class="sec" name="description" id="description"/>3&#160;&#160;Description</h2>
<div class="paramtext">D02NUF defines the linear algebra to be used as sparse matrix linear algebra, permits you to specify the method for calculating the Jacobian and its structure, and checks the validity of certain input values.</div><h2 class="standard"><a class="sec" name="references" id="references"/>4&#160;&#160;References</h2>
<div class="paramtext">See the <a class="chapint" href="../D02/d02mnintro.xml">D02M&#8211;N sub-chapter Introduction</a>.</div><h2 class="standard"><a class="sec" name="parameters" id="parameters"/>5&#160;&#160;Parameters</h2>
<dl><dt class="paramhead"><a name="NEQ" id="NEQ"/>1: &#160;&#160;&#8194; NEQ &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the number of differential equations.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQMAX</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="NEQMAX" id="NEQMAX"/>2: &#160;&#160;&#8194; NEQMAX &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: a bound on the maximum number of differential equations to be solved during the integration.</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQMAX</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>.
</div></dd><dt class="paramhead"><a name="JCEVAL" id="JCEVAL"/>3: &#160;&#160;&#8194; JCEVAL &#8211; CHARACTER*1<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: specifies the technique to be used to compute the Jacobian. 
<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math></dt>
<dd>The sparsity structure and the value of the Jacobian are to be determined numerically by the integrator.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math></dt>
<dd>The sparsity structure of the Jacobian is supplied in the arrays <a class="arg" href="#IA">IA</a> and <a class="arg" href="#JA">JA</a> but its value is to be determined numerically. This is the recommended mode of operation unless it is a simple matter to supply the Jacobian.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'A'</m:mtext></m:math></dt>
<dd>The Jacobian will be evaluated by calls to <a class="arg" href="../D02/d02ndf.xml#JAC">JAC</a>. The sparsity structure will be estimated by calls to <a class="arg" href="../D02/d02ndf.xml#JAC">JAC</a>; that is, no explicit sparsity structure need be supplied in the arrays <a class="arg" href="#IA">IA</a> and <a class="arg" href="#JA">JA</a>.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'F'</m:mtext></m:math></dt>
<dd>The sparsity structure of the Jacobian is supplied in <a class="arg" href="#IA">IA</a> and <a class="arg" href="#JA">JA</a>, and its value will be determined by calls to <a class="arg" href="../D02/d02ndf.xml#JAC">JAC</a>. This is the recommended mode of operation if the <a class="arg" href="../D02/d02ndf.xml#JAC">JAC</a> is simple to form.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'D'</m:mtext></m:math></dt>
<dd>The default choice is to be made. In this case 'D' is interpreted as 'S'.</dd></dl>
<div class="paramtext">If the sparsity structure is supplied in arrays <a class="arg" href="#IA">IA</a> and <a class="arg" href="#JA">JA</a>, then any evidence from the numerical or analytical formation of the Jacobian that this structure is not correct, is ignored.</div>
<div class="paramtext">Only the first character of the actual parameter <a class="arg" href="#JCEVAL">JCEVAL</a> is passed to D02NUF; hence it is permissible for the actual argument to be more descriptive, e.g., &#8216;Numerical&#8217;, &#8216;Structural&#8217;, &#8216;Analytical&#8217;, &#8216;Full information&#8217; or &#8216;Default&#8217; in a call to D02NUF.</div>
<div class="paramtext">If the option <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>, <m:math><m:mtext>'S'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>&#160;is used then the actual argument corresponding to <a class="arg" href="../D02/d02ndf.xml#JAC">JAC</a> in the call to <a class="rout" href="../D02/d02ndf.xml">D02NDF</a> or <a class="rout" href="../D02/d02njf.xml">D02NJF</a> must be either D02NDZ or D02NJZ respectively.</div>
</div><div class="paramtext"><i>Constraint</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>, <m:math><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'A'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>.
</div></dd><dt class="paramhead"><a name="NWKJAC" id="NWKJAC"/>4: &#160;&#160;&#8194; NWKJAC &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the size of the array <a class="arg" href="../D02/d02nbf.xml#WKJAC">WKJAC</a>, which you are supplying to the integrator, as declared in the (sub)program from which D02NUF is called.</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NWKJAC"><m:mi mathcolor="#EE0000" mathvariant="bold">NWKJAC</m:mi></m:maction><m:mo>=</m:mo><m:mn>4</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQMAX</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>&#160;or <m:math><m:mtext>'A'</m:mtext></m:math>. If <a class="arg" href="#NWKJAC">NWKJAC</a> is less than this estimate, then a message is printed on the current advisory message unit (see <a class="rout" href="../X04/x04abf.xml">X04ABF</a>), and execution continues.</div><div class="paramtext"><i>Constraint</i>:
  
if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NWKJAC"><m:mi mathcolor="#EE0000" mathvariant="bold">NWKJAC</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mi mathvariant="italic">nelement</m:mi><m:mo>+</m:mo><m:mn>2</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>, where <m:math><m:mi mathvariant="italic">nelement</m:mi></m:math>&#160;is the total number of nonzeros.
</div></dd><dt class="paramhead"><a name="IA" id="IA"/>5: &#160;&#160;&#8194; IA(<a class="arg" href="#NIA">NIA</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>, <a class="arg" href="#IA">IA</a> must contain details of the sparsity pattern to be used for the Jacobian. See <a class="arg" href="#JA">JA</a>.
<div class="paramtext"><a class="arg" href="#IA">IA</a> is not used if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>&#160;or <m:math><m:mtext>'A'</m:mtext></m:math>.</div>
</div></dd><dt class="paramhead"><a name="NIA" id="NIA"/>6: &#160;&#160;&#8194; NIA &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the dimension of the array <a class="arg" href="#IA">IA</a> as declared in the (sub)program from which D02NUF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NIA"><m:mi mathcolor="#EE0000" mathvariant="bold">NIA</m:mi></m:maction><m:mo>&#8805;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:math>;</li>
<li class="listcons">otherwise <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NIA"><m:mi mathcolor="#EE0000" mathvariant="bold">NIA</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="JA" id="JA"/>7: &#160;&#160;&#8194; JA(<a class="arg" href="#NJA">NJA</a>) &#8211; INTEGER array<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>, <a class="arg" href="#JA">JA</a> must contain details of the sparsity pattern to be used for the Jacobian. <a class="arg" href="#JA">JA</a> contains the row indices where nonzero elements occur, reading in column-wise order, and <a class="arg" href="#IA">IA</a> contains the starting locations in <a class="arg" href="#JA">JA</a> of the descriptions of columns <m:math><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>&#160;in that order, with <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IA"><m:mi mathcolor="#EE0000" mathvariant="bold">IA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mn>1</m:mn></m:mfenced></m:mrow><m:mo>=</m:mo><m:mn>1</m:mn></m:math>. Thus for each column index <m:math><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>, the values of the row index <m:math><m:mi>i</m:mi></m:math>&#160;in column <m:math><m:mi>j</m:mi></m:math>&#160;where a nonzero element may occur are given by 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <m:mi>i</m:mi><m:mo>=</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#JA"><m:mi mathcolor="#EE0000" mathvariant="bold">JA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>k</m:mi></m:mfenced></m:mrow> </m:math></td><td class="formula2"/></tr></table></div>
 where <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IA"><m:mi mathcolor="#EE0000" mathvariant="bold">IA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>j</m:mi></m:mfenced></m:mrow><m:mo>&#8804;</m:mo><m:mi>k</m:mi><m:mo>&lt;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IA"><m:mi mathcolor="#EE0000" mathvariant="bold">IA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:mi>j</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow></m:math>.
<div class="paramtext">Thus the total number of nonzeros, <m:math><m:mi mathvariant="italic">nelement</m:mi></m:math>, must be <m:math><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IA"><m:mi mathcolor="#EE0000" mathvariant="bold">IA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:math>. For example, for the following matrix 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <m:mfenced><m:mtable> <m:mtr> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> </m:mtr><m:mtr> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> </m:mtr><m:mtr> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> </m:mtr><m:mtr> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> </m:mtr><m:mtr> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mn>0</m:mn></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> <m:mtd><m:mi>x</m:mi></m:mtd> </m:mtr> </m:mtable></m:mfenced></m:math></td><td class="formula2"/></tr></table></div>
 where <m:math><m:mi>x</m:mi></m:math>&#160;represents nonzero elements (13 in all) the arrays <a class="arg" href="#IA">IA</a> and <a class="arg" href="#JA">JA</a> should be 
<div class="formula"><table class="formula"><tr><td class="formula"><m:math display="block"> <m:mtable> <m:mtr> <m:mtd><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IA"><m:mi mathcolor="#EE0000" mathvariant="bold">IA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>k</m:mi></m:mfenced></m:mrow></m:mtd> <m:mtd><m:mn>1</m:mn></m:mtd> <m:mtd><m:mn>4</m:mn></m:mtd> <m:mtd><m:mn>6</m:mn></m:mtd> <m:mtd><m:mn>9</m:mn></m:mtd> <m:mtd><m:mn>12</m:mn></m:mtd> <m:mtd><m:mn>14</m:mn></m:mtd> <m:mtd/> <m:mtd/> <m:mtd/> <m:mtd/> <m:mtd/> <m:mtd/> <m:mtd/> </m:mtr><m:mtr> <m:mtd><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#JA"><m:mi mathcolor="#EE0000" mathvariant="bold">JA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mi>k</m:mi></m:mfenced></m:mrow></m:mtd> <m:mtd><m:mn>1</m:mn></m:mtd> <m:mtd><m:mn>3</m:mn></m:mtd> <m:mtd><m:mn>4</m:mn></m:mtd> <m:mtd><m:mn>2</m:mn></m:mtd> <m:mtd><m:mphantom><m:mn>0</m:mn></m:mphantom><m:mn>3</m:mn></m:mtd> <m:mtd><m:mphantom><m:mn>0</m:mn></m:mphantom><m:mn>1</m:mn></m:mtd> <m:mtd><m:mn>2</m:mn></m:mtd> <m:mtd><m:mn>3</m:mn></m:mtd> <m:mtd><m:mn>2</m:mn></m:mtd> <m:mtd><m:mn>4</m:mn></m:mtd> <m:mtd><m:mn>5</m:mn></m:mtd> <m:mtd><m:mn>4</m:mn></m:mtd> <m:mtd><m:mn>5</m:mn></m:mtd> </m:mtr> </m:mtable> </m:math></td><td class="formula2"/></tr></table></div>
 <a class="arg" href="#JA">JA</a> is not used if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>&#160;or <m:math><m:mtext>'A'</m:mtext></m:math>.</div>
</div></dd><dt class="paramhead"><a name="NJA" id="NJA"/>8: &#160;&#160;&#8194; NJA &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: the dimension of the array <a class="arg" href="#JA">JA</a> as declared in the (sub)program from which D02NUF is called.</div><div class="paramtext"><i>Constraints</i>:
   <div class="paramtext"/><ul class="listcons">
<li class="listcons">if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NJA"><m:mi mathcolor="#EE0000" mathvariant="bold">NJA</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#IA"><m:mi mathcolor="#EE0000" mathvariant="bold">IA</m:mi></m:maction><m:mfenced separators="," open="(" close=")"><m:mrow><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:mfenced></m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:math>;</li>
<li class="listcons">otherwise <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NJA"><m:mi mathcolor="#EE0000" mathvariant="bold">NJA</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>1</m:mn></m:math>.</li>
</ul></div></dd><dt class="paramhead"><a name="JACPVT" id="JACPVT"/>9: &#160;&#160;&#8194; JACPVT(<a class="arg" href="#NJCPVT">NJCPVT</a>) &#8211; INTEGER array<span class="pclass">Communication Array</span></dt><dd>
<div class="paramtext"><i>On exit</i>: data relating to the Jacobian sparsity structure.</div>
</dd><dt class="paramhead"><a name="NJCPVT" id="NJCPVT"/>10: &#8194; NJCPVT &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: 

the length of the array <a class="arg" href="#JACPVT">JACPVT</a>, which you are supplying to the integrator, as dimensioned in the sub(program) from which D02NUF is called.</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NJCPVT"><m:mi mathcolor="#EE0000" mathvariant="bold">NJCPVT</m:mi></m:maction><m:mo>=</m:mo><m:mn>20</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQMAX</m:mi></m:maction></m:math>&#160;if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'N'</m:mtext></m:math>&#160;or <m:math><m:mtext>'A'</m:mtext></m:math>. If <a class="arg" href="#NJCPVT">NJCPVT</a> is less than this estimate, then a message is printed on the current advisory message unit (see <a class="rout" href="../X04/x04abf.xml">X04ABF</a>), and execution continues.</div><div class="paramtext"><i>Constraint</i>:
  
if <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#JCEVAL"><m:mi mathcolor="#EE0000" mathvariant="bold">JCEVAL</m:mi></m:maction><m:mo>=</m:mo><m:mtext>'S'</m:mtext></m:math>, <m:math><m:mtext>'F'</m:mtext></m:math>&#160;or <m:math><m:mtext>'D'</m:mtext></m:math>, <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#NJCPVT"><m:mi mathcolor="#EE0000" mathvariant="bold">NJCPVT</m:mi></m:maction><m:mo>&#8805;</m:mo><m:mn>3</m:mn><m:mo>&#215;</m:mo><m:mi mathvariant="italic">nelement</m:mi><m:mo>+</m:mo><m:mn>14</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQ"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQ</m:mi></m:maction></m:math>, where <m:math><m:mi mathvariant="italic">nelement</m:mi></m:math>&#160;is the total number of nonzeros.
</div></dd><dt class="paramhead"><a name="SENS" id="SENS"/>11: &#8194; SENS &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: a threshold parameter used to determine whether or not a matrix element is zero; when <a class="arg" href="#SENS">SENS</a> is set to <m:math><m:mn>0.0</m:mn></m:math>&#160;on entry, the routine will use <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#SENS"><m:mi mathcolor="#EE0000" mathvariant="bold">SENS</m:mi></m:maction><m:mo>=</m:mo><m:mn>100.0</m:mn><m:mo>&#215;</m:mo><m:mi mathvariant="bold-italic">machine&#160;precision</m:mi></m:math>. Otherwise the absolute value of <a class="arg" href="#SENS">SENS</a> is used.</div></dd><dt class="paramhead"><a name="U" id="U"/>12: &#8194; U &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: should have a value between <m:math><m:mn>0.0</m:mn></m:math>&#160;and <m:math><m:mn>0.9999</m:mn></m:math>. Otherwise a default value of <m:math><m:mn>0.1</m:mn></m:math>&#160;is used. When the sparsity pattern has been evaluated, the first Jacobian computed is decomposed with <a class="arg" href="#U">U</a> governing the choice of pivots; subsequent Jacobian decompositions use the same pattern of decomposition until the sparsity pattern is re-evaluated. When searching a row for a pivot, any element is excluded from the search which is less than <a class="arg" href="#U">U</a> times the largest of those elements in the row available as pivots. Thus decreasing <a class="arg" href="#U">U</a> biases the algorithm towards maintaining sparsity at the expense of numerical stability.</div></dd><dt class="paramhead"><a name="ETA" id="ETA"/>13: &#8194; ETA &#8211; <span class="bitalic">double precision</span><span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: a relative pivot threshold, below which on subsequent decompositions (as described under <a class="arg" href="#U">U</a>), an internal error is provoked. 

<dl>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ETA"><m:mi mathcolor="#EE0000" mathvariant="bold">ETA</m:mi></m:maction><m:mo>&gt;</m:mo><m:mn>1.0</m:mn></m:math></dt>
<dd>No check on pivot size is made.</dd>
<dt class="paramval"><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ETA"><m:mi mathcolor="#EE0000" mathvariant="bold">ETA</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>0.0</m:mn></m:math></dt>
<dd>The default value <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ETA"><m:mi mathcolor="#EE0000" mathvariant="bold">ETA</m:mi></m:maction><m:mo>=</m:mo><m:mtext>1.0D&#8722;4</m:mtext></m:math>&#160;is used.</dd></dl>
</div></dd><dt class="paramhead"><a name="LBLOCK" id="LBLOCK"/>14: &#8194; LBLOCK &#8211; LOGICAL<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: indicates if preordering is used before decomposition.
<div class="paramtext">If <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LBLOCK"><m:mi mathcolor="#EE0000" mathvariant="bold">LBLOCK</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.TRUE.</m:mi></m:math>, on entry, the Jacobian matrix is preordered to block lower triangular form before a decomposition is performed (this is the recommended mode). If you know the structure of the Jacobian to be irreducible, that is not permutable to block lower triangular form, then you should set <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#LBLOCK"><m:mi mathcolor="#EE0000" mathvariant="bold">LBLOCK</m:mi></m:maction><m:mo>=</m:mo><m:mi mathvariant="normal">.FALSE.</m:mi></m:math>. For example, a Jacobian arising from using the method of lines for parabolic partial differential equations would normally be irreducible. (See the specification of <a class="rout" href="../D02/d02nxf.xml">D02NXF</a> for optional output concerning <a class="arg" href="#LBLOCK">LBLOCK</a>.)</div>
</div></dd><dt class="paramhead"><a name="ISPLIT" id="ISPLIT"/>15: &#8194; ISPLIT &#8211; INTEGER<span class="pclass">Input</span></dt><dd>
<div class="paramtext"><i>On entry</i>: this parameter is used for splitting the integer workspace <a class="arg" href="#JACPVT">JACPVT</a> to effect an efficient decomposition. It must satisfy <m:math><m:mn>1</m:mn><m:mo>&#8804;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#ISPLIT"><m:mi mathcolor="#EE0000" mathvariant="bold">ISPLIT</m:mi></m:maction><m:mo>&#8804;</m:mo><m:mn>99</m:mn></m:math>. If <a class="arg" href="#ISPLIT">ISPLIT</a> lies outside this range on entry, a default value of <m:math><m:mn>73</m:mn></m:math>&#160;is used. An appropriate value for <a class="arg" href="#ISPLIT">ISPLIT</a> for subsequent runs on similar problems is available via the optional output <a class="rout" href="../D02/d02nxf.xml">D02NXF</a>.</div>
<div class="paramtext"><i>Suggested value</i>:
  <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#ISPLIT"><m:mi mathcolor="#EE0000" mathvariant="bold">ISPLIT</m:mi></m:maction><m:mo>=</m:mo><m:mn>73</m:mn></m:math>, unless you have information from a previous run of a similar problem.

</div></dd><dt class="paramhead"><a name="RWORK" id="RWORK"/>16: &#8194; RWORK(<m:math><m:mn>50</m:mn><m:mo>+</m:mo><m:mn>4</m:mn><m:mo>&#215;</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#NEQMAX"><m:mi mathcolor="#EE0000" mathvariant="bold">NEQMAX</m:mi></m:maction></m:math>) &#8211; <span class="bitalic">double precision</span> array<span class="pclass">Communication Array</span></dt><dd>
<div class="paramtext">This must be the same workspace array as the array <a class="arg" href="#RWORK">RWORK</a> supplied to the integrator. It is used to pass information from the setup routine to the integrator and therefore the contents of this array must not be changed before calling the integrator.</div></dd><dt class="paramhead"><a name="IFAIL" id="IFAIL"/>17: &#8194; IFAIL &#8211; INTEGER<span class="pclass">Input/Output</span></dt><dd>
<div class="paramtext"><i>On entry</i>: <a class="arg" href="#IFAIL">IFAIL</a> must be set to <m:math><m:mn>0</m:mn></m:math>, <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>. If you are unfamiliar with this parameter you should refer to <a class="sec" href="../GENINT/essint.xml#library3">Section 3.3</a> in  the Essential Introduction for details.</div>
<div class="paramtext"><i>On exit</i>: <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;unless the routine detects an error (see <a class="sec" href="#errors">Section 6</a>). <div class="paramtext">For environments where it might be inappropriate to halt program execution when an error is detected, the value <m:math><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>&#160;is recommended.  If the output of error messages is undesirable, then the value <m:math><m:mn>1</m:mn></m:math>&#160;is recommended.  Otherwise, if you are not familiar with this parameter, the recommended value is <m:math><m:mn>0</m:mn></m:math>.  <b>When the value <m:math><m:mrow><m:mo>-</m:mo><m:mn mathvariant="bold">1</m:mn></m:mrow><m:mtext>&#8203; or &#8203;</m:mtext><m:mn mathvariant="bold">1</m:mn></m:math>&#160;is used it is essential to test the value of <a class="arg" href="#IFAIL">IFAIL</a> on exit.</b></div></div></dd></dl><h2 class="standard"><a class="sec" name="errors" id="errors"/>6&#160;&#160;Error Indicators and Warnings</h2>
<div class="paramtext">If on entry <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">0</m:mn></m:maction></m:math>&#160;or <m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#errors"><m:mn mathcolor="#003399" mathvariant="bold">-1</m:mn></m:maction></m:math>, explanatory error messages are output on the current error message unit (as defined by <a class="rout" href="../X04/x04aaf.xml">X04AAF</a>).</div><div class="paramtext">Errors or warnings detected by the routine:</div>
<dl class="ifail">
<dt class="errorhead"><a name="IFeq1" id="IFeq1"/><m:math><m:maction actiontype="link" dsi:type="simple" dsi:href="#IFAIL"><m:mi mathcolor="#EE0000" mathvariant="bold">IFAIL</m:mi></m:maction><m:mo>=</m:mo><m:mn>1</m:mn></m:math></dt>
<dd>
<div class="paramtext">On entry, an illegal input was detected.</div></dd>
</dl><h2 class="standard"><a class="sec" name="accuracy" id="accuracy"/>7&#160;&#160;Accuracy</h2>
<div class="paramtext">Not applicable.</div><h2 class="standard"><a class="sec" name="fcomments" id="fcomments"/>8&#160;&#160;Further Comments</h2>
<div class="paramtext">D02NUF must be called as a setup routine before a call to either <a class="rout" href="../D02/d02ndf.xml">D02NDF</a> or <a class="rout" href="../D02/d02njf.xml">D02NJF</a> and may be called as the linear algebra setup routine before a call to <a class="rout" href="../D02/d02nmf.xml">D02NMF</a> or <a class="rout" href="../D02/d02nnf.xml">D02NNF</a>.</div><h2 class="standard"><a class="sec" name="example" id="example"/>9&#160;&#160;Example</h2>
<div class="paramtext">See Section 9 in <a class="rout" href="../D02/d02ndf.xml">D02NDF</a>, <a class="rout" href="../D02/d02njf.xml">D02NJF</a> and <a class="rout" href="../D02/d02nnf.xml">D02NNF</a>.</div>
<hr/><div><a class="rout" href="../../pdf/D02/d02nuf.pdf">D02NUF (PDF version)</a></div><div><a class="chap" href="d02conts.xml">D02 Chapter Contents</a></div><div><a class="chapint" href="d02intro.xml">D02 Chapter Introduction</a></div>
<div><a class="htmltoc" href="../FRONTMATTER/manconts.xml">NAG Library Manual</a></div>
<div><hr/><a class="genint" href="../FRONTMATTER/copyright.xml">&#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2009</a></div></body></html>
