File: cosubscript_1.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A12.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 959,712 kB
  • sloc: cpp: 3,275,382; ansic: 2,061,766; ada: 840,956; f90: 208,513; makefile: 76,132; asm: 73,433; xml: 50,448; exp: 34,146; sh: 32,436; objc: 15,637; fortran: 14,012; python: 11,991; pascal: 6,787; awk: 4,779; perl: 3,054; yacc: 338; ml: 285; lex: 201; haskell: 122
file content (66 lines) | stat: -rw-r--r-- 1,504 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
! { dg-do run }
!
! From the HPCTools Group of University of Houston
!
! For a coindexed object, its cosubscript list determines the image
! index in the same way that a subscript list determines the subscript
! order value for an array element

! Run at least with 3 images for the normal checking code
! Modified to also accept a single or two images
program cosubscript_test
  implicit none
  
  integer, parameter :: X = 3, Y = 2
  integer, parameter :: P = 1, Q = -1
  integer :: me
  integer :: i,j,k
  
  integer :: scalar[0:P, -1:Q, *]
  
  integer :: dim3_max, counter
  logical :: is_err
  
  is_err = .false.
  me = this_image()
  scalar   = me
  dim3_max = num_images() / ( (P+1)*(Q+2) )
  
  sync all

  if (num_images() == 1) then
    k = 1
    j = -1
    i = 0
    if (scalar[i,j,k] /= this_image()) STOP 1
    stop "OK"
  else if (num_images() == 2) then
    k = 1
    j = -1
    counter = 0
    do i = 0,P
      counter = counter+1
      if (counter /= scalar[i,j,k]) STOP 1
    end do
    stop "OK"
  end if

  ! ******* SCALAR ***********
  counter = 0
  do k = 1, dim3_max
     do j = -1,Q
        do i = 0,P
           counter = counter+1
           if (counter /= scalar[i,j,k]) then
              print * , "Error in cosubscript translation scalar"
              print * , "[", i,",",j,",",k,"] = ",scalar[i,j,k],"/=",counter
              is_err = .true.
           end if
        end do
     end do
  end do
  
  if (is_err) then
    STOP 2
  end if
end program cosubscript_test