test_013 Subroutine

subroutine test_013(id, nfail)

Uses

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

For n=2, Lagrange interpolation reduces to linear weights [1-t, t] on [0,1].

Arguments

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

Calls

proc~~test_013~~CallsGraph proc~test_013 test_013 proc~lagrange_poly lagrange_poly proc~test_013->proc~lagrange_poly proc~report_test report_test proc~test_013->proc~report_test

Called by

proc~~test_013~~CalledByGraph proc~test_013 test_013 program~check check program~check->proc~test_013

Source Code

   subroutine test_013(id, nfail)
      use forcolormap_parameters, only: wp
      use forcolormap_utils,      only: lagrange_poly
      integer, intent(inout) :: id, nfail
      character(len=*), parameter :: name = "lagrange_poly: n=2 is linear weights in [0,1]"
      logical :: ok
      real(wp), parameter :: tol = 1.0e-12_wp
      real(wp) :: t, B(2)

      t = 0.23_wp
      B = lagrange_poly(t, 2)

      ok = abs(B(1) - (1.0_wp - t)) <= tol .and. abs(B(2) - t) <= tol .and. &
         (B(1) >= -tol) .and. (B(2) >= -tol)
      call report_test(name, ok, id, nfail)
   end subroutine test_013