      SUBROUTINE EQBOUN( TCGM,TRFMAX,DAYJUL,EFFKP,TRFEB )
C***********************************************************************
C* SUBROUTINE NAME:  EQBOUN           CPC :  SS/MOD/RTN/EQBOUN         *
C*         VERSION:  90-REF           DATE:  23 OCT 90                 *
C*                                                                     *
C*         PURPOSE:  COMPUTE THE EQUATORWARD BOUNDARY OF THE SUB-      *
C*                   AURORAL TROUGH.                                   *
C*                                                                     *
C*         CALLING                                                     *
C*       ARGUMENTS:  TCGM,TRFMAX,DAYJUL,EFFKP,TRFEB                    *
C*                                                                     *
C*  ABBREVIATIONS:  NONE                                               *
C*                                                                     *
C*  COMMON BLOCKS:  NONE                                               *
C*                                                                     *
C* FILES ACCESSED:  NONE                                               *
C*                                                                     *
C*         METHOD:  1.  VERIFY MAGNETIC LOCAL TIME IS APPROPRIATE FOR  *
C*                      A TROUGH.                                      *
C*                                                                     *
C*                  2.  COMPUTE NUMBER OF MLT HOURS AWAY FROM CENTER   *
C*                      OF TROUGH.                                     *
C*                                                                     *
C*                  3.  COMPUTE MAXIMUM WIDTH OF TROUGH.               *
C*                                                                     *
C*                  4.  COMPUTE EQUATIONS FOR PARABOLAS DESCRIBING THE *
C*                      SHAPE OF THE TROUGH BASED ON WIDTH.            *
C*                                                                     *
C*                  5.  COMPUTE EQUATORWARD BOUNDARY FROM PARABOLAS.   *
C*                                                                     *
C*        REMARKS:  NONE                                               *
C*                                                                     *
C*     REFERENCES:  1.  AFGWC DATA FORMAT HANDBOOK                     *
C*                  2.  SPERRY FORTRAN-77(ASCII) PRM                   *
C*                  3.  AFGWC FORM 10 DX-50194                         *
C*                  4.  AFGWC FORM 10 DX-60096                         *
C*                                                                     *
C* GLOBAL VARIABLES : NONE                                             *
C*                                                                     *
C* LOCAL VARIABLES :                                                   *
C*                  TCGM   - RS - MAGNETIC LOCAL TIME                  *
C*                  TRFMAX - RS - POLEWARD BOUNDARY OF TROUGH          *
C*                  DAYJUL - RS - JULIAN DAY OF YEAR                   *
C*                  EFFKP  - RS - EFFECTIVE KP INDEX                   *
C*                  TRFEB  - RS - EQUATORWARD BOUNDARY OF TROUGH       *
C*                  DELTAT - RS - HOURS FROM CENTER OF TROUGH          *
C*                  KPWDTH - RS - MAXIMUM WIDTH OF TROUGH BASED ON KP  *
C*                                AND SEASON                           *
C*                  T      - RS - UNKNOWN                              *
C*                  ADUSK  - RS - NIGHT SECTOR PARABOLA CONSTANT       *
C*                  ADAWN  - RS - MORNING SECTOR PARABOLA CONSTANT     *
C*                  WIDTH  - RS - WIDTH OF TROUGH AT THIS MLT          *
C*                                                                     *
C* (I=INTEGER, R=REAL, C=CHARACTER, S=SCALAR, V=VECTOR, A=ARRAY)       *
C*                                                                     *
C*   SETC OPTIONS:  NONE USED                                          *
C*                                                                     *
C*     SUBPROGRAMS                                                     *
C*         CALLED:  NONE                                               *
C*                                                                     *
C*PROGRAM WRITTEN:  JAN 86 - NATIONAL GEOPHYSICAL DATA CENTER - NOAA   *
C*        UPDATES:  OCT 90 - NGDC (90-REF) REDO SHAPE OF TROUGH        *
C*                                                                     *
C***********************************************************************
      REAL TCGM
      REAL TRFMAX
      REAL DAYJUL
      REAL EFFKP
      REAL TRFEB
 
      REAL DELTAT
      REAL KPWDTH
      REAL T
      REAL ADUSK
      REAL ADAWN
      REAL WIDTH

      REAL PI
      PARAMETER( PI = 3.141592654 )
 
C.......................................................................
C     SUB-AURORAL TROUGH OCCURS BETWEEN 20 MLT AND 07 MLT ONLY         .
C.......................................................................
      IF ( (TCGM.GT.07.0).AND.(TCGM.LT.20.0) ) THEN
        TRFEB = TRFMAX
        RETURN
      ENDIF
 
C.......................................................................
C     NUMBER OF MLT HOURS AWAY FROM 03 MLT                             .
C.......................................................................
      IF ( TCGM.LE.15.0 ) THEN
        DELTAT = ABS(TCGM - 3.0)
      ELSE
        DELTAT = 27.0 - TCGM
      ENDIF
 
C.......................................................................
C     COMPUTE MAXIMUM WIDTH OF SUB-AURORAL TROUGH FROM KP AND SEASON   .
C.......................................................................
      KPWDTH = (3.7+1.3*EFFKP) / 2.0
      T = 6.542 + 8 * ALOG(1.0 + COS(2.0*PI*(DAYJUL+11.0)/365.0))
      IF ( T.GE.1.0 ) KPWDTH = KPWDTH * ( SQRT(T) - 1.0 )
 
C.......................................................................
C     TWO PARABOLAS DESCRIBE THE SHAPE OF THE TROUGH; TWO POINTS ARE   .
C     KNOWN ON EACH :                                                  .
C        DUSK-SIDE PARABOLA : VERTEX AT ( 03 MLT, KPWDTH )             .
C                             POINT AT ( 20 MLT,0 )                    .
C        DAWN-SIDE PARABOLA : VERTEX AT ( 03 MLT, KPWDTH )             .
C                             POINT AT ( 07 MLT,0 )                    .
C     ADUSK AND ADAWN ARE THE PARAMETERS SHAPING THE PARABOLAS BETWEEN .
C     THOSE TWO POINTS                                                 .
C.......................................................................
      ADUSK = KPWDTH / 49.0
      ADAWN = KPWDTH / 16.0
 
C.......................................................................
C     COMPUTE WIDTH OF SUB-AURORAL TROUGH AT THIS GRIDPOINT            .
C.......................................................................
      IF ( (TCGM.GE.20.0).OR.(TCGM.LT.3.0) )
     +  WIDTH = KPWDTH - ADUSK * (DELTAT**2)
      IF ( (TCGM.GE.03.0).AND.(TCGM.LE.7.0) )
     +  WIDTH = KPWDTH - ADAWN * (DELTAT**2)
 
      TRFEB = TRFMAX - WIDTH
      RETURN
      END
 
 