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 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Copyright (C) 2004, 2005, 2006, 2007 Alain Lahellec
Copyright (C) 2004, 2005, 2006, 2007 Patrice Dumas
Copyright (C) 2004, Ste'phane Hallegatte
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover text and with no Back-Cover Text.
A copy of the license is included in the section entitled "GNU Free
Documentation License."
-->
<!-- Created on a sunny day by texi2html
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Miniker 102 manual: 2.4 Controlling the run</title>
<meta name="description" content="Miniker 102 manual: 2.4 Controlling the run">
<meta name="keywords" content="Miniker 102 manual: 2.4 Controlling the run">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
@import "mini_ker_tex4ht_math.css";
@import "mini_ker_tex4ht_tex.css";
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Controlling-the-run"></a>
<ul class="toc"><li><a href="mini_ker.html#Top">Miniker 102 manual</a> </li>
<li><ul class="toc"><li><a href="A-model-with-Miniker.html#A-model-with-Miniker">2. Miniker model programming</a> </li>
</ul></li>
</ul>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="Setting-and-running-a-model.html#Graphics" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#End-of-time-step" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mini_ker.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concepts-index.html#Concepts-index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mini_ker_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Controlling-the-run-1"></a>
<h2 class="section"> 2.4 Controlling the run </h2>
<ul class="toc">
<li> <a href="#End-of-time-step">2.4.1 Executing code at the end of each time step</a> </li>
<li> <a href="#Controlling-the-printout-and-data-output">2.4.2 Controlling the printout and data output</a> </li>
</ul>
<a name="index-controlling-the-run"></a>
<p>It is possible to add code that will be executed at the end of each time
step. It is also possible to specify which time step leads to a printout on
standard output. For maximal control, the code running te model may be
turned into a subroutine to be called from another fortran (or C)
program, this possibility is covered in <a href="Calling-the-model-code.html#Calling-the-model-code">Calling the model code</a>.
</p>
<hr size="2">
<a name="End-of-time-step"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#Controlling-the-run" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#Controlling-the-printout-and-data-output" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mini_ker.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concepts-index.html#Concepts-index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mini_ker_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Executing-code-at-the-end-of-each-time-step"></a>
<h3 class="subsection"> 2.4.1 Executing code at the end of each time step </h3>
<a name="index-zsteer"></a>
<a name="index-zsteer_002einc"></a>
<p>The code in the sequence ‘<tt>zsteer</tt>’ is executed at the end of each time
step. It is possible to change the time step length (variable <code>dt</code>)
verify that the non linearity are not too big, or perform
discontinuous modifications of the states. One available variable <code>res</code>
might be usefull for time step monitoring. At the end of the time step,
as soon as φ has been computed, a numerical test is applied
on a pseudo relative quadratic residual between
φ = f(η(t - dt) + dφ (<code> ffl</code>), where dφ
is given by the system resolution in <code>ker</code>,and
φ = f(η),φ)
, Fortran variable (<code>ff</code>):
</p>
<pre class="verbatim">! ========================================================
! test linearite ffl - ff
! ========================================================
if (istep.gt.1)
< res=0.; <io=1,m; res = res +(ffl(io)-ff(io))**2/max(one,ff(io)*ff(io)); >;
if (res .gt. TOL_FFL)
< print*,'*** pb linearite : res > TOL_FFL a istep',istep,res,' > ',TOL_FFL;
do io=1,m < z_pr: io,ff(io),ff(io)-ffl(io); >;
>;
>;
</pre>
<p>This test hence applies only for non linearities in tranfer models. Nevertheless,
<code>res</code> might be usefull to monitor the time step <code>dt</code> in <code>ZSTEER</code>
and eventually go backward one step (<code>goto :ReDoStep:</code>).
This can more appropriatly be coded in the (empty in default case)
sequence <code>zstep</code>, inserted just before time-advancing
states and <code>time</code> variables in ‘<tt>principal</tt>’.
<a name="index-ffl_0028_002e_0029"></a>
<a name="index-ffl-_0028linearity-test_0029"></a>
<a name="index-linearity-test"></a>
</p>
<p>It is also possible to fix the value of the criterium <code>TOL_FFL</code> in
‘<tt>zinit</tt>’ different from its default value of 10-3 –
independent of the Fortran precision.
</p>
<p>Many other variables are available, including
</p><dl compact="compact">
<dt> <code>istep</code>
<a name="index-istep"></a>
</dt>
<dd><p>The step number;
</p></dd>
<dt> <code>couplage(.)</code>
<a name="index-couplage_0028_002e_0029"></a>
</dt>
<dd><p>The <acronym title="Transfer Evolution Formalism">TEF</acronym> coupling matrix between transfers;
</p></dd>
<dt> <code>H</code>
<a name="index-H"></a>
</dt>
<dd><p>The Jacobian matrix corresponding with:
<center class="math-display" >
<img
src="mini_ker_tex4ht_tex6x.png" alt="∂ηg(η(t),φ(t)); " class="math-display" ></center>
</p></dd>
<dt> <code>Bb</code>
<a name="index-Bb"></a>
</dt>
<dd><p>The Jacobian matrix corresponding with:
<center class="math-display" >
<img
src="mini_ker_tex4ht_tex7x.png" alt="∂φg(η(t),φ(t)); " class="math-display" ></center>
</p></dd>
<dt> <code>Bt</code>
<a name="index-Bt"></a>
</dt>
<dd><p>The Jacobian matrix corresponding with:
<center class="math-display" >
<img
src="mini_ker_tex4ht_tex8x.png" alt="∂ηf(η(t),φ(t)); " class="math-display" ></center>
</p></dd>
<dt> <code>D</code>
<a name="index-D"></a>
</dt>
<dd><p>The Jacobian matrix corresponding with:
<center class="math-display" >
<img
src="mini_ker_tex4ht_tex9x.png" alt="∂φf(η(t),φ(t)); " class="math-display" ></center>
</p>
</dd>
<dt> <code>aspha</code>
<a name="index-aspha"></a>
</dt>
<dd><p>The state advance matrix;
</p></dd>
<dt> <code>dneta</code>
<a name="index-dneta"></a>
</dt>
<dt> <code>dphi</code>
<a name="index-dphi"></a>
</dt>
<dd><p>the variable increments;
</p></dd>
</dl>
<p>One should be aware of that the linearity test concerns the preceding step.
We have yet no example of managing the time-step.
</p>
<hr size="2">
<a name="Controlling-the-printout-and-data-output"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#End-of-time-step" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="Advanced-programming.html#Advanced-programming" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="mini_ker.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concepts-index.html#Concepts-index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mini_ker_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<a name="Controlling-the-printout-and-data-output-1"></a>
<h3 class="subsection"> 2.4.2 Controlling the printout and data output </h3>
<a name="index-printing"></a>
<a name="index-zprint"></a>
<a name="index-modzprint-1"></a>
<p>The printout on standard output is performed if the variable <code>zprint</code>
of type <code>logical</code> is true. Therefore it is possible to control this
printout by setting <code>zprint</code> false or true. For example the following
code, in sequence ‘<tt>zsteer</tt>’, triggers printing for every
<code>modzprint</code> time step and the two following time steps:
</p>
<table><tr><td> </td><td><pre class="example">ZPRINT = mod(istep+1,modzprint).eq.0;
Zprint = zprint .or. mod(istep+1,modzprint).eq.1;
Zprint = zprint .or. mod(istep+1,modzprint).eq.2;
</pre></td></tr></table>
<p>The data output to ‘<tt>.data</tt>’ files described in <a href="Setting-and-running-a-model.html#Simulation-and-output">Running a simulation and using the output</a> is performed if the
<code>logical</code> variable <code>zout</code> is true. For example the following
code, in ‘<tt>zsteer</tt>’, triggers output to ‘<tt>.data</tt>’ files every
<code>modzout</code> step.
</p>
<table><tr><td> </td><td><pre class="example">Zout = mod(istep,modzout).eq.0;
</pre></td></tr></table>
<hr size="2">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="mini_ker.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="Concepts-index.html#Concepts-index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="mini_ker_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>a tester</em> on <em>a sunny day</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html</em></a>.
</font>
<br>
</p>
</body>
</html>
|