kusano 2b45e8
      subroutine zrotgf(ca,cb,c,s)
kusano 2b45e8
      double complex ca,cb,s
kusano 2b45e8
      double precision c
kusano 2b45e8
      double precision norm,scale
kusano 2b45e8
      double complex alpha
kusano 2b45e8
      if (cdabs(ca) .ne. 0.0d0) go to 10
kusano 2b45e8
         c = 0.0d0
kusano 2b45e8
         s = (1.0d0,0.0d0)
kusano 2b45e8
         ca = cb
kusano 2b45e8
         go to 20
kusano 2b45e8
   10 continue
kusano 2b45e8
         scale = cdabs(ca) + cdabs(cb)
kusano 2b45e8
kusano 2b45e8
         norm = scale*dsqrt((cdabs(ca/dcmplx(scale,0.0d0)))**2 +
kusano 2b45e8
     *                      (cdabs(cb/dcmplx(scale,0.0d0)))**2)
kusano 2b45e8
kusano 2b45e8
         alpha = ca /cdabs(ca)
kusano 2b45e8
         c = cdabs(ca) / norm
kusano 2b45e8
         s = alpha * dconjg(cb) / norm
kusano 2b45e8
         ca = alpha * norm
kusano 2b45e8
   20 continue
kusano 2b45e8
      return
kusano 2b45e8
      end