xref: /original-bsd/usr.bin/f77/tests/tests/fs083.f (revision 252ddc1c)
1      function  ff083 (idon01,iddn2a,iddn3a,rdon02)
2      dimension  iddn2a (2,2), iddn3a(3,4,5)
3c
4c     comment section
5c
6c     ff083
7c
8c         this function subprogram is called by the main program fm080.
9c     the type declaration is implicit real.
10c     the function dummy arguments are both integer and real. dummy
11c     arguments idon01, iddn2a and iddn3a are incremented by 10, 20 and
12c     40 respectively before control is returned to the main program.
13c     the value of the function returned to the referencing program
14c     will be the sum of the actual arguments as passed to the
15c     subprogram ff083.
16c         dummy argument iddn2a corresponds to an array-name in the
17c     actual argument of the main program.  dummy argument iddn3a
18c     corresponds to an array-element-name in the actual argument of the
19c     main program.  dummy argument idon02  corresponds to an expression
20c     containing variables,arithmetic operators and constants in the
21c     actual argument of the main program.
22c
23c      references
24c        american national standard programming language fortran,
25c              x3.9-1978
26c
27c        section 4.1.2, type rules for data and procedure identifiers
28c        section 15.5.1, function subprogram
29c
30c     test section
31c
32c          function subprogram
33c
34      ivon01 = idon01
35      ivon02 = iddn2a (1,1)
36      ivon03 = iddn3a (2,3,4)
37      rvon04 = rdon02
38c
39      rvon05 = ivon01 + ivon02 + ivon03
40      ff083 = rvon05 + rvon04
41c
42      idon01 = ivon01 + 10
43      iddn2a (1,1) = ivon02 + 20
44      iddn3a (2,3,4) = ivon03 + 40
45c
46      return
47      end
48