diff --git a/src/json_module.F90 b/src/json_module.F90 index 40db581834..a15ee99fd5 100644 --- a/src/json_module.F90 +++ b/src/json_module.F90 @@ -73,13 +73,32 @@ module json_module implicit none - character(kind=json_CK,len=5),protected :: json_fortran_version = '8.2.5' + character(kind=json_CK,len=*),parameter,private :: version = '8.2.5' !! JSON-Fortran version. !! !!@note This string should match the one in the `.VERSION` file (which is used - !! for the documentation generation.) + !! for the documentation generation.) public + contains +!***************************************************************************************** + +!***************************************************************************************** +!> +! Returns the JSON-Fortran version string. + + function json_fortran_version() result(ver) + + implicit none + + character(len=:),allocatable :: ver !! JSON-Fortran version string + + ver = version + + end function json_fortran_version +!***************************************************************************************** + +!***************************************************************************************** end module json_module !***************************************************************************************** diff --git a/src/tests/jf_test_01.F90 b/src/tests/jf_test_01.F90 index 73d067ba8a..534aed7ab2 100644 --- a/src/tests/jf_test_01.F90 +++ b/src/tests/jf_test_01.F90 @@ -57,7 +57,7 @@ subroutine test_1(error_cnt) write(error_unit,'(A)') '=================================' write(error_unit,'(A)') '' - write(error_unit,'(A)') 'JSON-Fortran version: '//json_fortran_version + write(error_unit,'(A)') 'JSON-Fortran version: '//json_fortran_version() ! parse the json file: write(error_unit,'(A)') ''