Skip to content

Commit c0887cd

Browse files
committed
another attempt to fix gfortran bug on Travis.
1 parent 535d857 commit c0887cd

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

src/json_value_module.F90

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6966,10 +6966,11 @@ subroutine get_chars_from_array(json, element, i, count)
69666966
#if defined __GFORTRAN__
69676967
! this is a work-around for a bug
69686968
! in the gfortran 4.9 compiler.
6969-
block
6970-
character(kind=CK,len=max_len),dimension(count) :: tmp_array
6971-
vec = tmp_array
6972-
end block
6969+
call allocate_vec(max_len,count)
6970+
!block
6971+
! character(kind=CK,len=max_len),dimension(count) :: tmp_array
6972+
! vec = tmp_array
6973+
!end block
69736974
#else
69746975
allocate( character(kind=CK,len=max_len) :: vec(count) )
69756976
#endif
@@ -6989,6 +6990,21 @@ subroutine get_chars_from_array(json, element, i, count)
69896990

69906991
end subroutine get_chars_from_array
69916992

6993+
subroutine allocate_vec(max_len,count)
6994+
6995+
!! try to allocate on assignment to avoid gfortran bug.
6996+
6997+
implicit none
6998+
6999+
integer(IK),intent(in) :: max_len
7000+
integer(IK),intent(in) :: count
7001+
7002+
character(kind=CK,len=max_len),dimension(count) :: tmp_array
7003+
7004+
vec = tmp_array
7005+
7006+
end subroutine allocate_vec
7007+
69927008
end subroutine json_get_alloc_string_vec
69937009
!*****************************************************************************************
69947010

0 commit comments

Comments
 (0)