[TRNSYS-users] TRNSYS 15 components Legacy mode : gettim

Michaël Kummert kummert at engr.wisc.edu
Tue Jan 11 10:42:59 PST 2005


Cédric,

> I'm trying to use TRNSYS 15 components in legacy mode and I have some 
> problems.
> One of this type is using the command GETTIM wich permits to obtain the 
> time of the simulation thanks to the clock.for file. When I build the 
> TRNDLL, I have the error :
> Type240.obj : error LNK2001: unresolved external symbol _GETTIM
> Debug/TRNDll.dll : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
>  
> I've seen that in TRNSYS 16, the file clock.for doesn't exist anymore. 
> Does it have any importance if I run the TRNSYS 15 components in legacy 
> mode ?
> What can I do to solve this problem ? Shall I use another commmand ? The 
> command DATE_AND_TIME, for example ?

GETTIM is a Fortran runtime subroutine, not a TRNSYS-specific routine. 
In order to call GETTIM in a Type you need to USE the module where it is 
declared:

! With CVF 6.6b
use dflib
...
integer(2) :: tmphour, tmpminute, tmpsecond, tmphund
...
call gettim(tmphour, tmpminute, tmpsecond, tmphund)

! With IVF 8.1
use ifport
...
integer(4) :: tmphour, tmpminute, tmpsecond, tmphund
...
call gettim(tmphour, tmpminute, tmpsecond, tmphund)

I would prefer to use the DATE_AND_TIME routine because it is an 
intrinsic routine (you do not need to explicitely use a module):

Example from the CVF help:

Consider the following example executed on 2000 March 28 at 11:04:14.5:
   INTEGER DATE_TIME (8)
   CHARACTER (LEN = 12) REAL_CLOCK (3)
   CALL DATE_AND_TIME (REAL_CLOCK (1), REAL_CLOCK (2), &
                       REAL_CLOCK (3), DATE_TIME)

This assigns the value "20000328" to REAL_CLOCK (1), the value 
"110414.500" to REAL_CLOCK (2), and the value "-0500" to REAL_CLOCK (3). 
The following values are assigned to DATE_TIME: 2000, 3, 28, -300, 11, 
4, 14, and 500.

The following shows another example:

CHARACTER(10) t
CHARACTER(5) z
CALL DATE_AND_TIME(TIME = t, ZONE = z)


Kind regards,

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 at engr.wisc.edu

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



More information about the TRNSYS-users mailing list