[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] parameter cycle definition.



Dear Xavier,

The way to handle these cases in which you don't know how many parameters were defined by the cycle is to declare the size of the PAR array as a dummy value PARMAX, where PARMAX is equal to the maximum number of parameters that you would expect.
During the preprocessing of the input file, TRNSYS counts how many parameters are being specified in the input file and sends this information to the corresponding unit in the 4 location of the array INFO (i.e., INFO(4)).

For example, please go to the sourcecode of Type3.
On line 30 you find:
INTEGER*4 INFO(15),NPMAX,NI,NO,ND,IUNIT,ITYPE,ICNTRL
On line 35:
PARAMETER (NPMAX=16,NI=3,NO=4,ND=0)
During the first call manipulations you get the number of parameters specified in the input file, line 95:
NP=INFO(4)   !determine the number of parameters in the input file
>From there on, you can make your decisions based on this number. For example, on line 96 Type3 checks if the number of parameters supplied in the input file is within the expected range:
 IF((NP.GT.NPMAX).OR.(NP.LT.4)) CALL TYPECK(4,INFO,0,NP,0)

Please let me know if you have more questions implementing this strategy.
Best regards,

Diego


FAURE Xavier wrote:

Hy,

 

I’m programming a new type on the trnsys environment and i need de define cycle in parameter definition.

 

I was wondering how should be define the PAR vector in fortran since it length is a function of its first and second values?

 

When exporting the type as a fortran file, no difference appeared within the declaration of number of parameters (NP) and the PAR vector comparing with type without any cycle definition.

 

Can anyone give a hand for the declaration pb ?

 

Thank you by advance

Regards

 

Xavier Faure

CSTB

Enveloppes & Revêtements

Caractérisation Physique des Matériaux

24 rue Joseph Fourier

38400 Saint Martin d'Heres

Tel : 33 (0)4 76 76 25 74

Fax : 33 (0)4 76 76 25 60

web : www.cstb.fr

 


_______________________________________________ TRNSYS-users mailing list TRNSYS-users@engr.wisc.edu https://www.cae.wisc.edu/mailman/listinfo/trnsys-users


-- 
Diego A. Arias
TRNSYS Coordinator
Solar Energy Laboratory
University of Wisconsin - Madison
1500 Engineering Drive
Madison, WI 53706