Skip to content

Commit

Permalink
add "elemental" and/or "pure" attributes where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
nshaffer committed Jan 7, 2020
1 parent fefbaf4 commit e06e322
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/stdlib_experimental_optval.f90
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module stdlib_experimental_optval
contains


function optval_sp(x, default) result(y)
pure elemental function optval_sp(x, default) result(y)
real(sp), intent(in), optional :: x
real(sp), intent(in) :: default
real(sp) :: y
Expand All @@ -47,7 +47,7 @@ function optval_sp(x, default) result(y)
end function optval_sp


function optval_dp(x, default) result(y)
pure elemental function optval_dp(x, default) result(y)
real(dp), intent(in), optional :: x
real(dp), intent(in) :: default
real(dp) :: y
Expand All @@ -60,7 +60,7 @@ function optval_dp(x, default) result(y)
end function optval_dp


function optval_qp(x, default) result(y)
pure elemental function optval_qp(x, default) result(y)
real(qp), intent(in), optional :: x
real(qp), intent(in) :: default
real(qp) :: y
Expand All @@ -73,7 +73,7 @@ function optval_qp(x, default) result(y)
end function optval_qp


function optval_int8(x, default) result(y)
pure elemental function optval_int8(x, default) result(y)
integer(int8), intent(in), optional :: x
integer(int8), intent(in) :: default
integer(int8) :: y
Expand All @@ -86,7 +86,7 @@ function optval_int8(x, default) result(y)
end function optval_int8


function optval_int16(x, default) result(y)
pure elemental function optval_int16(x, default) result(y)
integer(int16), intent(in), optional :: x
integer(int16), intent(in) :: default
integer(int16) :: y
Expand All @@ -99,7 +99,7 @@ function optval_int16(x, default) result(y)
end function optval_int16


function optval_int32(x, default) result(y)
pure elemental function optval_int32(x, default) result(y)
integer(int32), intent(in), optional :: x
integer(int32), intent(in) :: default
integer(int32) :: y
Expand All @@ -112,7 +112,7 @@ function optval_int32(x, default) result(y)
end function optval_int32


function optval_int64(x, default) result(y)
pure elemental function optval_int64(x, default) result(y)
integer(int64), intent(in), optional :: x
integer(int64), intent(in) :: default
integer(int64) :: y
Expand All @@ -125,7 +125,7 @@ function optval_int64(x, default) result(y)
end function optval_int64


function optval_logical(x, default) result(y)
pure elemental function optval_logical(x, default) result(y)
logical, intent(in), optional :: x
logical, intent(in) :: default
logical :: y
Expand All @@ -138,7 +138,7 @@ function optval_logical(x, default) result(y)
end function optval_logical


function optval_character(x, default) result(y)
pure function optval_character(x, default) result(y)
character(len=*), intent(in), optional :: x
character(len=*), intent(in) :: default
character(len=:), allocatable :: y
Expand Down

0 comments on commit e06e322

Please sign in to comment.