C C LINKTIME C C******************************************************************************* C C Copyright (C) 1993, California Institute of Technology. U.S. C Government Sponsorhip under NASA Contract NAS7-918 is C acknowledged. C C******************************************************************************* C C This program is COMPILED, LINKED, and EXECUTED just prior to linking C another program. It creates the function subroutine LNKTIM. The C function LNKTIM then provides the link time when it is call by the main C program. C For example, C C (1) Edit the program test.for C program test C : C character*24 x, lnktim C external lnktim C : C : C x = lnktim() C print *, 'Test created at ',x C : C : C stop C end C C (2) Compile and link as follows: C C FOR TEST C FOR LINKTIME C LINK LINKTIME C RUN LINKTIME C LINK TEST, LNKTIM C C (3) when the program TEST is executed, the line C C Test created at 4-JUL-1776 12:00:00 C C will be printed out. C C NOTE: THIS program, LINKTIME, is not actually linked with the C main program. It is an independent program which C is compiled and executed at linkage of the main program. C The subroutine LNKTIM which is created by LINKTIME C is what is really used!!. C C CREATION LOG: created by UNKNOWN AUTHOR C at an UNKNOWN TIME C in an UNKNOWN PLACE C character*8 timebuf character*9 datebuf call DATE(datebuf) call TIME(timebuf) open(unit=10,name='lnktim.f',status='NEW') write(10,*) ' FUNCTION LNKTIM()' write(10,*) ' CHARACTER*(*) LNKTIM' write(10,100) datebuf, timebuf 100 format(' LNKTIM = ''',A9,1x,a8,'''') write(10,*) ' END' close(10) write(6,*)'Link Time is ',datebuf,' ',timebuf end