File: udr4.f90

package info (click to toggle)
gcc-avr 1%3A5.4.0%2BAtmel3.6.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 589,832 kB
  • sloc: ansic: 2,775,567; ada: 756,757; cpp: 723,977; f90: 117,673; asm: 66,896; makefile: 62,755; xml: 44,466; sh: 29,549; exp: 23,315; objc: 15,216; fortran: 10,901; pascal: 4,185; python: 4,093; perl: 2,969; awk: 2,811; ml: 2,385; cs: 879; yacc: 316; lex: 198; haskell: 112; lisp: 8
file content (50 lines) | stat: -rw-r--r-- 1,931 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
! { dg-do run }

!$omp declare reduction (foo : character(kind=1, len=*) &
!$omp & : omp_out = fn (omp_out, omp_in)) initializer (omp_priv = '')
!$omp declare reduction (bar : character(kind=1, len=:) &
!$omp & : omp_out = fn (omp_in, omp_out)) initializer (omp_priv = '')
!$omp declare reduction (baz : character(kind=1, len=1) &
!$omp & : omp_out = char (ichar (omp_out) + ichar (omp_in) &
!$omp & - ichar ('0'))) initializer (omp_priv = '0')
!$omp declare reduction (baz : character(kind=1, len=2) &
!$omp & : omp_out = char (ichar (omp_out(1:1)) + ichar (omp_in(1:1)) &
!$omp & - ichar ('0')) // char (ichar (omp_out(2:2)) + &
!$omp & ichar (omp_in(2:2)) - ichar ('0'))) initializer (omp_priv = '00')
  interface
    elemental function fn (x, y)
      character (len=64), intent (in) :: x, y
      character (len=64) :: fn
    end function
  end interface
  character(kind=1, len=64) :: c(-3:-2,1:1,7:8), d(2:3,-7:-5)
  character(kind = 1, len=1) :: e(2:4)
  character(kind = 1, len=1+1) :: f(8:10,9:10)
  integer :: i, j, k
  c = ''
  d = ''
  e = '0'
  f = '00'
!$omp parallel do reduction (foo : c) reduction (bar : d) &
!$omp & reduction (baz : e, f) private (j, k)
  do i = 1, 64
    forall (j = -3:-2, k = 7:8) &
      c(j,1,k) = trim(c(j,1,k)) // char (ichar ('0') + i)
    d = char (ichar ('0') + i) // d
    e = char (ichar (e) + mod (i, 3))
    f = char (ichar (f(:,:)(1:1)) + mod (i, 2)) &
&	// char (ichar (f(:,:)(2:2)) + mod (i, 3))
  end do
  do i = 1, 64
    if (any (index (c, char (ichar ('0') + i)) .eq. 0)) call abort
    if (any (index (d, char (ichar ('0') + i)) .eq. 0)) call abort
  end do
  if (any (e.ne.char (ichar ('0') + 64))) call abort
  if (any (f(:,:)(1:1).ne.char (ichar ('0') + 32))) call abort
  if (any (f(:,:)(2:2).ne.char (ichar ('0') + 64))) call abort
end
elemental function fn (x, y)
  character (len=64), intent (in) :: x, y
  character (len=64) :: fn
  fn = trim(x) // y
end function