|
39 | 39 | !
|
40 | 40 | ! **json-fortran License:**
|
41 | 41 | !
|
42 |
| -! JSON-FORTRAN: A Fortran 2008 JSON API |
| 42 | +! JSON-Fortran: A Fortran 2008 JSON API |
43 | 43 | !
|
44 | 44 | ! http://github.com/jacobwilliams/json-fortran
|
45 | 45 | !
|
@@ -844,8 +844,8 @@ end subroutine array_callback_func
|
844 | 844 | !6 = sign + leading 0 + decimal + 'E' + exponent sign + 1 extra
|
845 | 845 | integer(IK),parameter :: max_numeric_str_len = real_precision + real_exponent_digits + 6
|
846 | 846 | ! real format set by library initialization
|
847 |
| - character(kind=CDK,len=*),parameter :: int_fmt = '(I0)' !minimum width format for integers |
848 |
| - character(kind=CK, len=*),parameter :: star = '*' !for invalid numbers |
| 847 | + character(kind=CDK,len=*),parameter :: int_fmt = '(ss,I0)' !minimum width format for integers |
| 848 | + character(kind=CK, len=*),parameter :: star = '*' !for invalid numbers |
849 | 849 |
|
850 | 850 | !real string printing:
|
851 | 851 | character(kind=CDK,len=:),allocatable :: real_fmt !the format string to use for real numbers
|
@@ -1588,13 +1588,13 @@ subroutine json_initialize(verbose,compact_reals)
|
1588 | 1588 | ! set the default output/input format for reals:
|
1589 | 1589 | ! [this only needs to be done once, since it can't change]
|
1590 | 1590 | if (.not. allocated(real_fmt)) then
|
1591 |
| - write(w,'(I0)',iostat=istat) max_numeric_str_len |
1592 |
| - if (istat==0) write(d,'(I0)',iostat=istat) real_precision |
1593 |
| - if (istat==0) write(e,'(I0)',iostat=istat) real_exponent_digits |
| 1591 | + write(w,'(ss,I0)',iostat=istat) max_numeric_str_len |
| 1592 | + if (istat==0) write(d,'(ss,I0)',iostat=istat) real_precision |
| 1593 | + if (istat==0) write(e,'(ss,I0)',iostat=istat) real_exponent_digits |
1594 | 1594 | if (istat==0) then
|
1595 |
| - real_fmt = '(E' // trim(w) // '.' // trim(d) // 'E' // trim(e) // ')' |
| 1595 | + real_fmt = '(ss,E' // trim(w) // '.' // trim(d) // 'E' // trim(e) // ')' |
1596 | 1596 | else
|
1597 |
| - real_fmt = '(E30.16E3)' !just use this one (should never happen) |
| 1597 | + real_fmt = '(ss,E30.16E3)' !just use this one (should never happen) |
1598 | 1598 | end if
|
1599 | 1599 | end if
|
1600 | 1600 |
|
@@ -1644,7 +1644,7 @@ subroutine json_throw_exception(msg)
|
1644 | 1644 |
|
1645 | 1645 | if (is_verbose) then
|
1646 | 1646 | write(*,'(A)') '***********************'
|
1647 |
| - write(*,'(A)') 'JSON-FORTRAN EXCEPTION: '//trim(msg) |
| 1647 | + write(*,'(A)') 'JSON-Fortran EXCEPTION: '//trim(msg) |
1648 | 1648 | !call backtrace() ! gfortran (use -fbacktrace -fall-intrinsics flags)
|
1649 | 1649 | !call tracebackqq(-1) ! intel (requires "use ifcore" in this routine)
|
1650 | 1650 | write(*,'(A)') '***********************'
|
@@ -6487,7 +6487,7 @@ subroutine compact_real_string(str)
|
6487 | 6487 | decimal_pos = scan(str,CK_'.')
|
6488 | 6488 | if (exp_start /= 0) separator = str(exp_start:exp_start)
|
6489 | 6489 |
|
6490 |
| - if (exp_start > 0 .and. exp_start < decimal_pos) then !signed, exponent-less float |
| 6490 | + if ( exp_start < decimal_pos ) then !possibly signed, exponent-less float |
6491 | 6491 |
|
6492 | 6492 | significand = str
|
6493 | 6493 | sig_trim = len(trim(significand))
|
|
0 commit comments