real function sum_1d_array(argc, argv)
!
!dec$ attributes c, alias:'_sum_1d_array'   :: sum_1d_array
!dec$ attributes c, alias:'_sum_1d_array_'  :: sum_1d_array_
!
      implicit none

      integer, intent(in)                   :: argc
      integer, intent(in), dimension(argc)  :: argv

      real, external                        :: sum_1d_array_

      sum_1d_array = sum_1d_array_(%val(argv(1)),   ! n
     2                             %val(argv(2)),   ! array
     3                             %val(argv(3)))   ! total

      end
      real function sum_1d_array_(n, array, total)
!
!dec$ attributes c, alias:'_sum_1d_array_'  :: sum_1d_array_
!dec$ attributes reference                  :: n
!dec$ attributes reference                  :: array
!dec$ attributes reference                  :: total
!
      implicit none

      integer,   intent(in)                 :: n
      real,      intent(in),  dimension(n)  :: array
      real,      intent(out)                :: total

      total         = sum(array)
      sum_1d_array_ = total

      end