compute Subroutine

private pure subroutine compute(self, S)

Compute weights.

Arguments

Type IntentOptional AttributesName
class(optimal_weights_js), intent(inout) :: self

Optimal weights.

integer(kind=I_P), intent(in) :: S

Number of stencils used.

Calls

proc~~compute~4~~CallsGraph proc~compute~4 compute opt opt proc~compute~4->opt
Help

Source Code


Source Code

  pure subroutine compute(self, S)
  !< Compute weights.
  class(optimal_weights_js), intent(inout) :: self !< Optimal weights.
  integer(I_P),              intent(in)    :: S    !< Number of stencils used.

  associate(opt => self%opt)
    select case(S)
      case(2) ! 3rd order
        ! 1 => left interface (i-1/2)
        opt(1, 0) = 2._R_P/3._R_P ! stencil 0
        opt(1, 1) = 1._R_P/3._R_P ! stencil 1
        ! 2 => right interface (i+1/2)
        opt(2, 0) = 1._R_P/3._R_P ! stencil 0
        opt(2, 1) = 2._R_P/3._R_P ! stencil 1
      case(3) ! 5th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) = 0.3_R_P ! stencil 0
        opt(1, 1) = 0.6_R_P ! stencil 1
        opt(1, 2) = 0.1_R_P ! stencil 2
        ! 2 => right interface (i+1/2)
        opt(2, 0) = 0.1_R_P ! stencil 0
        opt(2, 1) = 0.6_R_P ! stencil 1
        opt(2, 2) = 0.3_R_P ! stencil 2
      case(4) ! 7th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) =  4._R_P/35._R_P ! stencil 0
        opt(1, 1) = 18._R_P/35._R_P ! stencil 1
        opt(1, 2) = 12._R_P/35._R_P ! stencil 2
        opt(1, 3) =  1._R_P/35._R_P ! stencil 3
        ! 2 => right interface (i+1/2)
        opt(2, 0) =  1._R_P/35._R_P ! stencil 0
        opt(2, 1) = 12._R_P/35._R_P ! stencil 1
        opt(2, 2) = 18._R_P/35._R_P ! stencil 2
        opt(2, 3) =  4._R_P/35._R_P ! stencil 3
      case(5) ! 9th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) =  5._R_P/126._R_P ! stencil 0
        opt(1, 1) = 20._R_P/63._R_P  ! stencil 1
        opt(1, 2) = 10._R_P/21._R_P  ! stencil 2
        opt(1, 3) = 10._R_P/63._R_P  ! stencil 3
        opt(1, 4) =  1._R_P/126._R_P ! stencil 4
        ! 2 => right interface (i+1/2)
        opt(2, 0) =  1._R_P/126._R_P ! stencil 0
        opt(2, 1) = 10._R_P/63._R_P  ! stencil 1
        opt(2, 2) = 10._R_P/21._R_P  ! stencil 2
        opt(2, 3) = 20._R_P/63._R_P  ! stencil 3
        opt(2, 4) =  5._R_P/126._R_P ! stencil 4
      case(6) ! 11th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) =   1._R_P/77._R_P  ! stencil 0
        opt(1, 1) =  25._R_P/154._R_P ! stencil 1
        opt(1, 2) = 100._R_P/231._R_P ! stencil 2
        opt(1, 3) =  25._R_P/77._R_P  ! stencil 3
        opt(1, 4) =   5._R_P/77._R_P  ! stencil 4
        opt(1, 5) =   1._R_P/462._R_P ! stencil 5
        ! 2 => right interface (i+1/2)
        opt(2, 0) =   1._R_P/462._R_P ! stencil 0
        opt(2, 1) =   5._R_P/77._R_P  ! stencil 1
        opt(2, 2) =  25._R_P/77._R_P  ! stencil 2
        opt(2, 3) = 100._R_P/231._R_P ! stencil 3
        opt(2, 4) =  25._R_P/154._R_P ! stencil 4
        opt(2, 5) =   1._R_P/77._R_P  ! stencil 5
      case(7) ! 13th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) =   7._R_P/1716._R_P ! stencil 0
        opt(1, 1) =  21._R_P/286._R_P  ! stencil 1
        opt(1, 2) = 175._R_P/572._R_P  ! stencil 2
        opt(1, 3) = 175._R_P/429._R_P  ! stencil 3
        opt(1, 4) = 105._R_P/572._R_P  ! stencil 4
        opt(1, 5) =   7._R_P/286._R_P  ! stencil 5
        opt(1, 6) =   1._R_P/1716._R_P ! stencil 6
        ! 2 => right interface (i+1/2)
        opt(2, 0) =   1._R_P/1716._R_P ! stencil 0
        opt(2, 1) =   7._R_P/286._R_P  ! stencil 1
        opt(2, 2) = 105._R_P/572._R_P  ! stencil 2
        opt(2, 3) = 175._R_P/429._R_P  ! stencil 3
        opt(2, 4) = 175._R_P/572._R_P  ! stencil 4
        opt(2, 5) =  21._R_P/286._R_P  ! stencil 5
        opt(2, 6) =   7._R_P/1716._R_P ! stencil 6
      case(8) ! 15th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) =   8._R_P/6435._R_P ! stencil 0
        opt(1, 1) = 196._R_P/6435._R_P ! stencil 1
        opt(1, 2) = 392._R_P/2145._R_P ! stencil 2
        opt(1, 3) = 490._R_P/1287._R_P ! stencil 3
        opt(1, 4) = 392._R_P/1287._R_P ! stencil 4
        opt(1, 5) = 196._R_P/2145._R_P ! stencil 5
        opt(1, 6) =  56._R_P/6435._R_P ! stencil 6
        opt(1, 7) =   1._R_P/6435._R_P ! stencil 7
        ! 2 => right interface (i+1/2)
        opt(2, 0) =   1._R_P/6435._R_P ! stencil 0
        opt(2, 1) =  56._R_P/6435._R_P ! stencil 1
        opt(2, 2) = 196._R_P/2145._R_P ! stencil 2
        opt(2, 3) = 392._R_P/1287._R_P ! stencil 3
        opt(2, 4) = 490._R_P/1287._R_P ! stencil 4
        opt(2, 5) = 392._R_P/2145._R_P ! stencil 5
        opt(2, 6) = 196._R_P/6435._R_P ! stencil 6
        opt(2, 7) =   8._R_P/6435._R_P ! stencil 7
      case(9) ! 17th order
        ! 1 => left interface (i-1/2)
        opt(1, 0) =    9._R_P/24310._R_P ! stencil 0
        opt(1, 1) =  144._R_P/12155._R_P ! stencil 1
        opt(1, 2) = 1176._R_P/12155._R_P ! stencil 2
        opt(1, 3) = 3528._R_P/12155._R_P ! stencil 3
        opt(1, 4) =  882._R_P/2431._R_P  ! stencil 4
        opt(1, 5) = 2352._R_P/12155._R_P ! stencil 5
        opt(1, 6) =  504._R_P/12155._R_P ! stencil 6
        opt(1, 7) =   36._R_P/12155._R_P ! stencil 7
        opt(1, 8) =    1._R_P/24310._R_P ! stencil 8
        ! 2 => right interface (i+1/2)
        opt(2, 0) =    1._R_P/24310._R_P ! stencil 0
        opt(2, 1) =   36._R_P/12155._R_P ! stencil 1
        opt(2, 2) =  504._R_P/12155._R_P ! stencil 2
        opt(2, 3) = 2352._R_P/12155._R_P ! stencil 3
        opt(2, 4) =  882._R_P/2431._R_P  ! stencil 4
        opt(2, 5) = 3528._R_P/12155._R_P ! stencil 5
        opt(2, 6) = 1176._R_P/12155._R_P ! stencil 6
        opt(2, 7) =  144._R_P/12155._R_P ! stencil 7
        opt(2, 8) =    9._R_P/24310._R_P ! stencil 8
    endselect
  endassociate
  endsubroutine compute


