!+ Function to calculate the scaling function.
!
! Method:
!	Straightforward.
!
! 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 FUNC_SCALE(P_FNC, T_FNC
     &   , I_SCALE_FUNCTION, SCALE_VECTOR)
!
!
      IMPLICIT NONE
!
!
!     INCLUDE HEADER FILES.
      INCLUDE 'incl/dimensions_spec.ucf'
      INCLUDE 'incl/scale_fnc.pcf'
!
!     DUMMY ARGUMENTS
      INTEGER
     &     I_SCALE_FUNCTION
!             TYPE OF SCALING FUNCTION
      REAL*8	!, INTENT(OUT)
     &     FUNC_SCALE
!             VALUE OF SCALING FUNCTION
      REAL*8	!, INTENT(IN)
     &     P_FNC
!             FUNCTION OF PRESSURE
     &   , T_FNC
!             FUNCTION OF TEMPERATURE
     &   , SCALE_VECTOR(NPD_SCALE_VARIABLE)
!             SCALING PARAMETERS
!
!
      IF (I_SCALE_FUNCTION.EQ.IP_SCALE_POWER_LAW) THEN
         FUNC_SCALE=EXP(SCALE_VECTOR(1)*P_FNC
     &      +SCALE_VECTOR(2)*T_FNC)
      ELSE IF (I_SCALE_FUNCTION.EQ.IP_SCALE_POWER_QUAD) THEN
         FUNC_SCALE=EXP(SCALE_VECTOR(1)*P_FNC)
     &      *(1.0D+00+SCALE_VECTOR(2)*T_FNC+SCALE_VECTOR(3)*T_FNC*T_FNC)
      ELSE IF (I_SCALE_FUNCTION.EQ.IP_SCALE_DOPPLER_QUAD) THEN
         FUNC_SCALE=EXP(SCALE_VECTOR(1)
     &      *LOG((P_FNC+EXP(SCALE_VECTOR(2)))
     &      /(1.0D+00+EXP(SCALE_VECTOR(2)))))
     &      *(1.0D+00+SCALE_VECTOR(3)*T_FNC+SCALE_VECTOR(4)*T_FNC*T_FNC)
      ENDIF
!
!
      RETURN
      END
