Mercurial > octave-nkf
annotate examples/fortsub.f @ 14704:551566201318 stable release-3-6-2
Version 3.6.2 released.
* configure.ac (AC_INIT): Version is now 3.6.2.
(OCTAVE_RELEASE_DATE): Now 2012-05-31.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 31 May 2012 11:22:15 -0400 |
parents | 4295d634797d |
children |
rev | line source |
---|---|
6572 | 1 subroutine fortsub (n, a, s) |
2 implicit none | |
3 character*(*) s | |
4 real*8 a(*) | |
5 integer*4 i, n, ioerr | |
6 do i = 1, n | |
7 if (a(i) .eq. 0d0) then | |
8 call xstopx ('fortsub: divide by zero') | |
9 else | |
10 a(i) = 1d0 / a(i) | |
11 endif | |
12 enddo | |
13 write (unit = s, fmt = '(a,i3,a,a)', iostat = ioerr) | |
7081 | 14 $ 'There are ', n, |
15 $ ' values in the input vector', char(0) | |
6572 | 16 if (ioerr .ne. 0) then |
17 call xstopx ('fortsub: error writing string') | |
18 endif | |
19 return | |
20 end | |
21 |