      subroutine fegnam (nreg, name, lename)

c returns the F-E geographic region name given the geographic
c  region number

      character*(*) name
      character*10 chival

      common /gnames/ gindex(757), gareas
      integer*2 gindex
      character*13000 gareas

      logical first/.true./

      if (nreg .lt. 1 .or. nreg .gt. 757)
     2      call abort ('fegnam: Bad region number'//chival(nreg))
      if (first) then
        first = .false.
        
c Following added to guarantee the index is zero initially - for PC version
c This is not necessary for Unix version - but keeps the sources the same

        do i=1,757
         gindex(i) = 0
        end do


        call setnam
      end if
      if (nreg .eq. 1) then
        ib = 1
      else
        ib = gindex(nreg-1) + 1
      end if
      il = gindex(nreg)
      lename = 1 + il - ib
      name(:lename) = gareas(ib:il)
      return
      end
