    PROGRAM nag_kelvin_fun_ex05

      ! Example Program Text for nag_kelvin_fun
      ! NAG fl90, Release 4. NAG Copyright 2000.

      ! .. Use Statements ..
      USE nag_examples_io, ONLY : nag_std_out
      USE nag_kelvin_fun, ONLY : nag_kelvin_kei
      ! .. Implicit None Statement ..
      IMPLICIT NONE
      ! .. Intrinsic Functions ..
      INTRINSIC KIND
      ! .. Parameters ..
      INTEGER, PARAMETER :: n = 7
      INTEGER, PARAMETER :: wp = KIND(1.0D0)
      ! .. Local Scalars ..
      INTEGER :: i
      REAL (wp) :: kei
      ! .. Local Arrays ..
      REAL (wp) :: x(n)
      ! .. Executable Statements ..
      WRITE (nag_std_out,*) 'Example Program Results for nag_kelvin_fun_ex05'

      WRITE (nag_std_out,*)
      WRITE (nag_std_out,*) '       x         kei x'

      x = (/ 0.0_wp, 0.1_wp, 1.0_wp, 2.5_wp, 5.0_wp, 10.0_wp, 15.0_wp/)
      DO i = 1, n

        kei = nag_kelvin_kei(x(i))

        WRITE (nag_std_out,'(1X,1P,2E12.3)') x(i), kei
      END DO

    END PROGRAM nag_kelvin_fun_ex05
