      SUBROUTINE PPUV(NPPOLE,U,V)
C$$$  SUBPROGRAM DOCUMENTATION BLOCK
C                .      .    .                                       .
C SUBPROGRAM:    PPUV        FIX POLE WIND VALUES IN LOLA STRIP ARRAY
C   PRGMMR: DEAVEN           ORG: W/NMC22    DATE: 89-03-31
C
C ABSTRACT: COMPUTES NORTH AND/OR SOUTH POLE ARRAY ELELMENTS
C   FROM NEAR-POLE ROW OF POINTS FOR WIND COMPONENTS
C
C PROGRAM HISTORY LOG:
C   86-03-31  DEY         ???
C   89-12-30  DIMEGO      NEW DOCBLOCK
C
C USAGE:    CALL PPUV(U,V)
C   INPUT ARGUMENT LIST:
C     NPPOLE   - switch for which pole values to compute
C                =1 for South Pole only
C                =2 for North Pole only
C                =3 for both North and South Poles
C     U        - (IMAX,JMAX) ARRAY OF VALUES    LOLA STRIP FORM
C     V        - (IMAX,JMAX) ARRAY OF VALUES    LOLA STRIP FORM
C
C   OUTPUT ARGUMENT LIST:
C     U        - (IMAX,JMAX) ARRAY OF VALUES    POLE ROWS FIXED
C     V        - (IMAX,JMAX) ARRAY OF VALUES    POLE ROWS FIXED
C
C   SUBPROGRAMS CALLED:
C
C ATTRIBUTES:
C   LANGUAGE: STANDARD FORTRAN
C   MACHINE:
C
C$$$
      IMPLICIT REAL (A-H,O-Z)
         save
      INCLUDE "parmanl"
      DIMENSION U(IMAX,JMAX),V(IMAX,JMAX),COSL(IMAX),SINL(IMAX)
      DATA IFRST/0/
      IF(IFRST.EQ.0) THEN
         IFRST = 99
         DELANG = 360.0 / IMAX * .017453293 E+0
         DO 1 I = 1,IMAX
         ANG = (I-1) * DELANG
         COSL(I) = COS(ANG)
         SINL(I) = SIN(ANG)
1        CONTINUE
      END IF
      IF( NPPOLE.EQ.1 .OR. NPPOLE.EQ.3 )  THEN
        USP = 0.0
        VSP = 0.0
        DO 2 I = 1,IMAX
        USP = USP - U(I,2)*COSL(I) - V(I,2)*SINL(I)
        VSP = VSP + U(I,2)*SINL(I) - V(I,2)*COSL(I)
2       CONTINUE
        USP = USP / IMAX
        VSP = VSP / IMAX
        DO 3 I = 1,IMAX
        U(I,1) = -USP*COSL(I) + VSP*SINL(I)
        V(I,1) = -USP*SINL(I) - VSP*COSL(I)
3       CONTINUE
c         WRITE(6,200)USP,VSP
c200      FORMAT(' USP,VSP =',2G15.6)
      END IF
      IF( NPPOLE.EQ.2 .OR. NPPOLE.EQ.3 )  THEN
        UNP = 0.0
        VNP = 0.0
        DO 4 I = 1,IMAX
        UNP = UNP + U(I,JMAX-1)*COSL(I) - V(I,JMAX-1)*SINL(I)
        VNP = VNP + U(I,JMAX-1)*SINL(I) + V(I,JMAX-1)*COSL(I)
4       CONTINUE
        UNP = UNP / IMAX
        VNP = VNP / IMAX
        DO 5 I = 1,IMAX
        U(I,JMAX) =   UNP*COSL(I) + VNP*SINL(I)
        V(I,JMAX) = -UNP*SINL(I) + VNP*COSL(I)
5       CONTINUE
c         WRITE(6,201)UNP,VNP
c201      FORMAT(' UNP,VNP =',2G15.6)
      END IF
        RETURN
        END
