<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<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>
<!--
/* 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:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;
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;}
/* List Definitions */
@list l0
{mso-list-id:189415059;
mso-list-type:hybrid;
mso-list-template-ids:-661214410 929719586 134807577 134807579 134807567 134807577 134807579 134807567 134807577 134807579;}
@list l0:level1
{mso-level-text:%1-;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1
{mso-list-id:687565577;
mso-list-type:hybrid;
mso-list-template-ids:218266482 134807567 134807577 134807579 134807567 134807577 134807579 134807567 134807577 134807579;}
@list l1:level1
{mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1027" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hello everybody<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I was trying to follow the trnsys guide line to create the new
components in simulation studio. I faced problems in compiling the exported
fortran skeleton. Regarding to trnsys instruction “creating new
component” in page 1-65 of the manual “Getting started”; I
was looking for right place to add the equation in the fortran skeleton. After
search and asking trnsys users I have got it and I think every beginner in trnsys
would face the same. <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>I hope it helps.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><b><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-weight:bold'>Simple example: </span></font></b>Generation
of a new component via simulation studio <o:p></o:p></p>
<p class=MsoNormal><b><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-weight:bold'><o:p> </o:p></span></font></b></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Generation of the component which is able to evaluate this equation:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Opt = inp + par <o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Input: inp<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Output: opt<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Parameter: par<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-autospace:none'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<ol style='margin-top:0cm' start=1 type=1>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>First we have to
follow the instruction of “creating new component” which has
been mentioned in page 1-65 of trnsys manual “Getting
started”.<o:p></o:p></span></font></li>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>This instruction
should be followed up to the end of exporting the new component to fortran.<o:p></o:p></span></font></li>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>When the fortran Skelton
is coming up in CVF 6.6B the desired equation should be written along with
some modifications.<o:p></o:p></span></font></li>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>in page 1-68 of
transys instruction “Getting started” it has been mentioned
the desired equation has to be replaced with question marks “ ?
“ in the fortran skeleton but there is no sign of question mark
in trnsys 17 and CVF6.6B <o:p></o:p></span></font></li>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>For this simple
example we have to add our desired equation just after this comment
“! Perform All of the Calculations Here to Set the Outputs from the
Model Based on the Input”. We have to write opt=inp+par<o:p></o:p></span></font></li>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Moreover, when the
output is calling we have to put our output instead of default value which
already is 0.<o:p></o:p></span></font></li>
</ol>
<p class=MsoNormal><!--[if gte vml 1]><v:line id="_x0000_s1026" style='position:absolute;
z-index:1' from="189pt,8.4pt" to="261pt,8.4pt" coordsize="21600,21600">
<v:stroke endarrow="block" />
</v:line><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
absolute;z-index:1;margin-left:251px;margin-top:5px;width:99px;height:12px'><img
width=99 height=12 src="cid:image002.gif@01CB21F6.99FD3210" v:shapes="_x0000_s1026"></span><![endif]><font
size=3 face="Times New Roman">
Call SetOutputValue(1, 0) ! opt
Call SetOutputValue(1, opt) <o:p></o:p></font></p>
<ol style='margin-top:0cm' start=7 type=1>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Finally in
declaration part of the script “!Trnsys Declarations” we
have to define the output by writing this script “DOUBLE PRECISION
opt”<o:p></o:p></span></font></li>
<li class=MsoNormal style='mso-list:l1 level1 lfo1'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Now the new
component would be successfully compiled.<o:p></o:p></span></font></li>
</ol>
<p class=MsoNormal style='margin-left:18.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-left:18.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Finally as attached you
can find two fortran program as references:<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><span
style='mso-list:Ignore'>1-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]>The
automatically exported fortran script in CVF6.6b from simulation studio without
modification which could not be compiled<o:p></o:p></p>
<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><span
style='mso-list:Ignore'>2-<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'> </span></font></span></span></font><![endif]>Modified
script which could be compiled (the modifications are highlighted)<o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thanks to <u>David Bradley</u>, <u>Stefan Thiemann</u> and <u>Jaime
Gonzalez Rodriguez</u> for their replies.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Regards<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Mehdi Shahrestani<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face=Arial><span style='font-size:12.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>