[TRNSYS-users] trnsys 16 dynamic data

henk witte via TRNSYS-users trnsys-users at lists.onebuilding.org
Wed Jul 5 07:14:47 PDT 2017


Thanks - took me a while to find the cause of this fault! Glad I solved it in the same way you did.

Still using TRNSYS16 to be compatible with other participants in the project.


Henk

From: David BRADLEY [mailto:d.bradley at tess-inc.com]
Sent: Wednesday, 5 July, 2017 4:12 PM
To: henk witte <henk.witte at groenholland.nl>; TRNSYS users mailing list at OneBuilding.org <trnsys-users at lists.onebuilding.org>
Subject: Re: [TRNSYS-users] trnsys 16 dynamic data


Henk,

  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).

kind regards,

 David



On 07/05/2017 07:51, henk witte via TRNSYS-users wrote:
Hello All,

I am not sure if this has been posted before or solved in trnsys 17.

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.

Now, when this happens I get an error:

Severe(151):allocatable array is already allocated


I could solve this by deallocating the temporary arrays in the dynamic data routine:

      SUBROUTINE DYNAMICDATA(LUdd,NINDdd,NXdd,NYdd,Xdd,Ydd,INFO,*)

C**********************************************************************************************
C THIS SUBROUTINE IS USED TO READ AND INTERPOLATE DATA FROM FREE FORMAT DATA FILES IN UP TO 4
C  DIMENSIONS.
C
C WRITTEN BY: D. Bradley at CSTB in Spring 2001
C
C REVISION HISTORY
C  2005.10.10 - DEB: changed calls to MESSAGES so that UNIT and TYPE number are now reported.
C**********************************************************************************************
! Copyright (c) 2005 Solar Energy Laboratory, University of Wisconsin-Madison. All rights reserved.

!export this subroutine for its use in external DLLs.
!DEC$ATTRIBUTES DLLEXPORT :: DYNAMICDATA

.....
.....
.....
C     save the previous array sizes - these will be used on the next call to make
C      that the array always grows, never tries to shrink
      OLDNX1dd=SIZE(X1dd,1)
      OLDNX2dd=SIZE(X2dd,1)
      OLDNX3dd=SIZE(X3dd,1)
      OLDNX4dd=SIZE(X4dd,1)
      OLDNLUdd=NLUdd
      OLDNYMAXdd=NYMAXdd
C HW  TO PREVENT ERRORS CLEAN UP THE TEMPORARY ARRAYS:
      DEALLOCATE(X1TEMPdd)
      DEALLOCATE(X2TEMPdd)
      DEALLOCATE(X3TEMPdd)
      DEALLOCATE(X4TEMPdd)
      DEALLOCATE(LUSTORTEMPdd)
      DEALLOCATE(YDATATEMPdd)
      DEALLOCATE(DATAINTEMPdd)
      DEALLOCATE(IPTTEMPdd)
      END

Should this not have been done anyway, or am I missing something and will this actually cause problems?

Thanks!

Henk Witte
Groenholland Geo-energysystems
Valschermkade 26
1059CD Amsterdam

T: +31 (0)20 6159050
M: +31 (0)628176535
E: henk.witte at groenholland.nl<mailto:henk.witte at groenholland.nl>





_______________________________________________

TRNSYS-users mailing list

TRNSYS-users at lists.onebuilding.org<mailto:TRNSYS-users at lists.onebuilding.org>

http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org



--

***************************

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

d.bradley at tess-inc.com<mailto:d.bradley at tess-inc.com>



http://www.tess-inc.com

http://www.trnsys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20170705/ff195c7f/attachment-0003.htm>


More information about the TRNSYS-users mailing list