Skip to content

Commit

Permalink
fixed a bug where compilation with REAL128 didn't work
Browse files Browse the repository at this point in the history
Fixes #550
  • Loading branch information
jacobwilliams committed Mar 6, 2024
1 parent 18ef4c6 commit 05fbe7d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/json_value_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8763,8 +8763,14 @@ subroutine json_get_real64_by_path(json, me, path, value, found, default)
real(real64),intent(in),optional :: default !! default value if not found

real(RK) :: tmp
real(RK) :: tmp_default

call json%get(me, path, tmp, found, default)
if (present(default)) then
tmp_default = real(default, RK)
call json%get(me, path, tmp, found, tmp_default)
else
call json%get(me, path, tmp, found)
end if
value = real(tmp,real64)

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

real(RK),dimension(:),allocatable :: tmp
real(RK),dimension(:),allocatable :: tmp_default

call json%get(me, path, tmp, found, default)
if (present(default)) then
tmp_default = real(default, RK)
call json%get(me, path, tmp, found, tmp_default)
else
call json%get(me, path, tmp, found)
end if
if (allocated(tmp)) vec = real(tmp,real64)

end subroutine json_get_real64_vec_by_path
Expand Down

0 comments on commit 05fbe7d

Please sign in to comment.