view examples/fortransub.f @ 18951:5bfedd39cc77

Fix indexing in patch if x/y/zdata are row vectors (bug #42822) * graphics.cc (patch::properties::update_fvc): Get column vectors from x/y/zdata if xdata is a row vector.
author Andreas Weber <andy.weber.aw@gmail.com>
date Tue, 22 Jul 2014 12:05:28 +0200
parents 4b32677b6229
children
line wrap: on
line source

      subroutine fortransub (n, a, s)
      implicit none
      character*(*) s
      real*8 a(*)
      integer*4 i, n, ioerr
      do i = 1, n
        if (a(i) .eq. 0d0) then
          call xstopx ('fortransub: divide by zero')
        else
          a(i) = 1d0 / a(i)
        endif
      enddo
      write (unit = s, fmt = '(a,i3,a,a)', iostat = ioerr)
     $       'There are ', n,
     $       ' values in the input vector', char(0)
      if (ioerr .ne. 0) then
        call xstopx ('fortransub: error writing string')
      endif
      return
      end