!+ Function to calculate the extinction of an SRA profile.
!
! Method:
!	A representation is given and the extinction is calculated
!	appropriately.
!
! Current Owner of Code: J. M. Edwards
!
! History:
!	 Version 	   Date	  		Comment
!   
!	 1.0		   12-04-95		First Version under RCS
!						(J. M. Edwards)
!
! Description of Code:
!   FORTRAN 77 with extensions listed in documentation. 
!
!- ---------------------------------------------------------------------
      FUNCTION EXTINCTION_PROFILE(Z
     &   , I_REPRESENTATION, N_PARM, PARM
     &   )
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADERS.
      INCLUDE 'incl/aerosol_representation.pcf'
!
!     DUMMY ARGUMENTS.
      INTEGER	!, INTENT(IN)
     &     I_REPRESENTATION
!             TYPE OF HEIGHT VARIATION
     &   , N_PARM
!             SIZE OF PARAMETER ARRAY
      REAL*8	!, INTENT(IN)
     &     Z
!             HEIGHT OF LEVEL
     &   , PARM(N_PARM)
!             FUNCTIONAL PARAMETERS
      REAL*8	!, INTENT(OUT)
     &     EXTINCTION_PROFILE
!             EVALUATED EXTINCTION
!
!     LOCAL VARIABLES.
      REAL*8
     &     LAMBDA
!             FRACTION OF LINEAR INTERVAL
!
!
      IF (I_REPRESENTATION.EQ.I_CONSTANT) THEN
         EXTINCTION_PROFILE=PARM(1)
      ELSE IF (I_REPRESENTATION.EQ.I_LINEAR) THEN
         LAMBDA=(Z-PARM(3))/(PARM(4)-PARM(3))
         EXTINCTION_PROFILE=(PARM(1)-PARM(2))*LAMBDA+PARM(2)
      ELSE IF (I_REPRESENTATION.EQ.I_EXPONENTIAL) THEN
         EXTINCTION_PROFILE=PARM(1)*EXP(-Z/PARM(2))
      ENDIF
!
!
      RETURN
      END
