program passkinds

  implicit none
  integer, parameter :: dbl_kind = selected_real_kind(13)
  real (kind=dbl_kind) :: x = 3.0_dbl_kind

  print *, addconst(x, 10.0)

  contains

  function addconst(x, x_const) result(sum_result)

    real (kind=dbl_kind) :: x, x_const, sum_result

    sum_result = x + x_const

  end function addconst

end program passkinds
