<!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">
Dear Xavier,<br>
<br>
The way to handle these cases in which you don't know how many
parameters were defined by the cycle is to declare the size of the PAR
array as a dummy value PARMAX, where PARMAX is equal to the maximum
number of parameters that you would expect.<br>
During the preprocessing of the input file, TRNSYS counts how many
parameters are being specified in the input file and sends this
information to the corresponding unit in the 4 location of the array
INFO (i.e., INFO(4)).<br>
<br>
For example, please go to the sourcecode of Type3.<br>
On line 30 you find:<br>
INTEGER*4 INFO(15),<font color="#3333ff">NPMAX</font>,NI,NO,ND,IUNIT,ITYPE,ICNTRL<br>
On line 35:<br>
PARAMETER (<font color="#3333ff">NPMAX=16</font>,NI=3,NO=4,ND=0)<br>
During the first call manipulations you get the number of parameters
specified in the input file, line 95:<br>
<font color="#ff0000">NP=INFO(4)</font>   !determine the number of
parameters in the input file<br>
>From there on, you can make your decisions based on this number. For
example, on line 96 Type3 checks if the number of parameters supplied
in the input file is within the expected range:<br>
 IF((<font color="#ff0000">NP</font>.GT.<font color="#3333ff">NPMAX</font>).OR.(NP.LT.4))
CALL TYPECK(4,INFO,0,NP,0)<br>
<br>
Please let me know if you have more questions implementing this
strategy.<br>
Best regards,<br>
<br>
Diego<br>
<br>
<br>
FAURE Xavier wrote:
<blockquote
 cite="mid15B0A5AC574E5B48B8908C930824713A03583E@MAUDE.cstb.local"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <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;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
-->
  </style>
  <div class="Section1">
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;">Hy,<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I’m
programming a new type on the trnsys
environment and i need de define cycle in parameter definition.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I was
wondering how should be define the PAR vector in
fortran since it length is a function of its first and second values?<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">When
exporting the type as a fortran file, no
difference appeared within the declaration of number of parameters (NP)
and the
PAR vector comparing with type without any cycle definition.<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Can anyone
give a hand for the declaration pb ?<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Thank you by
advance<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Regards<o:p></o:p></span></font></p>
  <p class="MsoNormal"><font face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Xavier Faure</span></font><o:p></o:p></p>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">CSTB</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">Enveloppes
& Revêtements</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">Caractérisation
Physique des Matériaux</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">24 rue
Joseph Fourier</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">38400 Saint
Martin d'Heres</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">Tel : 33
(0)4 76 76 25 74</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">Fax : 33
(0)4 76 76 25 60</span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">mail : </span></font><a
 href="mailto:xavier.faure@cstb.fr"><font color="navy" face="Arial"
 size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">xavier.faure@cstb.fr</span></font></a><font
 color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;"> </span></font><o:p></o:p></p>
  </div>
  <div>
  <p class="MsoNormal"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">web : </span></font><a
 href="http://www.cstb.fr"><font color="navy" face="Arial" size="1"><span
 style="font-size: 7.5pt; font-family: Arial; color: navy;">www.cstb.fr</span></font></a><o:p></o:p></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>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
TRNSYS-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:TRNSYS-users@engr.wisc.edu">TRNSYS-users@engr.wisc.edu</a>
<a class="moz-txt-link-freetext" href="https://www.cae.wisc.edu/mailman/listinfo/trnsys-users">https://www.cae.wisc.edu/mailman/listinfo/trnsys-users</a>
  </pre>
</blockquote>
<br>
<br>
<pre>-- </pre>
Diego A. Arias
<br>
TRNSYS Coordinator
<br>
Solar Energy Laboratory
<br>
University of Wisconsin - Madison
<br>
1500 Engineering Drive
<br>
Madison, WI 53706
</body>
</html>