File: mod1.f90

package info (click to toggle)
lfortran 0.45.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 46,332 kB
  • sloc: cpp: 137,068; f90: 51,260; python: 6,444; ansic: 4,277; yacc: 2,285; fortran: 806; sh: 524; makefile: 30; javascript: 15
file content (49 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (2)
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
module mod1
implicit none
private
public f1, f2, f3, f4, f2b, f3b, f5b

contains

integer function f1(a, b) result(r)
integer, intent(in) :: a, b
r = a + b
end function

integer function f2(n, a) result(r)
integer, intent(in) :: n, a(n)
r = sum(a)
end function

integer function f3(n, m, a) result(r)
integer, intent(in) :: n, m, a(n,m)
r = sum(a)
end function

integer function f2b(a) result(r)
integer, intent(in) :: a(:)
r = sum(a)
end function

integer function f3b(a) result(r)
integer, intent(in) :: a(:,:)
r = sum(a)
end function

integer function f4(a, b)
integer, intent(in) :: a
integer, intent(out) :: b
b = a
f4 = 0
end function

integer function f5b(a) result(r)
integer, intent(in) :: a(:,:)
integer :: i
r = 0
do i = 1, size(a, 2)
    r = r + a(1, i)
end do
end function

end module