Skip to content

Commit 00d7127

Browse files
committed
use fortran 2018 error stop
1 parent 1f1405b commit 00d7127

34 files changed

+65
-154
lines changed
File renamed without changes.
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
module std_mkdir
22
!! C binding to C-stdlib mkdir()
33
use, intrinsic:: iso_c_binding, only: c_int, c_char, C_NULL_CHAR
4-
use, intrinsic:: iso_fortran_env, only: stderr=>error_unit
54

6-
implicit none
5+
implicit none (type, external)
76

87
logical, parameter :: debug = .false.
98

@@ -94,7 +93,7 @@ end module std_mkdir
9493
program test_mkdir
9594
!! just for testing
9695
use std_mkdir
97-
implicit none
96+
implicit none (type, external)
9897

9998
!> demo
10099
character(4096) :: buf
@@ -115,8 +114,6 @@ program test_mkdir
115114
close(u)
116115

117116
inquire(file=fpath, exist=exists)
118-
if(.not.exists) then
119-
write(stderr,*) fpath // ' failed to be created'
120-
error stop
121-
endif
117+
if(.not.exists) error stop fpath // ' failed to be created'
118+
122119
end program
File renamed without changes.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
program pi2008
12
!! implements calculation:
23
!! $$ \pi = \int^1_{-1} \frac{dx}{\sqrt{1-x^2}}
34

4-
use, intrinsic:: iso_fortran_env, only: dp=>real64, int64, stderr=>error_unit
5+
use, intrinsic:: iso_fortran_env, only: dp=>real64, int64
56
implicit none
67

78
integer, parameter :: wp = dp
@@ -62,4 +63,4 @@
6263
print '(A,E10.3,A,I3,A)', 'Elapsed wall clock time ', telaps, ' seconds, using',num_images(),' images.'
6364
end if
6465

65-
end program
66+
end program

character/test_string.f90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
program test_string
22

3-
use, intrinsic:: iso_fortran_env, only: stderr=>error_unit
43
use, intrinsic:: iso_c_binding, only: c_null_char
54
use string_utils
65

cmake/f18errorstop.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
check_fortran_source_compiles("character :: x; error stop x; end" f18errorstop SRC_EXT f90)
2+
if(NOT f18errorstop)
3+
message(FATAL_ERROR "Fortran 2018 error stop is used throughout.")
4+
endif()

coarray/pi.f90

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ program test_pi
22
!! implements calculation:
33
!! $$ \pi = \int^1_{-1} \frac{dx}{\sqrt{1-x^2}}
44

5-
use, intrinsic:: iso_fortran_env, only: dp=>real64, int64, stderr=>error_unit
5+
use, intrinsic:: iso_fortran_env, only: dp=>real64, int64
66
implicit none (type, external)
77

88
integer, parameter :: wp = dp
@@ -42,11 +42,7 @@ program test_pi
4242
! print *,x,f,psum
4343
end do
4444

45-
call co_sum(psum, stat=ierr)
46-
if (ierr /= 0) then
47-
write(stderr,*) 'error stop', ierr
48-
error stop
49-
endif
45+
call co_sum(psum)
5046

5147
if (im == 1) then
5248
print *,'pi:',pi,' iterated pi: ',psum

0 commit comments

Comments
 (0)