@@ -105,33 +105,45 @@ subroutine test3_bound_parameter
105
105
ubound (a3, 2 ) == 1 .and. &
106
106
ubound (a3, 3 ) == 6
107
107
end subroutine
108
- subroutine test4_lbound_parentheses
109
- ! Test lbound with (x) expressions
108
+ subroutine test4_bound_parentheses
109
+ ! Test [ul]bound with (x) expressions
110
110
integer :: a1(1 ) = 0
111
111
logical , parameter :: test_lba1 = all (lbound ((a1)) == [1 ])
112
+ logical , parameter :: test_uba1 = all (ubound ((a1)) == [1 ])
112
113
integer :: a2(0 :2 ) = 0
113
114
logical , parameter :: test_lba2 = all (lbound ((a2)) == [1 ])
115
+ logical , parameter :: test_uba2 = all (ubound ((a2)) == [3 ])
114
116
integer :: a3(- 1 :0 ) = 0
115
117
logical , parameter :: test_lba3 = all (lbound ((a3)) == [1 ])
118
+ logical , parameter :: test_uba3 = all (ubound ((a3)) == [2 ])
116
119
integer :: a4(- 5 :- 1 , 2 :5 ) = 0
117
120
logical , parameter :: test_lba4 = all (lbound ((a4)) == [1 , 1 ])
121
+ logical , parameter :: test_uba4 = all (ubound ((a4)) == [5 , 4 ])
118
122
119
123
! Exercise with DIM=
120
124
logical , parameter :: test_lba4_dim = lbound ((a4), 1 ) == 1 .and. &
121
125
lbound ((a4), 2 ) == 1
126
+ logical , parameter :: test_uba4_dim = ubound ((a4), 1 ) == 5 .and. &
127
+ ubound ((a4), 2 ) == 4
122
128
123
129
! Exercise with parameter types
124
130
integer , parameter :: pa1(1 ) = 0
125
131
logical , parameter :: test_lbpa1 = all (lbound ((pa1)) == [1 ])
132
+ logical , parameter :: test_ubpa1 = all (ubound ((pa1)) == [1 ])
126
133
integer , parameter :: pa2(0 :2 ) = 0
127
134
logical , parameter :: test_lbpa2 = all (lbound ((pa2)) == [1 ])
135
+ logical , parameter :: test_ubpa2 = all (ubound ((pa2)) == [3 ])
128
136
integer , parameter :: pa3(- 1 :0 ) = 0
129
137
logical , parameter :: test_lbpa3 = all (lbound ((pa3)) == [1 ])
138
+ logical , parameter :: test_ubpa3 = all (ubound ((pa3)) == [2 ])
130
139
integer , parameter :: pa4(- 5 :- 1 , 2 :5 ) = 0
131
140
logical , parameter :: test_lbpa4 = all (lbound ((pa4)) == [1 , 1 ])
141
+ logical , parameter :: test_ubpa4 = all (ubound ((pa4)) == [5 , 4 ])
132
142
133
143
! Exercise with DIM=
134
144
logical , parameter :: test_lbpa4_dim = lbound ((pa4), 1 ) == 1 .and. &
135
145
lbound ((pa4), 2 ) == 1
146
+ logical , parameter :: test_ubpa4_dim = ubound ((pa4), 1 ) == 5 .and. &
147
+ ubound ((pa4), 2 ) == 4
136
148
end
137
149
end
0 commit comments