<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>George,</p>
<p>You may also want to take a look at Type 49.  It reads a large array from an external data file.  The one thing to keep in mind is the number of your new types that will be allowed into a simulation.  If it's only ever just one then you can read in the array into a local storage array in your new type.  If it's more than one then you should store and retrieve the array from the TRNSYS global array such that each instance gets the correct data.</p>
<p> </p>
<p>Jeff</p>
<p> </p>
<div>
<pre>---<br />Jeff Thornton
President - TESS LLC
3 N. Pinckney Street, Suite 202, Madison WI USA 53703
Office: (608) 274-2577  Fax: (608) 278-1475
www.tess-inc.com
E-Mail: thornton@tess-inc.com
</pre>
</div>
<p>On 07/12/2021 10:12 am, David BRADLEY via TRNSYS-users wrote:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<p>George,</p>
<p> I think that you are on the correct track with putting the parameter values into an external file that gets read during the start time manipulations section. Your Type could take a parameter that is the logical unit number of the data file containing the values then use pretty standard Fortran "open" and "read" commands to take the data from the file and insert it into whatever data structure you want inside your Type. I'd suggest looking at Type15 for some ideas on implementing the "open" and "read" commands.</p>
<p>kind regards,</p>
<p> David</p>
<p> </p>
<div class="moz-cite-prefix">On 07/12/2021 07:44, George Kyriakarakos via TRNSYS-users wrote:</div>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px"><!-- meta ignored --><!-- node type 8 --><!-- node type 8 -->
<div class="WordSection1">
<p class="MsoNormal">Hi to all!<!-- o ignored --></p>
<p class="MsoNormal"><!-- o ignored --> </p>
<p class="MsoNormal">I am trying to develop a new type in TRNSYS. I have done this multiple times in the past successfully but this time I have 512 parameters to pass in the type (essentially an array of 16 lines x 32 columns). This data is calculated externally in MS Excel prior to running any simulation in TRNSYS.<!-- o ignored --></p>
<p class="MsoNormal">One approach I have thought about is to make all data in two columns in excel, use that file as an external file to the new type and during "Start Time" Manipulations to read the data and store them in the array I ultimately want to be accessible in the new type. If it gets in there it is easy to manipulate the data / include new arrays / etc. I would follow TYPE90 as a template in accomplishing this. This is not optimal though since I will have a very long list of data (512 lines) instead of having much less lines with more columns (this makes it easier to check as well).<!-- o ignored --></p>
<p class="MsoNormal">Is there any way to read a multi-columned external file? Is there a tutorial of some sort or a type I could follow as a template to develop this?<!-- o ignored --></p>
<p class="MsoNormal">Do you maybe have another suggestion on how to implement this?<!-- o ignored --></p>
<p class="MsoNormal"><!-- o ignored --> </p>
<p class="MsoNormal">Thank you in advance,<!-- o ignored --></p>
<p class="MsoNormal"><!-- o ignored --> </p>
<p class="MsoNormal">George<!-- o ignored --></p>
<p class="MsoNormal"><span style="font-size: 10.0pt; color: black; background: white; mso-fareast-language: EL;">--<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt; color: black; background: white; mso-fareast-language: EL;">Dr. George Kyriakarakos, Agricultural Engineer</span><span style="font-size: 10.0pt; color: black; mso-fareast-language: EL;"><br /><span style="background: white;">PhD, MSc Energy Systems & Renewable Energy Sources</span><br /><span style="background: white;">Agricultural University of Athens,</span><br /><span style="background: white;">Dept. of Natural Resources and Agricultural Engineering</span><br /><span style="background: white;">Iera odos street, 75, Athens 11855, Greece</span><br /><span style="background: white;">Tel. +30.210.5294046 (direct), Fax:+30.210.5294023</span><br /><span style="background: white;">Mobile +30.6942.046895</span><br /><span style="background: white;">e-mail: <a href="mailto:gk@aua.gr"><span style="color: #0563c1;">gk@aua.gr</span></a><!-- o ignored --></span></span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt; color: black; background: white; mso-fareast-language: EL;">Skype: georgekyriak</span><span style="color: black; mso-fareast-language: EL;"><!-- o ignored --></span></p>
<p class="MsoNormal"><!-- o ignored --> </p>
</div>
<br /><fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre">_______________________________________________
TRNSYS-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:TRNSYS-users@lists.onebuilding.org">TRNSYS-users@lists.onebuilding.org</a>
<a class="moz-txt-link-freetext" href="http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org">http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org</a>
</pre>
</blockquote>
<pre class="moz-signature">-- 
***************************
David BRADLEY
Principal
Thermal Energy Systems Specialists, LLC
3 North Pinckney Street - suite 202
Madison, WI  53703 USA

P:+1.608.274.2577
<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>
<!-- html ignored --><br />
<pre>_______________________________________________
TRNSYS-users mailing list
<a href="mailto:TRNSYS-users@lists.onebuilding.org">TRNSYS-users@lists.onebuilding.org</a>
<a href="http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org">http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org</a>
</pre>
</blockquote>
</body></html>