C
C
	SUBROUTINE POLSTER(ALON,ALAT,X1,Y1,XLAM,SLAT)
C
C	COMPUTES THE POLAR STEROGRAPHIC TRANSFORMATION FOR A LON,LAT
C	INPUT OF (ALON,ALAT) WITH REFERENCE ORIGIN  LON,LAT=(XLAM,SLAT).
C	OUTPUT IS (X1,Y1) IN KM
C
C	ALGORITHM IS THE SAME AS USED FOR PROCESSING ERS-1 SAR IMAGES
C	AS RECEIVED FROM M. DRINKWATER (1994) 
C
C	WRITTEN BY: DGL OCT 1994
C       REVISED BY: DGL JUN 1998
C        + fixed sign error in computing CM
C       REVISED BY: DGL NOV 2005
C        + eliminated COSD, SIND, and TAND calls with DTR
C
	IMPLICIT NONE
	REAL ALON, ALAT, X1, Y1, XLAM, SLAT
C
	DOUBLE PRECISION E2,RE,E,T,TX,TY,CM,RHO,RLAT,SN
	DATA E2/0.006693883D0/
	DATA RE/6378.273D0/
	DOUBLE PRECISION DTR
	DATA DTR/0.01745329252D0/
C
	E=SQRT(E2)
	IF (SLAT.LT.0.0) THEN
		SN=-1.0
		RLAT=-ALAT
	ELSE
		SN=1.0
		RLAT=ALAT
	ENDIF
	T=((1.D0-E*SIN(DTR*RLAT))/(1.D0+E*SIN(DTR*RLAT)))**(E*0.5D0)
	TY=TAN(DTR*(45.0D0-0.5D0*RLAT))/T
	IF (SLAT.LT.0.0) THEN
		RLAT=-SLAT
	ELSE
		RLAT=SLAT
	ENDIF
	T=((1.D0-E*SIN(DTR*RLAT))/(1.D0+E*SIN(DTR*RLAT)))**(E*0.5D0)
	TX=TAN(DTR*(45.0D0-0.5D0*RLAT))/T
	CM=COS(DTR*RLAT)/SQRT(1.D0-E2*SIN(DTR*RLAT)**2)
	RHO=RE*CM*TY/TX
	X1= (SN*SIN(DTR*(SN*ALON-XLAM)))*RHO
	Y1=-(SN*COS(DTR*(SN*ALON-XLAM)))*RHO
	RETURN
	END
