
      function parfac(a,b)

C*********************************************************************
C
C This function takes two parameters a and b and 
C returns the value of the product (a+b)(a+b-1)(a+b-2)...(a-b+2)(a-b+1)
C The program does not check for b<=a; if b>a, the returned value is
C only for b=a.
C
C (c) Richard Townsend 1995
C
C**********************************************************************

      implicit none		! Turn off strong typing

C Declare the passed variables

      integer a			! The value of a
      integer b			! The value of b
      double precision parfac 	! The returned value of parfac

C Declare the in-program variables...

      integer i	 		! A loop variable

C Now initialise parfac

      parfac=1.D0

C Now just loop over i, updating parfac...

      do i=a-b+1,a+b,1
        parfac=parfac*i
      enddo

C Return...

      return

      end       
