      SUBROUTINE FIELDN(FEELD,RACENT,DECENT,RAMIN,RAMAX,DECMIN,DECMAX)
C+
C     F I E L D N  - Fortran 77 subroutine
C
C  Convert the supplied UKST field number to field coordinates.
C  Range is restricted between 1-1309.   Supply coordinates
C  for the SKYCHART routine.
C
C  INPUT
C		FEELD	Integer		Field number (>0<=1309)
C  OUTPUT
C		RACENT	Real*8		RA  of field centre (HH.MMSS)
C		DECENT	Real*8		DEC of field centre (DD.MMSS)
C  AUTHOR
C		Ken Russell : UKST : 1986 June 10
C  History
C		A conversion from the PET Basic routine.
C-
      IMPLICIT  NONE
      INTEGER*2 FEELD,FTEMP,NUMBER,RH,RM,RA
      REAL*8    RACENT, DECENT, RASIZE, EXTENT, RAMAX, RAMIN, DECMIN,
     >          DECMAX

      DECENT = -90.0000

      IF (FEELD .EQ. 0)    FEELD = 1
      IF (FEELD .GT. 1309) FEELD = 1309

*  Check if it is field 1  .. this is a special case

      IF (FEELD .EQ. 1 ) THEN
         RACENT = 0.0
	 RAMIN = 0.0
	 RAMAX = 24.0
	 DECMIN = -90.0
	 DECMAX = -85.0
         RETURN
      END IF

      FTEMP = FEELD - 1
  10  DECENT = DECENT + 5.0		! Move to next Declination band
C
C Derive field size in RA for this declination band
C
      RASIZE = INT(ABS(20 / COS(0.0168389 * DECENT)) + 0.5)
C
C Algorithm doesn't work for Declination equal to +15 .. fudge it
C
      IF (INT(ABS(DECENT)+0.5) .EQ. 15) RASIZE = RASIZE - 1.0
C
C Derive number of fields in this declination band, based on RA separation
C
      NUMBER = INT((1440.0 / RASIZE) + 0.7)
C
C If Number greater than the remaining fields then field is within this band
C
      IF (NUMBER .GE. FTEMP) GOTO 20
C
C  Decrement the temporary field number by the number of fields in this band
C
      FTEMP = FTEMP - NUMBER

      GOTO 10		! Return and check next declination band
C
C  Evaluate coordinates and exit
C
  20  RACENT = RASIZE * (FTEMP - 1)

	EXTENT = RASIZE / 2.0
	RAMIN = (RACENT - EXTENT) / 60.0
	RAMAX = (RACENT + EXTENT) / 60.0

      RH = INT(RACENT / 60.0)
      RM = INT(RACENT - RH * 60.0)
      RA = RH * 100 + RM
      RACENT = DFLOAT(RA) / 100.0

* Addition for the SKYCHART

	DECMIN = DECENT
	DECMAX = DECENT + 5.0
      END

