From 05fbe7de70f4b032b16d7f8062e74a328effd4e7 Mon Sep 17 00:00:00 2001 From: Jacob Williams Date: Wed, 6 Mar 2024 09:42:19 -0600 Subject: [PATCH] fixed a bug where compilation with REAL128 didn't work Fixes #550 --- src/json_value_module.F90 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/json_value_module.F90 b/src/json_value_module.F90 index ab890efd4..27ea86988 100644 --- a/src/json_value_module.F90 +++ b/src/json_value_module.F90 @@ -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 @@ -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