c=========================================================== c Writes a double precision vector to file 'fname'. c If fname is the string '-' then the vector is written c to standard output. c=========================================================== subroutine dvto(fname,v,n) c----------------------------------------------------------- c Arguments: c c fname: (I) File name c v: (I) Vector to be written c n: (I) Length of vector c----------------------------------------------------------- implicit none integer getu, indlnb character*(*) fname integer n real*8 v(n) integer ustdout parameter ( ustdout = 6 ) integer i, uto, rc if( fname .eq. '-' ) then uto = ustdout else uto = getu() open(uto,file=fname(1:indlnb(fname)), & form='formatted',iostat=rc) if( rc .ne. 0 ) then write(0,*) 'dvto: Error opening ', & fname(1:indlnb(fname)) return end if end if do i = 1 , n write(uto,*) v(i) end do if( uto .ne. ustdout ) then close(uto) end if return end