cdeck homr3c
      subroutine homr3c (temp,nfld)
      real temp(nfld)
      include 'maincomo.for'
      include 'homerc.for'
      logical   qfing, qfinf
c   temp(1) - xmin
c   temp(2) - xmax
c   temp(3) - ymin
c   temp(4) - ymax
   10 temp(1)=0.1e30
      temp(2)=-0.1e30
      temp(3)=0.1e30
      temp(4)=-0.1e30
   20 call homer2 (temp(5),temp(6),temp(7),qfing,qfinf,temp)
      if (qfinf) return
      if (qfing) then
         xco(idic)=temp(1)
         yco(idic)=temp(3)
         if (nint(idic).eq.0) nint(idic)=100
         siz(idic)=max((temp(2)-temp(1))/float(nint(idic)-1),(temp(4)
     1   -temp(3))/float(nint(idic)-1))
         go to 10
      else
         if (temp(5).gt.temp(2)) then
            temp(2)=temp(5)
         elseif (temp(5).lt.temp(1)) then
            temp(1)=temp(5)
         endif
         if (temp(6).gt.temp(4)) then
            temp(4)=temp(6)
         elseif (temp(6).lt.temp(3)) then
            temp(3)=temp(6)
         endif
      endif
      go to 20
      end
