      SUBROUTINE PAEL (FS, LA,SIG,NSL, FP,PRLOG,NPL, PSLOG,RLUP,RLDN, 
     1                 A,B,NPL1,FPC,DFDLNP,DLNP)
  
C     * FEB 02/88 - R.LAPRISE.
C     * INTERPOLATES MULTI-LEVEL SET OF GRIDS FROM PRESSURE LEVELS
C     * TO ETA LEVELS FOR HYBRID MODEL. 
C     * THE INTERPOLATION IS LINEAR IN LN(PRES).
C 
C     * ALL GRIDS HAVE THE SAME HORIZONTAL SIZE (LA POINTS).
C     * FP    = INPUT  GRIDS ON PRESSURE LEVELS.
C     * FS    = OUTPUT GRIDS ON ETA      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 OUTPUT FIELD.
C     *            (BOTH MUST BE MONOTONIC AND INCREASING). 
C     * NPL1  = NPL+1.
C 
C     * RLUP  = LAPSE RATE USED TO EXTRAPOLATE ABOVE PRLOG(1).
C     * RLDN  = LAPSE RATE USED TO EXTRAPOLATE BELOW PRLOG(NSL).
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 FPC(NPL),DFDLNP(NPL1),DLNP(NPL),SIG(NSL) 
C---------------------------------------------------------------------
C     * PRECOMPUTE INVERSE OF DELTA LN PRES.
C 
      DO 180 L=1,NPL-1
         DLNP(L) =1.E0 / (PRLOG(L+1)-PRLOG(L))
  180 CONTINUE
  
C     * LOOP OVER ALL HORIZONTAL POINTS.
  
      DO 500 I=1,LA 
  
C     * GET A COLUMN OF FP (ON PRESSURE LEVELS).
  
      DO 210 L=1,NPL
         FPC(L)=FP(I,L) 
  210 CONTINUE
  
C     * COMPUTE VERTICAL DERIVATIVE OVER ALL PRESSURE INTERVALS.
  
      DO 260 L=1,NPL-1
  260 DFDLNP(L+1  ) = (FPC(L+1)-FPC(L)) *DLNP(L)
      DFDLNP(1    ) = RLUP
      DFDLNP(NPL+1) = RLDN
  
C     * COMPUTE THE LOCAL SIGMA VALUES. 
  
      CALL NIVCAL (SIG, A,B,100.E0*EXP(PSLOG(I)),NSL,1,1) 
      DO 300 L=1,NSL
         SIG(L)=LOG(SIG(L))
  300 CONTINUE
  
C     * LOOP OVER SIGMA LEVELS TO BE INTERPOLATED.
C     * X IS THE LN(PRES)=LN(PS)*LN(SIG) VALUE OF REQUIRED SIGMA LEVEL. 
  
      K=1 
      DO 350 N=1,NSL
      X=SIG(N)+PSLOG(I) 
  
C     * FIND WHICH PRESSURE INTERVAL WE ARE IN. 
  
      DO 310 L=K,NPL
      INTVL=L 
  310 IF(X.LT.PRLOG(L)) GO TO 320 
      INTVL=NPL+1 
  320 K=INTVL-1 
      IF(K.EQ.0) K=1
  
C     * NOW INTERPOLATE AT THIS POINT.
  
  350 FS(I,N)  = FPC(K)+DFDLNP(INTVL)*(X-PRLOG(K))
  
  500 CONTINUE
  
      RETURN
      END 
