c=========================================================== c Test program for subroutine 'dvappend'. c c Program expects two arguments, the name of a file c for output and the length of a test vector to be c appended to the file. c c lnx1% pwd c /home/phys410/util c c lnx1% make tdvappend c pgf77 -g -Msecond_underscore -c tdvappend.f c pgf77 -g -Msecond_underscore -c dvappend.f c pgf77 -g -Msecond_underscore -L/usr/local/PGI/lib \ c tdvappend.o dvappend.o -lp410f -o tdvappend c Linking: c c lnx1% tdvappend foo 5 c lnx1% cat foo c 1.000000000000000 c 2.000000000000000 c 3.000000000000000 c 4.000000000000000 c 5.000000000000000 c c lnx1% tdvappend foo 5 c lnx1% cat foo c 1.000000000000000 c 2.000000000000000 c 3.000000000000000 c 4.000000000000000 c 5.000000000000000 c 1.000000000000000 c 2.000000000000000 c 3.000000000000000 c 4.000000000000000 c 5.000000000000000 c=========================================================== program tdvappend integer iargc, i4arg integer maxn parameter ( maxn = 100 000 ) real*8 v(maxn) integer n integer i character*256 fname if( iargc() .ne. 2 ) go to 900 call getarg(1,fname) n = i4arg(2,-1) if( n .eq. -1 ) go to 900 n = min(n,maxn) do i = 1 , n v(i) = i end do call dvappend(fname,v,n) stop c----------------------------------------------------------- c Usage exit c----------------------------------------------------------- 900 continue write(0,*) 'usage: tdvappend ' stop end