Hi Werner, Thank you for your answer.
I am aware of the difference between FORTRAN and C++ array indices, and have checked that these are correct in my code. I still can't get TRNSYS to do the version signing (info[6] == -2) and initialization (info[6] == -1). It would be helpful if you could send me the source code of your C++ Type, as you are suggesting. Kind regards, Knut Erik "keilholz, werner" <werner.keilholz@ To cstb.fr> <[EMAIL PROTECTED]>, <trnsys-users@engr.wisc.edu> 01/07/2008 05:04 cc PM Subject RE: [TRNSYS-users] Problem with initialization when callinguser-written component 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 : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : lundi 7 janvier 2008 15:55 À : trnsys-users@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@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. ************************************************************************************ ---------------------------------------------------------------------------------------------------------------------- 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@engr.wisc.edu https://www.cae.wisc.edu/mailman/listinfo/trnsys-users