File: test_diagnostic_int.f90

package info (click to toggle)
fortran-language-server 3.2.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,268 kB
  • sloc: python: 9,688; f90: 1,195; fortran: 30; makefile: 28; ansic: 20
file content (43 lines) | stat: -rw-r--r-- 877 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
module test_int

   implicit none

   contains

   subroutine foo(f, arg2)
      interface
         function f(x)
            real, intent(in) :: x
            real :: f
         end function
      end interface
      integer, intent(in) :: arg2
      real :: y
      y = 1.
      print*, f(y)
   end subroutine foo

   function foo2(f, g, h) result(arg3)
      interface
         function f(x) result(z)
            real, intent(in) :: x
            real :: z
         end function
         function g(x) result(z)
            real, intent(in) :: x
            real :: z
         end function
      end interface
      interface
         function h(x) result(z)
            real, intent(in) :: x
            real :: z
         end function h
      end interface
      real :: y
      real :: arg3
      y = 1.
      arg3 = f(g(h(y)))
   end function foo2

end module test_int