add_3d_plot add_bar add_contour add_plot add_str bctoi_I1P bctoi_I2P bctoi_I4P bctoi_I8P bcton bctor_R16P bctor_R4P bctor_R8P bit_size bit_size bit_size_chr bit_size_R16P bit_size_R4P bit_size_R8P bstr bstr_I1P bstr_I2P bstr_I4P bstr_I8P bstr_R16P bstr_R4P bstr_R8P byte_size byte_size_chr byte_size_I1P byte_size_I2P byte_size_I4P byte_size_I8P byte_size_R16P byte_size_R4P byte_size_R8P check_endian compact_real_string compute compute compute compute compute compute compute compute compute compute create create create create create create create create create create_alpha_coefficients create_alpha_coefficients_js_constructor create_alpha_coefficients_m_constructor create_alpha_coefficients_z_constructor create_base_object create_interpolator_constructor create_interpolator_js_constructor create_optimal_weights create_optimal_weights_js_constructor create_polynomials create_polynomials_js_constructor create_smoothness_indicators create_smoothness_indicators_js_constructor ctoi_I1P ctoi_I2P ctoi_I4P ctoi_I8P cton ctor_R16P ctor_R4P ctor_R8P description description description description description description description description description description description description destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy destroy_interpolator_constructor digit digit_I1 digit_I2 digit_I4 digit_I8 execute initialize integer_to_string interpolate interpolate matrix_to_string optional_int_to_string penf_init penf_print savefig str str_a_I1P str_a_I2P str_a_I4P str_a_I8P str_a_R16P str_a_R4P str_a_R8P str_bol str_I1P str_I2P str_I4P str_I8P str_R16P str_R4P str_R8P strf_I1P strf_I2P strf_I4P strf_I8P strf_R16P strf_R4P strf_R8P strz strz_I1P strz_I2P strz_I4P strz_I8P tau vec_to_string weno_exp weno_odd wenoof_create