<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Henk,</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).</p>
<p>kind regards,</p>
<p> David</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 07/05/2017 07:51, henk witte via
TRNSYS-users wrote:<br>
</div>
<blockquote type="cite"
cite="mid:DB56AC81DDEA944392C0455F823696E1B0438B7A@GROENHOL-SRV1.groenholland.local">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
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;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
mso-fareast-language:EN-US;}
@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]-->
<div class="WordSection1">
<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">
</span><span style="font-size:10.0pt;font-family:"Courier
New""> <b><span style="color:blue">SUBROUTINE</span></b>
DYNAMICDATA(LUdd,NINDdd,NXdd,NYdd,Xdd,Ydd,INFO,*)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier New"">
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C**********************************************************************************************<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C THIS SUBROUTINE IS USED TO READ AND
INTERPOLATE DATA FROM FREE FORMAT DATA FILES IN UP TO 4
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C DIMENSIONS.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C WRITTEN BY: D. Bradley at CSTB in
Spring 2001 <o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C REVISION HISTORY<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C 2005.10.10 - DEB: changed calls to
MESSAGES so that UNIT and TYPE number are now reported.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C**********************************************************************************************<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">! Copyright © 2005 Solar Energy
Laboratory, University of Wisconsin-Madison. All rights
reserved.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">!export this subroutine for its use
in external DLLs.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">!DEC$ATTRIBUTES DLLEXPORT ::
DYNAMICDATA</span></b><span
style="font-size:10.0pt;font-family:"Courier
New";color:green"><o:p></o:p></span></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">C save the previous array sizes -
these will be used on the next call to make
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C that the array always grows,
never tries to shrink<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New""> OLDNX1dd=<span style="color:blue">SIZE</span>(X1dd,1)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New""> OLDNX2dd=<span style="color:blue">SIZE</span>(X2dd,1)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New"">OLDNX3dd=<span style="color:blue">SIZE</span>(X3dd,1)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New"">OLDNX4dd=<span style="color:blue">SIZE</span>(X4dd,1)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New"">OLDNLUdd=NLUdd<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New"">OLDNYMAXdd=NYMAXdd
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:green">C HW TO PREVENT ERRORS CLEAN UP THE
TEMPORARY ARRAYS:<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</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"">(X1TEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New""> <b><span style="color:blue">DEALLOCATE</span></b>(X2TEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</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"">(X3TEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</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"">(X4TEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</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"">(LUSTORTEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</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"">(YDATATEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><span style="font-size:10.0pt;font-family:"Courier
New""> <b><span style="color:blue">DEALLOCATE</span></b>(DATAINTEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</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"">(IPTTEMPdd)<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Courier
New";color:red">
</span><b><span
style="font-size:10.0pt;font-family:"Courier
New";color:blue">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 style="mso-fareast-language:EN-GB"
lang="NL">Henk Witte<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL">Groenholland Geo-energysystems<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL">Valschermkade 26<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL">1059CD Amsterdam<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL">T: +31 (0)20 6159050<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL">M: +31 (0)628176535<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-GB"
lang="NL">E: <a class="moz-txt-link-abbreviated" href="mailto:henk.witte@groenholland.nl">henk.witte@groenholland.nl</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="NL"><o:p> </o:p></span></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
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>
<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>