Skip to content

Commit 3226ea8

Browse files
author
Damian Rouson
committed
refactor acceptable_compiler.f90
1 parent eeba077 commit 3226ea8

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

prerequisites/acceptable_compiler.f90

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
! POSSIBILITY OF SUCH DAMAGE.
3434

3535
program main
36-
!! input: acceptable compiler version the form major.minor.patch
36+
!! input: acceptable compiler version in the form major.minor.patch
3737
!! output:
3838
!! .true. if compiler version >= acceptable version
3939
!! .false. otherwise
@@ -47,41 +47,40 @@ program main
4747
call get_command_argument(first_argument,acceptable_version,status=stat)
4848
call validate_command_line( stat )
4949

50-
print *, patch_meets_minimum( acceptable_version )
50+
print *, meets_minimum( acceptable_version )
5151

5252
contains
5353

54-
pure function patch_meets_minimum( required_version ) result( is_acceptable)
54+
pure function meets_minimum( required_version ) result( acceptable)
5555
character(len=*), intent(in) :: required_version
56-
logical is_acceptable
56+
logical acceptable
5757

58-
is_acceptable = .false. ! default result
58+
acceptable = .false. ! default result
5959

6060
associate( actual_version => compiler_version() )
6161
associate(major_version=>major(actual_version), acceptable_major=>major(required_version))
6262
if (major_version < acceptable_major) return
6363
if (major_version > acceptable_major) then
64-
is_acceptable = .true.
64+
acceptable = .true.
6565
return
6666
end if
6767
associate(minor_version=>minor(actual_version), acceptable_minor=>minor(required_version))
6868
if (minor_version < acceptable_minor) return
6969
if (minor_version > acceptable_minor) then
70-
is_acceptable = .true.
70+
acceptable = .true.
7171
return
7272
end if
7373
associate(patch_version=>patch(actual_version), acceptable_patch=>patch(required_version))
7474
if (patch_version < acceptable_patch) return
75-
is_acceptable = .true.
75+
acceptable = .true.
7676
end associate
7777
end associate
7878
end associate
7979
end associate
8080

81-
8281
end function
8382

84-
subroutine validate_command_line( command_line_status )
83+
pure subroutine validate_command_line( command_line_status )
8584
integer, intent(in) :: command_line_status
8685
select case(command_line_status)
8786
case(-1)

0 commit comments

Comments
 (0)