<!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 text="#000000" bgcolor="#ffffff">
Mehdi,<br>
That is a good question and there are a number of ways that you can
solve it. The most "correct" would probably be to define your arrays
as "allocatable" and then create them and fill them in once your
simulation has started. However, that is a bit too formal sometimes
so what I have often done is to set a maximum allowable number of
inputs in the Fortran code and size your arrays based on that
maximum. Then you can read from the Trnsys input file how many
inputs there actually are and check to make sure that it doesn't
exceed the maximum. For example:<br>
<br>
PARAMETER (NIMAX=21)<br>
DIMENSION XIN(NIMAX),YCHECK(NIMAX)<br>
...<br>
DATA YCHECK
/'CF1','CF1','TE1','TE1','TE1','HT1','HT1','HT1','HT1'<br>
1
,'HT1','IR1','IR1','IR1','IR1','DG1','DG1','DG1','DG1'<br>
1 ,'MF1','PW1','HT1'/<br>
<br>
...<br>
<br>
!CALL THE TYPE CHECK SUBROUTINE TO COMPARE WHAT THIS
COMPONENT REQUIRES TO WHAT IS SUPPLIED<br>
IF (INFO(4).EQ.28) THEN<br>
NP=28 ; NI=20<br>
ELSE<br>
NP=34 ; NI=21<br>
ENDIF<br>
<br>
!CALL TYPECK TO CHECK FOR CORRECT INPUT FILE SPECIFICATIONS<br>
CALL TYPECK(1,INFO,NI,NP,ND)<br>
<br>
!CALL THE RCHECK SUBROUTINE TO SET THE CORRECT INPUT AND
OUTPUT TYPES FOR THIS COMPONENT<br>
CALL RCHECK(INFO,YCHECK,OCHECK)<br>
<br>
I took the code above from the Type37 subroutine (in Trnsys16) which
can have either 28 or 34 parameters and either 20 or 21 inputs.<br>
Best,<br>
David<br>
<br>
<br>
<br>
On 2/7/2011 17:15, Mehdi Shahrestani wrote:
<blockquote cite="mid:439099.39959.bm@smtp102.mail.ac4.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)">
<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;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Dear
everybody <o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">I have a
question about using cycles of variables (Vol2 of
manual page 26).<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Is it
possible to create cycle for inputs instead of
parameters?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">I am writing
a new component for different arrangements. This
new component would be well organised if the cycle can be
created for inputs.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">If you are
saying yes; how can I manage the “DATA
YCHECK” in FORTRAN script? Is it possible that I put “IF”
in “DATA
YCHECK” line?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Many thanks
for your time spending on it.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Regards<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;">Mehdi<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="3"><span
style="font-size: 12pt; font-family: Arial;"><o:p> </o:p></span></font></p>
</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://mailman.cae.wisc.edu/listinfo/trnsys-users">https://mailman.cae.wisc.edu/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:d.bradley@tess-inc.com">d.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>