File: integer_bin_op_dim_external_module.f90

package info (click to toggle)
lfortran 0.59.0-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 56,736 kB
  • sloc: cpp: 168,052; f90: 74,272; python: 17,537; ansic: 7,705; yacc: 2,345; sh: 1,334; fortran: 895; makefile: 37; javascript: 15
file content (73 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (4)
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
67
68
69
70
71
72
73
module xx
   integer :: nx = 4
   integer :: ny = 1
   integer :: nz = 1
end module xx

subroutine a(cs)
   use xx
   integer, dimension(nx * ny - 1), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3])) error stop
end subroutine

subroutine b(cs)
   use xx
   integer, dimension(nx * ny), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3, 4])) error stop
end subroutine

subroutine c(cs)
   use xx
   integer, dimension(2 + 3), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3, 4, 5])) error stop
end subroutine

subroutine d(cs)
   use xx
   integer, dimension(nx - 1), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3])) error stop
end subroutine

subroutine e(cs)
   use xx
   integer, dimension(1 + nx * ny), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3, 4, 5])) error stop
end subroutine

subroutine f(cs)
   use xx
   integer, dimension(nx * ny * nz), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3, 4])) error stop
end subroutine

subroutine g(cs)
   use xx
   integer, dimension(1 + 2 + 3), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3, 4, 5, 6])) error stop
end subroutine

subroutine h(cs)
   use xx
   integer, dimension(nx * ny + ny * nz), intent(in) :: cs
   print *, cs
   if (all(cs /= [1, 2, 3, 4, 5])) error stop
end subroutine

program main
   integer, dimension(8) :: cs
   cs = [1, 2, 3, 4, 5, 6, 7, 8]
   call a(cs)
   call b(cs)
   call c(cs)
   call d(cs)
   call f(cs)
   call g(cs)
   call h(cs)
end program