Mercurial > octave-nkf
annotate examples/fortsub.f @ 16033:23a7661e529a ss-3-7-2
snapshot version 3.7.2
* configure.ac (AC_INIT): Set version to 3.7.2.
(OCTAVE_RELEASE_DATE): Set to 2013-02-09.
(OCTAVE_COPYRIGHT): Update year.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 10 Feb 2013 00:59:19 -0500 |
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 |