source: CIVL/examples/omp/dataracebench-1.3.2/micro-benchmarks-fortran/DRB057-jacobiinitialize-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.6 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!Use of private() clause. No data race pairs.
9
10
11module DRB057
12 use omp_lib
13 implicit none
14
15 integer :: MSIZE
16 integer :: n,m,mits
17 integer, parameter :: dp = kind(1.0d0)
18 real(dp), dimension(:,:), pointer :: u,f,uold
19 real(dp) :: dx,dy,tol,relax,alpha
20
21contains
22 subroutine initialize()
23 integer :: i,j,xx,yy
24
25 MSIZE = 200
26 mits = 1000
27 relax = 1.0
28 alpha = 0.0543
29 n = MSIZE
30 m = MSIZE
31 allocate(u(MSIZE,MSIZE))
32 allocate(f(MSIZE,MSIZE))
33 allocate(uold(MSIZE,MSIZE))
34
35 dx = 2.0D0 / DBLE(n-1)
36 dy = 2.0D0 / DBLE(m-1)
37
38 !Initialize initial condition and RHS
39 !$omp parallel do private(i,j,xx,yy)
40 do i = 1, n
41 do j = 1, m
42 xx = int(-1.0 + dx * (i-1))
43 yy = int(-1.0 + dy * (i-1))
44 u(i,j) = 0.0
45 f(i,j) = -1.0 * alpha * (1.0-xx*xx) * (1.0-yy*yy) - 2.0* (1.0-xx*xx) -2.0 * (1.0-yy*yy)
46 end do
47 end do
48 !$omp end parallel do
49
50 end subroutine
51end module
52
53program DRB057_jacobiinitialize_orig_no
54 use omp_lib
55 use DRB057
56 implicit none
57
58 call initialize()
59end program
60
Note: See TracBrowser for help on using the repository browser.