[TRNSYS-users] Problem with initialization when callinguser-written component

keilholz, werner werner.keilholz at cstb.fr
Mon Jan 7 08:04:06 PST 2008


Hi Knut, 

Be careful, the version signing stuff is checked by 

Inf(7) .EQ. -2 

In FORTRAN, but this translates to 
    if (info[6]== -2)
in C++ (C arrays start at 0, FORTRAN arrays at 1 - see the comments generated when you use File/Export to C++ in the Studio). 

I just wrote a type in C++ and it behaves as expected.
It's a quite simple , if you want I can send you the source code.

Werner

-----Message d'origine-----
De : knut.erik.enerstvedt at niva.no [mailto:knut.erik.enerstvedt at niva.no] 
Envoyé : lundi 7 janvier 2008 15:55
À : trnsys-users at engr.wisc.edu
Objet : [TRNSYS-users] Problem with initialization when callinguser-written component

Dear TRNSYS users,

I have written a new TRNSYS Type in C++ which will not work because TRNSYS
skips the initialization procedures. The result is that TRNSYS crashes
because arrays are not sized properly etc. I have checked some values of
the INFO array during program execution, and they show that at the very
first call to the Unit, INFO(8) (in FORTRAN, info[7] in C++) already has a
value of 4. This means that the version signing, initialization call
(INFO(7)=-1) and time=start time steps are not executed.

Does anyone know why this happens?

Thanks in advance.

Kind regards,

Knut Erik Enerstvedt




----------------------------------------------------------------------------------------------------------------------
NIVAs hovedkontor har flyttet til nye lokaler i CIENS - Forskningssenter
for miljø og samfunn; Gaustadalléen 21, 0349 Oslo. Meld deg på vårt
nyhetsbrev på www.niva.no


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



 
 
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************






 
 
************************************************************************************
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer viruses.
************************************************************************************







More information about the TRNSYS-users mailing list