source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB050-functionparameter-orig-no.f95

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100755
File size: 1.2 KB
Line 
1!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
2!!! Copyright (c) 2017-20, Lawrence Livermore National Security, LLC
3!!! and DataRaceBench project contributors. See the DataRaceBench/COPYRIGHT file for details.
4!!!
5!!! SPDX-License-Identifier: (BSD-3-Clause)
6!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!
7
8!Arrays passed as function parameters. No data race pairs.
9
10
11module DRB050
12 use omp_lib
13 implicit none
14 integer, parameter :: dp = kind(1.0d0)
15 real(dp), dimension(:), allocatable :: o1, c
16contains
17 subroutine foo1(o1,c,len)
18 integer, parameter :: dp = kind(1.0d0)
19 real(dp), dimension(:), allocatable :: o1, c
20 real(dp) :: volnew_o8
21 integer :: len, i
22
23 !$omp parallel do private(volnew_o8)
24 do i = 1, len
25 volnew_o8 = 0.5*c(i)
26 o1(i) = volnew_o8
27 end do
28 !$omp end parallel do
29! print*,o1(50)
30 end subroutine
31end module
32
33program DRB050_functionparameter_orig_no
34 use omp_lib
35 use DRB050
36 implicit none
37
38 allocate (o1(100))
39 allocate (c(100))
40
41 call foo1(o1, c, 100)
42end program
Note: See TracBrowser for help on using the repository browser.