Skip to content

Commit db5159c

Browse files
Merge pull request #516 from jacobwilliams/505-version-2
505 version 2
2 parents d3275f8 + 893f630 commit db5159c

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

src/json_module.F90

+21-2
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,32 @@ module json_module
7373

7474
implicit none
7575

76-
character(kind=json_CK,len=5),protected :: json_fortran_version = '8.2.5'
76+
character(kind=json_CK,len=*),parameter,private :: version = '8.2.5'
7777
!! JSON-Fortran version.
7878
!!
7979
!!@note This string should match the one in the `.VERSION` file (which is used
80-
!! for the documentation generation.)
80+
!! for the documentation generation.)
8181

8282
public
8383

84+
contains
85+
!*****************************************************************************************
86+
87+
!*****************************************************************************************
88+
!>
89+
! Returns the JSON-Fortran version string.
90+
91+
function json_fortran_version() result(ver)
92+
93+
implicit none
94+
95+
character(len=:),allocatable :: ver !! JSON-Fortran version string
96+
97+
ver = version
98+
99+
end function json_fortran_version
100+
!*****************************************************************************************
101+
102+
!*****************************************************************************************
84103
end module json_module
85104
!*****************************************************************************************

src/tests/jf_test_01.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ subroutine test_1(error_cnt)
5757
write(error_unit,'(A)') '================================='
5858
write(error_unit,'(A)') ''
5959

60-
write(error_unit,'(A)') 'JSON-Fortran version: '//json_fortran_version
60+
write(error_unit,'(A)') 'JSON-Fortran version: '//json_fortran_version()
6161

6262
! parse the json file:
6363
write(error_unit,'(A)') ''

0 commit comments

Comments
 (0)