<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Mehdi,<br>
The error you are getting is because the Type template has the line<br>
<br>
IMPLICIT NONE<br>
<br>
in it. This means that you need to declare all of your variables and
specify their type (integer, double precision, etc.)<br>
<br>
If you add the line<br>
<br>
DOUBLE PRECISION opt<br>
<br>
in the local variable definitions portion of the Type template, that
particular fortran error should be solved. <br>
<br>
Best,<br>
David<br>
<br>
<br>
On 7/12/2010 08:43, Mehdi Shahrestani wrote:
<blockquote cite="mid:498439.16329.qm@smtp115.plus.mail.re1.yahoo.com"
type="cite">
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:blue;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:Arial;
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:Arial;
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><b><font color="blue" face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; color: blue; font-weight: bold;">Dear
Jaime<o:p></o:p></span></font></b></p>
<p class="MsoNormal"><font color="blue" face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; color: blue;">Many thanks
for your reply<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; color: blue;">I have
implemented your advices.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; color: blue;">1- I added <b><span
style="font-weight: bold;">opt=ipt+par</span></b> just after “ </span></font><font
color="blue"><span style="color: blue;">!Sample Code: OUT1=IN1+PAR1”
line without
“ ! ”.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"> 2- I wrote the
same after (!Do All of
the First Timestep Manipulations Here - There Are No Iterations at the
Intial
Time)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;">But unfortunately
there was an error in
compiling the script which is :<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">--------------------Configuration: Type211Lib
- Win32
Release--------------------<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">Compiling Fortran...<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">C:\Trnsys17\MyProjects\type 211\type211.for<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">C:\Trnsys17\MyProjects\type
211\type211.for(122) : Error: This name
does not have a type, and must have an explicit type. [OPT]<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"> opt=inp+par<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">------^<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">Error executing df.exe.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">type211.dll - 1 error(s), 0 warning(s)<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">--------------------------------------------------------------------------------------<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;">It is Trnsys 17
and CVF6.6B. <o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;">I was wondering
if I could have your
further suggestions.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;">Regards<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;">Mehdi Shahrestani<o:p></o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Times New Roman"
size="3"><span style="font-size: 12pt; color: blue;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font color="blue" face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; color: blue;"><o:p> </o:p></span></font></p>
<div>
<div class="MsoNormal" style="text-align: center;" align="center"><font
face="Times New Roman" size="3"><span style="font-size: 12pt;"
lang="EN-US">
<hr tabindex="-1" width="100%" align="center" size="2"></span></font></div>
<p class="MsoNormal"><b><font face="Tahoma" size="2"><span
style="font-size: 10pt; font-family: Tahoma; font-weight: bold;"
lang="EN-US">From:</span></font></b><font face="Tahoma" size="2"><span
style="font-size: 10pt; font-family: Tahoma;" lang="EN-US">
Jaime Gonzalez Rodriguez [<a class="moz-txt-link-freetext" href="mailto:gonzalezro.jaime@gmail.com">mailto:gonzalezro.jaime@gmail.com</a>] <br>
<b><span style="font-weight: bold;">Sent:</span></b> 12 July 2010
12:56<br>
<b><span style="font-weight: bold;">To:</span></b> mehdi<br>
<b><span style="font-weight: bold;">Cc:</span></b>
<a class="moz-txt-link-abbreviated" href="mailto:trnsys-users@cae.wisc.edu">trnsys-users@cae.wisc.edu</a><br>
<b><span style="font-weight: bold;">Subject:</span></b> Re:
[TRNSYS-users]
problem in creating a simple new component</span></font><span
lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><o:p> </o:p></span></font></p>
<div>
<p class="MsoNormal"><span class="apple-style-span"><font face="Arial"
size="2"><span style="font-size: 10pt; font-family: Arial;">you have
writen it there, but it is
commented. You have to uncomment the line where it says</span></font></span><font
face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-style-span"><font face="Arial"
size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></span><font
face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-style-span"><font face="Arial"
size="2"><span style="font-size: 10pt; font-family: Arial;">!Sample
Code: OUT1=IN1+PAR1</span></font></span><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><span class="apple-style-span"><font face="Arial"
size="2"><span style="font-size: 10pt; font-family: Arial;">so that it
would be:</span></font></span><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
</div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><span
class="apple-style-span"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">OUT1=IN1+PAR1</span></font></span><o:p></o:p></p>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">You also have to write the same line in the
part where it says (!Do All
of the First Timestep Manipulations Here - There Are No Iterations at
the
Intial Time) after getting the input value and before writting the
output
value.<o:p></o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">Which trnsys version are you using??? code is
kind of different to the
one created by mine when I export new proformas<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><o:p> </o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">Regards<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><o:p> </o:p></span></font></p>
<div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;">On 12 July 2010 13:32, mehdi <<a
moz-do-not-send="true" href="mailto:mahdishahrestani@yahoo.com">mahdishahrestani@yahoo.com</a>>
wrote:<o:p></o:p></span></font></p>
<div link="blue" vlink="purple">
<div>
<p class="MsoNormal" style=""><b><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;">Hello
everybody </span></font></b><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">I have
problem in creating the new component utilising simulation studio
skeleton to
create new components.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Description
of new component that I am going to create:</span></font><o:p></o:p></p>
<p class="MsoNormal" style="margin-left: 36pt;"><u><font face="Arial"
size="3"><span style="font-size: 12pt; font-family: Arial;">Input,
output and parameters:</span></font></u><o:p></o:p></p>
<p class="MsoNormal" style="margin-left: 36pt;"><b><font face="Arial"
size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;"> </span></font></b><o:p></o:p></p>
<p class="MsoNormal" style="margin-left: 72pt;"><b><font face="Arial"
size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;">Input:</span></font></b><font
face="Arial"><span style="font-family: Arial;"> inp</span></font><o:p></o:p></p>
<p class="MsoNormal" style="margin-left: 72pt;"><b><font face="Arial"
size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;">Output:</span></font></b><font
face="Arial"><span style="font-family: Arial;"> opt</span></font><o:p></o:p></p>
<p class="MsoNormal" style="margin-left: 72pt;"><b><font face="Arial"
size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;">Parameter:</span></font></b><font
face="Arial"><span style="font-family: Arial;"> par</span></font><o:p></o:p></p>
<p class="MsoNormal" style="text-indent: 36pt;"><u><font face="Arial"
size="3"><span style="font-size: 12pt; font-family: Arial;">Equation: </span></font></u><o:p></o:p></p>
<p class="MsoNormal" style="margin-left: 36pt; text-indent: 36pt;"><b><font
face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;">Opt =
inp + par </span></font></b><o:p></o:p></p>
<p class="MsoNormal" style=""><b><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial; font-weight: bold;"> </span></font></b><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">After
exporting the performa to fortran the codes comes up in VBF6.6B but
unfortunately I don’t know where I should add my simple equation in the
script.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">I Transys
manual 1-68 has been mentioned that we have to add our equations
instead of
highlight question marks in the fortran script. But in the fortran file
there
is no question mark.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">The tmf file
along with fortran file have been attached and also the fortran script
has been
mentioned below. </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">I was
wondering if you could help to run this simple component.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Regards</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Mehdi
Shahrestani</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">
</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Subroutine Type211</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! Object:
Noname</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! Simulation
Studio Model: type211</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! Author: </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! Editor: </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
Date: July 12, 2010</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! last
modified: July 12, 2010</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** Model
Parameters </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
par
- [-Inf;+Inf]</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** Model
Inputs </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
inp
- [-Inf;+Inf]</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** Model
Outputs </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
opt
- [-Inf;+Inf]</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** Model
Derivatives </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! *** </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! (Comments
and routine interface generated by TRNSYS Studio)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!************************************************************************</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! This
TRNSYS component skeleton was generated from the TRNSYS studio based on
the
user-supplied parameters, inputs, </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! outputs,
and derivatives. The user should check the component formulation
carefully and add the content to transform</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! the
parameters, inputs and derivatives into outputs. Remember, outputs
should
be the average value over the timestep</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! and not
the value at the end of the timestep; although in many models these are
exactly
the same values. Refer to </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">! existing
types for examples of using advanced features inside the model
(Formats, Labels
etc.)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Use TrnsysConstants</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Use TrnsysFunctions</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!DEC$Attributes
DLLexport :: Type211</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Trnsys
Declarations</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Implicit None</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Double Precision Timestep,Time</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Integer CurrentUnit,CurrentType</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
PARAMETERS</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
DOUBLE PRECISION par</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
INPUTS</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
DOUBLE PRECISION inp</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Get the Global
Trnsys Simulation Variables</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Time=getSimulationTime()</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Timestep=getSimulationTimeStep()</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
CurrentUnit = getCurrentUnit()</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
CurrentType = getCurrentType()</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Set the
Version Number for This Type</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If(getIsVersionSigningTime()) Then</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetTypeVersion(17)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
EndIf</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Do Any Last
Call Manipulations Here</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If(getIsLastCallofSimulation()) Then</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
EndIf</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Perform Any
"After Convergence" Manipulations That May Be Required at the End of
Each Timestep</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If(getIsConvergenceReached()) Then</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
EndIf</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Do All of
the "Very First Call of the Simulation Manipulations" Here</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If(getIsFirstCallofSimulation()) Then</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Tell the TRNSYS Engine How This Type Works</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call
SetNumberofParameters(1)
!The number of parameters that the the model wants</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetNumberofInputs(1)
!The number of inputs that the the model wants</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetNumberofDerivatives(0)
!The number of derivatives that the the model wants</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call
SetNumberofOutputs(1)
!The number of outputs that the the model produces</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetIterationMode(1)
!An
indicator for the iteration mode (default=1). Refer to section 8.4.3.5
of
the documentation for more details.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetNumberStoredVariables(0,0)
!The number of static variables that the model wants stored in the
global
storage array and the number of dynamic variables that the model wants
stored
in the global storage array</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call
SetNumberofDiscreteControls(0)
!The number of discrete control functions set by this model (a value
greater
than zero requires the user to use Solver 1: Powell's method)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
EndIf</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Do All of the
First Timestep Manipulations Here - There Are No Iterations at the
Intial Time</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If (getIsFirstTimestep()) Then</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
par = getParameterValue(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
inp = GetInputValue(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Check the Parameters for Problems (#,ErrorType,Text)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: If( PAR1 <= 0.) Call FoundBadParameter(1,'Fatal','The
first
parameter provided to this model is not acceptable.')</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Set the Initial Values of the Outputs (#,Value)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetOutputValue(1, 0) ! opt</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If Needed, Set the Initial Values of the Static Storage Variables
(#,Value)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: SetStaticArrayValue(1,0.d0)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If Needed, Set the Initial Values of the Dynamic Storage Variables
(#,Value)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: Call SetDynamicArrayValueThisIteration(1,20.d0)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If Needed, Set the Initial Values of the Discrete Controllers (#,Value)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code for Controller 1 Set to Off: Call
SetDesiredDiscreteControlState(1,0) </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
EndIf</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!ReRead the Parameters
if Another Unit of This Type Has Been Called Last</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If(getIsReReadParameters()) Then</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Read in the Values of the Parameters from the Input File</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
par = getParameterValue(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
EndIf</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Read the
Inputs</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
inp = GetInputValue(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Check the Inputs for Problems (#,ErrorType,Text)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: If( IN1 <= 0.) Call FoundBadInput(1,'Fatal','The first
input
provided to this model is not acceptable.')</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
If(ErrorFound()) Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!
*** PERFORM ALL THE CALCULATION HERE FOR THIS MODEL. ***</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If Needed, Get the Previous Control States if Discrete Controllers are
Being
Used (#)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: CONTROL_LAST=getPreviousControlState(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If Needed, Get the Values from the Global Storage Array for the Static
Variables (#)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: STATIC1=getStaticArrayValue(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If Needed, Get the Initial Values of the Dynamic Variables from the
Global Storage
Array (#)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: T_INITIAL_1=getDynamicArrayValueLastTimestep(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Perform All of the Calculations Here to Set the Outputs from the Model
Based
on the Inputs</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: OUT1=IN1+PAR1</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!If the model requires the solution of numerical derivatives, set these
derivatives and get the current solution</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: T1=getNumericalSolution(1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: T2=getNumericalSolution(2)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: DTDT1=3.*T2+7.*T1-15.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: DTDT2=-2.*T1+11.*T2+21.</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: Call SetNumericalDerivative(1,DTDT1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
!Sample Code: Call SetNumericalDerivative(2,DTDT2)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Set the
Outputs from this Model (#,Value)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Call SetOutputValue(1, 0) ! opt</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!If Needed,
Store the Desired Disceret Control Signal Values for this Iteration
(#,State)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Sample
Code: Call SetDesiredDiscreteControlState(1,1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!If Needed,
Store the Final value of the Dynamic Variables in the Global Storage
Array
(#,Value)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!Sample
Code: Call SetValueThisIteration(1,T_FINAL_1)</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
Return</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">
End</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">!-----------------------------------------------------------------------------------------------------------------------</span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
<p class="MsoNormal" style=""><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"> </span></font><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom: 12pt;"><font
face="Times New Roman" size="3"><span style="font-size: 12pt;"><br>
_______________________________________________<br>
TRNSYS-users mailing list<br>
<a moz-do-not-send="true" href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a><br>
<a moz-do-not-send="true"
href="https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users"
target="_blank">https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users</a><o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font face="Times New Roman" size="3"><span
style="font-size: 12pt;"><br>
<br clear="all">
<br>
-- <br>
Jaime. González Rodríguez<o:p></o:p></span></font></p>
</div>
</div>
</div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
TRNSYS-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a>
<a class="moz-txt-link-freetext" href="https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users">https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
22 North Carroll Street - suite 370
Madison, WI 53703 USA
P:+1.608.274.2577
F:+1.608.278.1475
<a class="moz-txt-link-abbreviated" href="mailto:bradley@tess-inc.com">bradley@tess-inc.com</a>
<a class="moz-txt-link-freetext" href="http://www.tess-inc.com">http://www.tess-inc.com</a>
<a class="moz-txt-link-freetext" href="http://www.trnsys.com">http://www.trnsys.com</a></pre>
</body>
</html>