@@ -672,7 +672,7 @@ subroutine json_initialize(json,verbose,compact_reals,&
672
672
673
673
!
674
674
! JW comment out for now (these are now protected variables in another module)
675
- ! for thread-save version, we won't be able to have global variables.........
675
+ ! for thread-safe version, we won't be able to have global variables.........
676
676
!
677
677
! Ensure gfortran bug work around "parameters" are set properly
678
678
! null_str = 'null'
@@ -1001,13 +1001,13 @@ subroutine json_throw_exception(json,msg)
1001
1001
json% err_message = trim (msg)
1002
1002
1003
1003
if (json% is_verbose) then
1004
- write (* ,' (A)' ) ' ***********************'
1005
- write (* ,' (A)' ) ' JSON-Fortran Exception: ' // trim (msg)
1004
+ write (output_unit ,' (A)' ) ' ***********************'
1005
+ write (output_unit ,' (A)' ) ' JSON-Fortran Exception: ' // trim (msg)
1006
1006
! call backtrace() ! gfortran (use -fbacktrace -fall-intrinsics flags)
1007
1007
#ifdef __INTEL_COMPILER
1008
1008
call tracebackqq(user_exit_code=- 1 ) ! print a traceback and return
1009
1009
#endif
1010
- write (* ,' (A)' ) ' ***********************'
1010
+ write (output_unit ,' (A)' ) ' ***********************'
1011
1011
end if
1012
1012
1013
1013
end subroutine json_throw_exception
@@ -4724,8 +4724,10 @@ recursive subroutine parse_value(json, unit, str, value)
4724
4724
4725
4725
logical (LK) :: eof
4726
4726
character (kind= CK,len= 1 ) :: c
4727
+ #if defined __GFORTRAN__
4727
4728
character (kind= CK,len= :),allocatable :: tmp ! ! this is a work-around for a bug
4728
4729
! ! in the gfortran 4.9 compiler.
4730
+ #endif
4729
4731
4730
4732
if (.not. json% exception_thrown) then
4731
4733
@@ -4766,9 +4768,13 @@ recursive subroutine parse_value(json, unit, str, value)
4766
4768
4767
4769
select case (value% var_type)
4768
4770
case (json_string)
4769
- call json% parse_string(unit, str, tmp) ! write to a tmp variable because of
4770
- value% str_value = tmp ! a bug in 4.9 gfortran compiler.
4771
- deallocate (tmp) !
4771
+ #if defined __GFORTRAN__
4772
+ call json% parse_string(unit,str,tmp) ! write to a tmp variable because of
4773
+ value% str_value = tmp ! a bug in 4.9 gfortran compiler.
4774
+ deallocate (tmp) !
4775
+ #else
4776
+ call json% parse_string(unit, str, value% str_value)
4777
+ #endif
4772
4778
end select
4773
4779
4774
4780
case (CK_' t' ) ! true_str(1:1) gfortran bug work around
@@ -5343,8 +5349,10 @@ recursive subroutine parse_object(json, unit, str, parent)
5343
5349
type (json_value),pointer :: pair
5344
5350
logical (LK) :: eof
5345
5351
character (kind= CK,len= 1 ) :: c
5352
+ #if defined __GFORTRAN__
5346
5353
character (kind= CK,len= :),allocatable :: tmp ! ! this is a work-around for a bug
5347
5354
! ! in the gfortran 4.9 compiler.
5355
+ #endif
5348
5356
5349
5357
if (.not. json% exception_thrown) then
5350
5358
@@ -5366,9 +5374,13 @@ recursive subroutine parse_object(json, unit, str, parent)
5366
5374
return
5367
5375
else if (quotation_mark == c) then
5368
5376
call json_value_create(pair)
5369
- call json% parse_string(unit, str, tmp) ! write to a tmp variable because of
5370
- pair % name = tmp ! a bug in 4.9 gfortran compiler.
5377
+ #if defined __GFORTRAN__
5378
+ call json% parse_string(unit,str,tmp) ! write to a tmp variable because of
5379
+ pair% name = tmp ! a bug in 4.9 gfortran compiler.
5371
5380
deallocate (tmp)
5381
+ #else
5382
+ call json% parse_string(unit,str,pair% name)
5383
+ #endif
5372
5384
if (json% exception_thrown) then
5373
5385
call json% destroy(pair)
5374
5386
return
@@ -5920,7 +5932,7 @@ subroutine json_print_error_message(json,io_unit)
5920
5932
if (present (io_unit)) then
5921
5933
write (io_unit,' (A)' ) error_msg
5922
5934
else
5923
- write (* ,' (A)' ) error_msg
5935
+ write (output_unit ,' (A)' ) error_msg
5924
5936
end if
5925
5937
deallocate (error_msg)
5926
5938
call json% clear_exceptions()
0 commit comments