Skip to content

Commit 587bced

Browse files
committed
Merge pull request #81 from zbeekman/small-improvements
Small changes and fixes:
2 parents b47871a + ac46311 commit 587bced

File tree

4 files changed

+39
-22
lines changed

4 files changed

+39
-22
lines changed

build.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,24 @@ fi
5757
#build the stand-alone library:
5858
echo ""
5959
echo "Building library..."
60-
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" ${COVERAGE} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
60+
61+
# work around for FoBiS.py PR #45
62+
[ -d "$LIBDIR" ] || mkdir "$LIBDIR"
63+
64+
FoBiS.py build -ch -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" ${COVERAGE} -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
6165

6266
#build the unit tests (uses the above library):
6367
if [[ $JF_SKIP_TESTS != [yY]* ]]; then
6468
echo ""
6569
echo "Building unit tests..."
70+
71+
# FoBiS.py PR #45 work around
72+
[ -d "$BINDIR" ] || mkdir "$BINDIR"
73+
6674
for TEST in "${TESTDIR%/}"/jf_test_*.f90; do
6775
THIS_TEST=${TEST##*/}
6876
echo "Build ${THIS_TEST%.f90}"
69-
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" ${COVERAGE} -dbld ${BINDIR} -s ${TESTDIR} -i ${LIBDIR} -libs ${LIBDIR}/${LIBOUT} -dmod ./ -dobj ./ -t ${THIS_TEST} -o ${THIS_TEST%.f90} -colors
77+
FoBiS.py build -ch -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" ${COVERAGE} -dbld ${BINDIR} -s ${TESTDIR} -i ${LIBDIR} -libs ${LIBDIR}/${LIBOUT} -dmod ./ -dobj ./ -t ${THIS_TEST} -o ${THIS_TEST%.f90} -colors
7078
done
7179
else
7280
echo "Skip building the unit tests since \$JF_SKIP_TESTS has been set to 'true'."

robodoc.rc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# NOTES
1111
# Fortran keywords, statements, data types, intrinsic procedures, etc. from:
1212
# [1] http://fortranwiki.org/fortran/show/Keywords
13-
# [2] A. M. Gorelik, "Statements, data types and intrinsic procedures
13+
# [2] A. M. Gorelik, "Statements, data types and intrinsic procedures
1414
# in the Fortran standards (1966-2008)", ACM SIGPLAN Fortran Forum,
1515
# Volume 33 Issue 3, December 2014.
1616
#
@@ -20,9 +20,12 @@
2020
#
2121
# AUTHOR
2222
# Jacob Williams, 3/1/2015
23-
#
23+
#
2424
# SOURCE
2525

26+
ignore files:
27+
*~
28+
#*#
2629
items:
2730
AUTHOR
2831
BUGS

src/json_module.f90

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ module json_module
2222
! JSON-FORTRAN: A Fortran 2008 JSON API
2323
!
2424
! http://github.com/jacobwilliams/json-fortran
25-
!
25+
!
2626
! Copyright (c) 2014, Jacob Williams
2727
!
2828
! All rights reserved.
29-
!
29+
!
3030
! Redistribution and use in source and binary forms, with or without modification,
3131
! are permitted provided that the following conditions are met:
3232
! * Redistributions of source code must retain the above copyright notice, this
33-
! list of conditions and the following disclaimer.
33+
! list of conditions and the following disclaimer.
3434
! * Redistributions in binary form must reproduce the above copyright notice, this
3535
! list of conditions and the following disclaimer in the documentation and/or
3636
! other materials provided with the distribution.
@@ -50,18 +50,18 @@ module json_module
5050
! Original FSON License:
5151
!
5252
! http://github.com/josephalevin/fson
53-
!
53+
!
5454
! Copyright (c) 2012 Joseph A. Levin
55-
!
55+
!
5656
! Permission is hereby granted, free of charge, to any person obtaining a copy of this
5757
! software and associated documentation files (the "Software"), to deal in the Software
5858
! without restriction, including without limitation the rights to use, copy, modify, merge,
5959
! publish, distribute, sublicense, and/or sell copies of the Software, and to permit
6060
! persons to whom the Software is furnished to do so, subject to the following conditions:
61-
!
61+
!
6262
! The above copyright notice and this permission notice shall be included in all copies or
6363
! substantial portions of the Software.
64-
!
64+
!
6565
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
6666
! INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
6767
! PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
@@ -528,7 +528,7 @@ end subroutine array_callback_func
528528
! end subroutine example1
529529
!
530530
! Note: it should NOT be called for a json_value pointer than has already been
531-
! added to another json_value structure, since doing so may render the
531+
! added to another json_value structure, since doing so may render the
532532
! other structure invalid. Consider the following example:
533533
! subroutine example2(p)
534534
! type(json_value),pointer,intent(out) :: p
@@ -538,7 +538,7 @@ end subroutine array_callback_func
538538
! call json_create_object(q,'q')
539539
! call json_add(q,'val',1)
540540
! call json_add(p, q) !add q to p structure
541-
! ! do NOT call json_destroy(q) here, because q is
541+
! ! do NOT call json_destroy(q) here, because q is
542542
! ! now part of the output structure p. p should be destroyed
543543
! ! somewhere upstream by the caller of this routine.
544544
! nullify(q) !OK, but not strictly necessary
@@ -1566,7 +1566,7 @@ end subroutine json_value_create
15661566
!
15671567
! AUTHOR
15681568
! Jacob Williams : 1/22/2014 : The original version of this
1569-
! routine was not properly freeing the memory.
1569+
! routine was not properly freeing the memory.
15701570
! It has been rewritten.
15711571
!
15721572
! SOURCE
@@ -4088,7 +4088,7 @@ end subroutine json_get_array
40884088
!
40894089
! INPUTS
40904090
! The inputs can be:
4091-
! * file and unit : the specified unit is used to read JSON from file.
4091+
! * file and unit : the specified unit is used to read JSON from file.
40924092
! [note if unit is already open, then the filename is ignored]
40934093
! * file : JSON is read from file using internal unit number
40944094
! * str : JSON data is read from the string instead
@@ -5541,7 +5541,7 @@ end subroutine real_to_string
55415541
! compact_real_string
55425542
!
55435543
! DESCRIPTION
5544-
! Compact a string representing a real number, so that
5544+
! Compact a string representing a real number, so that
55455545
! the same value is displayed with fewer characters.
55465546
!
55475547
! SEE ALSO
@@ -5714,4 +5714,4 @@ end subroutine json_print_error_message
57145714

57155715
!*****************************************************************************************
57165716
end module json_module
5717-
!*****************************************************************************************
5717+
!*****************************************************************************************

src/tests/jf_test_9.f90

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,17 @@ module jf_test_9_mod
4848
use, intrinsic :: iso_fortran_env , only: error_unit, output_unit, wp => real64
4949

5050
implicit none
51+
!small file - 0.0 sec : http://www.json-generator.com
52+
!character(len=*),parameter :: filename = 'random1.json'
5153

52-
!character(len=*),parameter :: filename = 'random1.json' !small file - 0.0 sec : http://www.json-generator.com
53-
character(len=*),parameter :: filename = 'big.json' !7 MB - 5.4 sec : http://www.json-generator.com
54-
!character(len=*),parameter :: filename = 'AllSets.json' !13 MB - 7.6 sec : http://mtgjson.com
55-
!character(len=*),parameter :: filename = '100mb.json' !100 MB - takes forever... : https://github.com/seductiveapps/largeJSON
54+
!7 MB - 5.4 sec : http://www.json-generator.com
55+
character(len=*),parameter :: filename = 'big.json'
56+
57+
!13 MB - 7.6 sec : http://mtgjson.com
58+
!character(len=*),parameter :: filename = 'AllSets.json'
59+
60+
!100 MB - takes forever... : https://github.com/seductiveapps/largeJSON
61+
!character(len=*),parameter :: filename = '100mb.json'
5662

5763
character(len=*),parameter :: dir = '../files/' !working directory
5864

@@ -115,4 +121,4 @@ program jf_test_9
115121
if (n_errors /= 0) stop 1
116122
end program jf_test_9
117123

118-
!*******************************************************************************************************
124+
!*******************************************************************************************************

0 commit comments

Comments
 (0)