g1_cosine Function

public pure function g1_cosine(r) result(val)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: r

Distance from filter center

Return Value real(kind=wp)

Result


Source Code

    pure function g1_cosine(r) result(val)
      ! Cosine filter.
      implicit none
      real(wp), intent(in) :: r                                                !! Distance from filter center
      real(wp)             :: val                                              !! Result
      ! Work variable
      real(wp), parameter :: pi=4.0_wp*atan(1.0_wp)

      if ( (abs(r).le. 1.0_wp)) then
        val=pi/4.0_wp*cos(pi/2.0_wp*r)
      else
        val=0.0_WP
      end if

      return
    end function g1_cosine