      SUBROUTINE EAPL  (FP, LA,PRLOG,NPL, FS,SIG,NSL, PSLOG,RLUP,RLDN,
     1                  A,B,NSL1,FSC,DFDLNS,DLNS) 
  
C     * FEB 11/88 - R.LAPRISE.
C     * INTERPOLATES MULTI-LEVEL SET OF GRIDS FROM ETA LEVELS 
C     * TO PRESSURE LEVELS FOR HYBRID MODEL.
C     * THE INTERPOLATION IS LINEAR IN LN(PRES).
C 
C     * ALL GRIDS HAVE THE SAME HORIZONTAL SIZE (LA POINTS).
C     * FS    =  INPUT GRIDS ON ETA      LEVELS.
C     * FP    = OUTPUT GRIDS ON PRESSURE LEVELS.
C     *     (NOTE THAT FP AND FS MAY BE EQUIVALENCED IN CALLING PROGRAM)
C     * PSLOG = INPUT  GRID OF LN(SURFACE PRESSURE IN MB).
C 
C     * PRLOG(NPL) = VALUES OF INPUT PRESSURE LEVEL (MB). 
C     * SIG  (NSL) = VALUES OF ETA LEVELS OF INPUT FIELD. 
C     *             (BOTH MUST BE MONOTONIC AND INCREASING).
C     * NSL1  = NSL+1.
C 
C     * RLUP  = LAPSE RATE USED TO EXTRAPOLATE ABOVE TOP ETA. 
C     * RLDN  = LAPSE RATE USED TO EXTRAPOLATE BELOW BOTTOM ETA.
C     *         UNITS OF RLUP,RLDN ARE  DF/D(LN PRES).
C 
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      REAL FP   (LA,NPL),FS (LA,NSL),PSLOG (LA) 
      REAL PRLOG(   NPL)
  
      REAL A(NSL),B(NSL)
  
C     * WORK SPACE. 
  
      REAL FSC(NSL),DFDLNS(NSL1),DLNS(NSL),SIG(NSL) 
C---------------------------------------------------------------------
C     * LOOP OVER ALL HORIZONTAL POINTS.
  
      DO 500 I=1,LA 
  
C     * COMPUTE LOCAL SIGMA VALUES AND INVERSE OF DELTA LN SIGMA. 
  
      CALL NIVCAL (SIG, A,B,100.E0*EXP(PSLOG(I)),NSL,1,1) 
  
      DO 100 L=1,NSL
         SIG(L)=LOG(SIG(L))
  100 CONTINUE
  
      DO 180 L=1,NSL-1
         DLNS(L) =1.E0 / (SIG(L+1)-SIG(L))
  180 CONTINUE
  
C     * GET A COLUMN OF FP (ON PRESSURE LEVELS).
  
      DO 210 L=1,NSL
         FSC(L)=FS(I,L) 
  210 CONTINUE
  
C     * COMPUTE VERTICAL DERIVATIVE OVER ALL PRESSURE INTERVALS.
  
      DO 260 L=1,NSL-1
  260 DFDLNS(L+1  ) = (FSC(L+1)-FSC(L)) *DLNS(L)
      DFDLNS(1    ) = RLUP
      DFDLNS(NSL+1) = RLDN
  
C     * LOOP OVER PRESSURE LEVELS TO BE INTERPOLATED. 
C     * X IS THE LN(SIGMA)=LN(PRES)-LN(PS) VALUE OF REQUIRED PRESSURE LEVEL.
  
      K=1 
      DO 350 N=1,NPL
      X=PRLOG(N)-PSLOG(I) 
  
C     * FIND WHICH SIGMA INTERVAL WE ARE IN.
  
      DO 310 L=K,NSL
      INTVL=L 
  310 IF(X.LT.SIG(L)) GO TO 320 
      INTVL=NSL+1 
  320 K=INTVL-1 
      IF(K.EQ.0) K=1
  
C     * NOW INTERPOLATE AT THIS POINT.
  
  350 FP(I,N)  = FSC(K)+DFDLNS(INTVL)*(X-SIG(K))
  
  500 CONTINUE
  
      RETURN
      END 
