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

[TRNSYS-users] Using storage array in TRNSYS Type written C++



Hello,

 

I have just discovered a bug with TRNSYS.h head file bundled with TRNSYS 16 in the following folders

 

..\TRNSYS\Compilers\Cpp-Mvs2003\Include

..\TRNSYS\SourceCode\Templates

 

In this file, you will find the setStorageVars and GetStorageVars declaration:

 

extern "C" __declspec(dllimport)   void _cdecl SETSTORAGEVARS(int* STORE_IN,int* NSTORE,int info[]);

extern "C" __declspec(dllimport)   void _cdecl GETSTORAGEVARS(int* STORE_OUT,int* NSTORE,int info[]);

 

which should be modified as following, in my opnion

 

extern "C" __declspec(dllimport)   void _cdecl SETSTORAGEVARS(double STORE[], int* NSTORE,int info[]);

extern "C" __declspec(dllimport)   void _cdecl GETSTORAGEVARS(double STORE[], int* NSTORE,int info[]);

 

because the passage variable STORED or STORE is declared as double precision array in the Fortran subroutine storage.for.

 

Here I enclosed an example in PDF format for using this storage array in TRNSYS Type written in C/C++. This CPP file can be easily compiled by the free version Visual Studio/C++ Express 2003 or 2005 or 2008 with Windows Platform SDK SP2/R2.

 

With my best regards,

 

Wen HU   Ph.D

Thermal Science Engineer

 

Attachment: Type234Cpp_Listing_Deck.pdf
Description: Adobe PDF document