@@ -9,6 +9,7 @@ module stdlib_io
9
9
use, intrinsic :: iso_fortran_env, only : input_unit
10
10
use stdlib_kinds, only: sp, dp, xdp, qp, &
11
11
int8, int16, int32, int64
12
+ use stdlib_error, only: error_stop
12
13
use stdlib_optval, only: optval
13
14
use stdlib_ascii, only: is_blank
14
15
use stdlib_string_type, only : string_type
@@ -146,7 +147,7 @@ contains
146
147
147
148
if (ios/=0) then
148
149
write(msgout,1) trim(iomsg),i,trim(filename)
149
- error stop trim(msgout)
150
+ call error_stop(msg= trim(msgout) )
150
151
end if
151
152
152
153
end do
@@ -167,7 +168,7 @@ contains
167
168
168
169
if (ios/=0) then
169
170
write(msgout,1) trim(iomsg),i,trim(filename)
170
- error stop trim(msgout)
171
+ call error_stop(msg= trim(msgout) )
171
172
end if
172
173
173
174
enddo
@@ -178,7 +179,7 @@ contains
178
179
179
180
if (ios/=0) then
180
181
write(msgout,1) trim(iomsg),i,trim(filename)
181
- error stop trim(msgout)
182
+ call error_stop(msg= trim(msgout) )
182
183
end if
183
184
184
185
enddo
@@ -230,7 +231,7 @@ contains
230
231
231
232
if (ios/=0) then
232
233
write(msgout,1) trim(iomsg),i,trim(filename)
233
- error stop trim(msgout)
234
+ call error_stop(msg= trim(msgout) )
234
235
end if
235
236
236
237
end do
@@ -366,7 +367,7 @@ contains
366
367
position_='asis'
367
368
status_='new'
368
369
case default
369
- error stop "Unsupported mode: "//mode_(1:2)
370
+ call error_stop( "Unsupported mode: "//mode_(1:2) )
370
371
end select
371
372
372
373
select case (mode_(3:3))
@@ -375,7 +376,7 @@ contains
375
376
case('b')
376
377
form_='unformatted'
377
378
case default
378
- error stop "Unsupported mode: "//mode_(3:3)
379
+ call error_stop( "Unsupported mode: "//mode_(3:3))
379
380
end select
380
381
381
382
access_ = 'stream'
@@ -421,9 +422,9 @@ contains
421
422
else if (a(i:i) == ' ') then
422
423
cycle
423
424
else if(any(.not.lfirst)) then
424
- error stop "Wrong mode: "//trim(a)
425
+ call error_stop( "Wrong mode: "//trim(a) )
425
426
else
426
- error stop "Wrong character: "//a(i:i)
427
+ call error_stop( "Wrong character: "//a(i:i) )
427
428
endif
428
429
end do
429
430
@@ -472,7 +473,7 @@ contains
472
473
if (present(iostat)) then
473
474
iostat = stat
474
475
else if (stat /= 0) then
475
- error stop trim(msg)
476
+ call error_stop( trim(msg))
476
477
end if
477
478
end subroutine getline_char
478
479
0 commit comments