<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear David, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Many thanks, but I followed your instructions and
when I compile my Type a lot of errors appear:</FONT></DIV>
<DIV><FONT face=Arial size=2>1. I wrote the following at the uses statement of
my type:</FONT></DIV>
<DIV><FONT face=Arial size=2>USE TrnsysData, ONLY:
STORED,OUT,OCHECK,a,b,c,r,Tn,Tnm05,Tnm1</FONT></DIV>
<DIV><FONT face=Arial size=2>These arrays are my allocatable arrays which I
defined as allocatable within the Trnsysdata routine, as you suggested. The
compilation error is:</FONT></DIV>
<DIV><FONT face=Arial size=2>Error: Name in only-list does not
exist. [STORED]</FONT></DIV>
<DIV><FONT face=Arial size=2>2. In my type I also included the allocate
instructiion, after reading the values of the parameters, as:</FONT></DIV>
<DIV><FONT face=Arial size=2>IF(.NOT.ALLOCATED(STORED))
ALLOCATE(STORED(NSTORED),stat=istat)</FONT></DIV>
<DIV><FONT face=Arial size=2>And the compilation error is:</FONT></DIV>
<DIV><FONT face=Arial size=2>Error: This name does not have a type, and must
have an explicit type. [STORED]</FONT></DIV>
<DIV><FONT face=Arial size=2>and:</FONT></DIV>
<DIV><FONT face=Arial size=2>Error: An array-valued argument is required in this
context. [ALLOCATED]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Do you know what are the causes of these
errors?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Many thanks again, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jordi Cipriano </FONT></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=bradley@tess-inc.com href="mailto:bradley@tess-inc.com">David
Bradley</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=cipriano@cimne.upc.edu
href="mailto:cipriano@cimne.upc.edu">jordi cipriano</A> ; <A
title=trnsys-users@engr.wisc.edu
href="mailto:trnsys-users@engr.wisc.edu">trnsys-users@engr.wisc.edu</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, May 25, 2007 12:14 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [TRNSYS-users] Problems with
dynamic arrays definition in new types</DIV>
<DIV><BR></DIV>Jordi,<BR> You have run into an annoyance of Fortran. As
soon as you leave the Type subroutine, the allocatable array disappears. What
you need to do is define the allocatable array globally in a "data only
module" Your ALLOCATE instruction stays where it is but then the array doesn't
disappear. You can see what I mean if you look at the file TRNSYSData.for. You
will see the lines:<BR><BR><FONT face="Arial, Helvetica" color=#008000>C
********* DECLARE ALLOCATABLE ARRAYS FOR USE IN DYNDATA <BR></FONT><FONT
face="Arial, Helvetica" color=#0000ff><B>DOUBLE PRECISION</B></FONT><FONT
face="Arial, Helvetica">, </FONT><FONT face="Arial, Helvetica"
color=#0000ff><B>ALLOCATABLE</B> </FONT><FONT face="Arial, Helvetica">:: X1dd(
: ,: ),X2dd( : ,: ),X3dd( : ,: )<BR></FONT><FONT face="Arial, Helvetica"
color=#0000ff><B>DOUBLE PRECISION</B></FONT><FONT face="Arial, Helvetica">,
</FONT><FONT face="Arial, Helvetica" color=#0000ff><B>ALLOCATABLE</B>
</FONT><FONT face="Arial, Helvetica">:: X4dd( : ,: ),YDATAdd( : ,: ),DATAINdd(
: )<BR></FONT><FONT face="Arial, Helvetica"
color=#0000ff><B>INTEGER</B></FONT> <FONT face="Arial, Helvetica">,
</FONT><FONT face="Arial, Helvetica" color=#0000ff><B>ALLOCATABLE</B>
</FONT><FONT face="Arial, Helvetica">:: LUSTORdd( : ), IPTdd( :
)<BR><BR></FONT>those lines declare the allocatable arrays that are actually
used in the DynamicData routine.<BR>Cheers,<BR> David<BR><BR>At 11:03
5/24/2007, jordi cipriano wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite"><FONT size=2>Dear Trnsys users,
<BR></FONT> <BR><FONT size=2>I have a question concerning to the use of
Dynamic arrays in new Trnsys types. I'm programming a new Type with fortran
90 and I'm using the instruction ALLOCATABLE to define the dimension of some
arrays. This dimension is depending on an input defined in the proforma.
<BR></FONT> <BR><FONT size=2>The issue is that I don't exactly know at
which step iteration should I define the array dimension so that this
dimenson keeps saved in each iteration. In other words, if I define the
array dimension just bellow the variables definition, each time the trnsys
call my type, the matrix appear as "Undefined pointer/array" until trnsys
finds the ALLOCATE instruction. This happens even if I've already defined
the dimension in previous iteration callings. This fact affects all the
calculations because one of the arrays is the STORED array, which I use to
update the temporary terms of my ecuations. <BR></FONT> <BR><FONT
size=2>Does anybody know who to solve this
problem?<BR></FONT> <BR><FONT size=2>Many thanks,
<BR></FONT> <BR><FONT size=2>Jordi
Cipriano<BR>BEE-Group<BR>CIMNE-Terrassa<BR>CIMNE. Spain
<BR></FONT><BR>_______________________________________________<BR>TRNSYS-users
mailing list<BR>TRNSYS-users@engr.wisc.edu<BR><A
href="https://www.cae.wisc.edu/mailman/listinfo/trnsys-users"
eudora="autourl">https://www.cae.wisc.edu/mailman/listinfo/trnsys-users</A></BLOCKQUOTE><X-SIGSEP>
<P></X-SIGSEP>****************************************************************************************<BR>Thermal
Energy System Specialists (TESS), LLC <BR>David
BRADLEY
2916 Marketplace Drive - Suite 104
<BR>Partner
Madison, WI 53719 <BR>Phone: (608) 274-2577 USA <BR>Fax: (608) 278-1475
<BR>E-mail: bradley@tess-inc.com <BR>Web Pages: <A
href="http://www.tess-inc.com/"
eudora="autourl">http://www.tess-inc.com</A>
and <A href="http://www.trnsys.com/"
eudora="autourl">http://www.trnsys.com<BR><BR></A>"Providing software
solutions for today's energy engineering projects"
<BR>****************************************************************************************<BR></P></BLOCKQUOTE></BODY></HTML>