<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Courier New \;color\:red";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Courier New \;color\:green";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Courier New \;color\:blue";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
color:black;
mso-fareast-language:EN-US;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;
mso-fareast-language:EN-GB;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;
color:black;
mso-fareast-language:EN-US;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></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]-->
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Thanks – took me a while to find the cause of this fault! Glad I solved it in the same way you did.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Still using TRNSYS16 to be compatible with other participants in the project.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Henk<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D"><o:p> </o:p></span></a></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:EN-GB"> David BRADLEY [mailto:d.bradley@tess-inc.com]
<br>
<b>Sent:</b> Wednesday, 5 July, 2017 4:12 PM<br>
<b>To:</b> henk witte <henk.witte@groenholland.nl>; TRNSYS users mailing list at OneBuilding.org <trnsys-users@lists.onebuilding.org><br>
<b>Subject:</b> Re: [TRNSYS-users] trnsys 16 dynamic data<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Henk,<span style="font-size:12.0pt;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p> It has been awhile but I think that with the Compaq Visual Fortran compiler (which we were using to develop Trnsys16) those temporary arrays were automatically deallocated on exiting the subroutine. The same was not true with the Intel Visual Fortran compiler
(which we used to develop Trnsys17). In v17 those arrays are explicitly deallocated (as you have done).<o:p></o:p></p>
<p>kind regards,<o:p></o:p></p>
<p> David<o:p></o:p></p>
<p><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 07/05/2017 07:51, henk witte via TRNSYS-users wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hello All,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I am not sure if this has been posted before or solved in trnsys 17.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I use routines that call the trnsys dynamic data routine to read in data from a file and interpolate data. Depending on the mode of the calling type (e.g. heat pump in heating or cooling mode) the data may be read several times during the
simulation as the calling type may wish to reread the correct data if the mode has changed.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Now, when this happens I get an error:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Severe(151):allocatable array is already allocated<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I could solve this by deallocating the temporary arrays in the dynamic data routine:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New""> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">SUBROUTINE</span></b><span style="font-size:10.0pt;font-family:"Courier New""> DYNAMICDATA(LUdd,NINDdd,NXdd,NYdd,Xdd,Ydd,INFO,*)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New"">
</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C**********************************************************************************************</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C THIS SUBROUTINE IS USED TO READ AND INTERPOLATE DATA FROM FREE FORMAT DATA FILES IN UP TO 4
</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C DIMENSIONS.</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C WRITTEN BY: D. Bradley at CSTB in Spring 2001 </span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C REVISION HISTORY</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C 2005.10.10 - DEB: changed calls to MESSAGES so that UNIT and TYPE number are now reported.</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C**********************************************************************************************</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">! Copyright © 2005 Solar Energy Laboratory, University of Wisconsin-Madison. All rights reserved.</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif"> </span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">!export this subroutine for its use in external DLLs.</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">!DEC$ATTRIBUTES DLLEXPORT :: DYNAMICDATA</span></b><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">…..<o:p></o:p></p>
<p class="MsoNormal">…..<o:p></o:p></p>
<p class="MsoNormal">…..<o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C save the previous array sizes - these will be used on the next call to make
</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C that the array always grows, never tries to shrink</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New""> OLDNX1dd=</span><span style="font-size:10.0pt;font-family:"Courier New";color:blue">SIZE</span><span style="font-size:10.0pt;font-family:"Courier New"">(X1dd,1)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New""> OLDNX2dd=</span><span style="font-size:10.0pt;font-family:"Courier New";color:blue">SIZE</span><span style="font-size:10.0pt;font-family:"Courier New"">(X2dd,1)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New"">OLDNX3dd=</span><span style="font-size:10.0pt;font-family:"Courier New";color:blue">SIZE</span><span style="font-size:10.0pt;font-family:"Courier New"">(X3dd,1)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New"">OLDNX4dd=</span><span style="font-size:10.0pt;font-family:"Courier New";color:blue">SIZE</span><span style="font-size:10.0pt;font-family:"Courier New"">(X4dd,1)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New"">OLDNLUdd=NLUdd</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New"">OLDNYMAXdd=NYMAXdd
</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:green",serif">C HW TO PREVENT ERRORS CLEAN UP THE TEMPORARY ARRAYS:</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(X1TEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New""> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(X2TEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(X3TEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(X4TEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(LUSTORTEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(YDATATEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><span style="font-size:10.0pt;font-family:"Courier New""> </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(DATAINTEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">DEALLOCATE</span></b><span style="font-size:10.0pt;font-family:"Courier New"">(IPTTEMPdd)</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:red",serif">
</span><b><span style="font-size:10.0pt;font-family:"Courier New ;color:blue",serif">END</span></b><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Should this not have been done anyway, or am I missing something and will this actually cause problems?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">Henk Witte</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">Groenholland Geo-energysystems</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">Valschermkade 26</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">1059CD Amsterdam</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">T: +31 (0)20 6159050</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">M: +31 (0)628176535</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL" style="mso-fareast-language:EN-GB">E: <a href="mailto:henk.witte@groenholland.nl">
henk.witte@groenholland.nl</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="NL"> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>TRNSYS-users mailing list<o:p></o:p></pre>
<pre><a href="mailto:TRNSYS-users@lists.onebuilding.org">TRNSYS-users@lists.onebuilding.org</a><o:p></o:p></pre>
<pre><a href="http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org">http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-GB"><br>
<br>
<o:p></o:p></span></p>
<pre>-- <o:p></o:p></pre>
<pre>***************************<o:p></o:p></pre>
<pre>David BRADLEY<o:p></o:p></pre>
<pre>Principal<o:p></o:p></pre>
<pre>Thermal Energy Systems Specialists, LLC<o:p></o:p></pre>
<pre>22 North Carroll Street - suite 370<o:p></o:p></pre>
<pre>Madison, WI 53703 USA<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>P:+1.608.274.2577<o:p></o:p></pre>
<pre>F:+1.608.278.1475<o:p></o:p></pre>
<pre><a href="mailto:d.bradley@tess-inc.com">d.bradley@tess-inc.com</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><a href="http://www.tess-inc.com">http://www.tess-inc.com</a><o:p></o:p></pre>
<pre><a href="http://www.trnsys.com">http://www.trnsys.com</a><o:p></o:p></pre>
</div>
</body>
</html>