test_014 Subroutine

subroutine test_014(id, nfail)

Uses

  • proc~~test_014~~UsesGraph proc~test_014 test_014 module~forcolormap_parameters forcolormap_parameters proc~test_014->module~forcolormap_parameters module~forcolormap_utils forcolormap_utils proc~test_014->module~forcolormap_utils iso_fortran_env iso_fortran_env module~forcolormap_parameters->iso_fortran_env module~forcolormap_utils->module~forcolormap_parameters

Partition-of-unity should hold across several representative t values.

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: id
integer, intent(inout) :: nfail

Calls

proc~~test_014~~CallsGraph proc~test_014 test_014 proc~lagrange_poly lagrange_poly proc~test_014->proc~lagrange_poly proc~report_test report_test proc~test_014->proc~report_test

Called by

proc~~test_014~~CalledByGraph proc~test_014 test_014 program~check check program~check->proc~test_014

Source Code

   subroutine test_014(id, nfail)
      use forcolormap_parameters, only: wp
      use forcolormap_utils,      only: lagrange_poly
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "lagrange_poly: partition of unity at multiple t (n=8)"
      logical :: ok
      real(wp), parameter :: tol = 1.0e-12_wp
      real(wp) :: ts(5)
      integer :: k

      ts = [ 0.0_wp, 0.1_wp, 0.33_wp, 0.77_wp, 1.0_wp ]

      ok = .true.
      do k = 1, size(ts)
         ok = ok .and. (abs(sum(lagrange_poly(ts(k), 8)) - 1.0_wp) <= tol)
      end do
      call report_test(name, ok, id, nfail)
   end subroutine test_014