1 ! Copyright 2019-2020 Free Software Foundation, Inc.
3 ! This program is free software; you can redistribute it and/or modify
4 ! it under the terms of the GNU General Public License as published by
5 ! the Free Software Foundation; either version 3 of the License, or
6 ! (at your option) any later version.
8 ! This program is distributed in the hope that it will be useful,
9 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ! GNU General Public License for more details.
13 ! You should have received a copy of the GNU General Public License
14 ! along with this program. If not, see <http://www.gnu.org/licenses/>.
19 type, public :: Number
22 procedure :: get => get_number
23 procedure :: set => set_number
28 function get_number (this) result (val)
29 class (Number), intent (in) :: this
32 end function get_number
34 subroutine set_number (this, val)
35 class (Number), intent (inout) :: this
38 end subroutine set_number
40 end module some_module
42 logical function is_bigger (a,b)
43 integer, intent(in) :: a
44 integer, intent(in) :: b
46 end function is_bigger
48 subroutine say_numbers (v1,v2,v3)
49 integer,intent(in) :: v1
50 integer,intent(in) :: v2
51 integer,intent(in) :: v3
53 end subroutine say_numbers
59 integer function fun1 (x)
63 integer function fun2 (x)
67 subroutine say_array (arr)
68 integer, dimension (:,:) :: arr
69 end subroutine say_array
75 procedure(fun1), pointer:: fun_ptr => NULL()
77 integer, dimension (5,5) :: array
80 call say_numbers (1,2,3) ! stop here
81 call say_string ('hello world')
82 call say_array (array (2:3, 2:4))
87 integer function fun1 (x)
93 integer function fun2 (x)
99 subroutine say_string (str)
100 character(len=*) :: str
102 end subroutine say_string
104 subroutine say_array (arr)
105 integer, dimension (:,:) :: arr
106 do i=LBOUND (arr, 2), UBOUND (arr, 2), 1
107 do j=LBOUND (arr, 1), UBOUND (arr, 1), 1
108 write(*, fmt="(i4)", advance="no") arr (j, i)
112 end subroutine say_array