7019
|
1 c Copyright (C) 2007 John W. Eaton |
|
2 c |
|
3 c This file is part of Octave. |
|
4 c |
|
5 c Octave is free software; you can redistribute it and/or modify it |
|
6 c under the terms of the GNU General Public License as published by the |
|
7 c Free Software Foundation; either version 3 of the License, or (at your |
|
8 c option) any later version. |
|
9 c |
|
10 c Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 c for more details. |
|
14 c |
|
15 c You should have received a copy of the GNU General Public License |
|
16 c along with Octave; see the file COPYING. If not, see |
|
17 c <http://www.gnu.org/licenses/>. |
|
18 |
6572
|
19 subroutine fortsub (n, a, s) |
|
20 implicit none |
|
21 character*(*) s |
|
22 real*8 a(*) |
|
23 integer*4 i, n, ioerr |
|
24 do i = 1, n |
|
25 if (a(i) .eq. 0d0) then |
|
26 call xstopx ('fortsub: divide by zero') |
|
27 else |
|
28 a(i) = 1d0 / a(i) |
|
29 endif |
|
30 enddo |
|
31 write (unit = s, fmt = '(a,i3,a,a)', iostat = ioerr) |
|
32 $ 'There are ', n, ' values in the input vector', |
|
33 $ char(0) |
|
34 if (ioerr .ne. 0) then |
|
35 call xstopx ('fortsub: error writing string') |
|
36 endif |
|
37 return |
|
38 end |
|
39 |