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

Re: [TRNSYS-users] Compaq visual fortran 6.1A



David,

I'm trying to change/develop user components and everything (CVF configurations, building of the different Dlls with old TRNSYS user types etc...) was ok until I decide to insert "use TRNSYSconstants" in one of my subroutine, compiler returning the following message:

T:\TypesUtil\Type242\Type242.f90(89) : Error: The module file cannot be read. Its format requires a more recent F90 compiler. [TRNSYSCONSTANTS]

Should I necessarly update my CVF to 6.6 or is there something i can do wrong ?

Module files (.mod) are compiler-dependent so you cannot mix different compiler versions. Theoretically, you could get rid of that error by recompiling the main TRNSYS DLL (TRNDll.dll) with your compiler. However, in your case you would have a different problem, which is that CVF versions prior to 6.6B do not fully support the instructions to build a multi-DLL project that are used in the TRNDll source code.

So in short, yes, you do have to upgrade to CVF 6.6B in order to be able to use the module files.

A more general note on adding user Types in external DLL's:
You can create Types in any programming language with a compiler that is able to create Windows DLL's. The advantage of using CVF6.6b (or IVF) is that you are able to directly "use" the data modules, which means you can use kernel constants and functions without having to re-declare them. If you are using another compiler (in Fortran or not), you are still able to create a user Type that uses the access functions, but you have to declare them correctly (see e.g the Trnsys.h file for C/C++ Types). So, again in theory, you should be able to create an external DLL with CVF 6.1 if you do not use the modules but rather access the kernel variables through access functions. This assumes CVF 6.1 is able to create working Windows DLL's, which I don't think is true. Please let us know if you succeed in doing so.


I hope this helps,

Michaël Kummert


--
_________________________________________________________

Michaël Kummert

Solar Energy Laboratory - University of Wisconsin-Madison
1303 Engr Res Bldg, 1500 Engineering Drive
Madison, WI 53706

Tel: +1 (608) 263-1589
Fax: +1 (608) 262-8464
E-mail: kummert@engr.wisc.edu

SEL Web Site: http://sel.me.wisc.edu
TRNSYS Web Site: http://sel.me.wisc.edu/trnsys