Skip to content

Commit e417f85

Browse files
committed
attempted fix for Travis build, which is using older version of gfortran.
1 parent 210f9b2 commit e417f85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/json_value_module.F90

+13
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,9 @@ subroutine json_matrix_info_by_path(json,p,path,is_matrix,found,&
12221222

12231223
type(json_value),pointer :: p_var
12241224
logical(LK) :: ok
1225+
#if defined __GFORTRAN__
1226+
character(kind=CK,len=:),allocatable :: p_name !! for getting the name
1227+
#endif
12251228

12261229
call json%get(p,path,p_var,found)
12271230

@@ -1239,7 +1242,17 @@ subroutine json_matrix_info_by_path(json,p,path,is_matrix,found,&
12391242
if (present(name)) name = ''
12401243
else
12411244
!get info:
1245+
1246+
!get info about the variable:
1247+
#if defined __GFORTRAN__
1248+
! [note: passing name directory to this routine seems
1249+
! to have a bug on older gfortran versions...
1250+
call json%matrix_info(p_var,is_matrix,var_type,n_sets,set_size,p_name)
1251+
if (present(name)) name = p_name
1252+
if (allocated(p_name)) deallocate(p_name)
1253+
#else
12421254
call json%matrix_info(p_var,is_matrix,var_type,n_sets,set_size,name)
1255+
#endif
12431256
if (json%failed() .and. present(found)) then
12441257
found = .false.
12451258
call json%clear_exceptions()

0 commit comments

Comments
 (0)