Skip to content

Commit 05fbe7d

Browse files
committed
fixed a bug where compilation with REAL128 didn't work
Fixes #550
1 parent 18ef4c6 commit 05fbe7d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/json_value_module.F90

+14-2
Original file line numberDiff line numberDiff line change
@@ -8763,8 +8763,14 @@ subroutine json_get_real64_by_path(json, me, path, value, found, default)
87638763
real(real64),intent(in),optional :: default !! default value if not found
87648764

87658765
real(RK) :: tmp
8766+
real(RK) :: tmp_default
87668767

8767-
call json%get(me, path, tmp, found, default)
8768+
if (present(default)) then
8769+
tmp_default = real(default, RK)
8770+
call json%get(me, path, tmp, found, tmp_default)
8771+
else
8772+
call json%get(me, path, tmp, found)
8773+
end if
87688774
value = real(tmp,real64)
87698775

87708776
end subroutine json_get_real64_by_path
@@ -8826,8 +8832,14 @@ subroutine json_get_real64_vec_by_path(json, me, path, vec, found, default)
88268832
real(real64),dimension(:),intent(in),optional :: default !! default value if not found
88278833

88288834
real(RK),dimension(:),allocatable :: tmp
8835+
real(RK),dimension(:),allocatable :: tmp_default
88298836

8830-
call json%get(me, path, tmp, found, default)
8837+
if (present(default)) then
8838+
tmp_default = real(default, RK)
8839+
call json%get(me, path, tmp, found, tmp_default)
8840+
else
8841+
call json%get(me, path, tmp, found)
8842+
end if
88318843
if (allocated(tmp)) vec = real(tmp,real64)
88328844

88338845
end subroutine json_get_real64_vec_by_path

0 commit comments

Comments
 (0)