Skip to content

Commit 3a1dda4

Browse files
committed
Fixed a small bug in src/json_module.f90
The abstract interface did not match the actual interface. Build rules using gfortran 4.9 (experimental) were added to the build script which is what led me to discover this bug. A very recent gfortran 4.9 is needed, mine was build from sources April 6, 2014.
1 parent 4656b32 commit 3a1dda4

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

build.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,28 @@
66
# Jacob Williams : 2/8/2014
77
#
88

9+
# Uncomment to debug
10+
#set -x
11+
912
SRCDIR='src/'
1013
BUILDDIR='lib/'
1114
BINDIR='bin/'
1215

16+
# Intel compiler
1317
FCOMPILER='ifort'
14-
FCOMPILERFLAGS='-O2'
15-
#FCOMPILERFLAGS='-check all -debug full'
18+
# The following warning might be triggered by ifort unless explicitly silenced:
19+
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
20+
# In the context of F2008 this is an erroneous warning.
21+
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
22+
FCOMPILERFLAGS='-O2 -warn -stand f08 -diag-disable 7601 -traceback'
23+
#FCOMPILERFLAGS='-warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
24+
# trailing space is significant
25+
FCMODULEPATHFLAG='-module '
26+
27+
# GFortran (must be >= 4.9)
28+
#FCOMPILER='/opt/local/bin/gfortran-mp-4.9'
29+
#FCOMPILERFLAGS='-O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
30+
#FCMODULEPATHFLAG='-J'
1631

1732
ARCHIVER='ar'
1833
ARCHIVERFLAGS='-cq'
@@ -32,8 +47,9 @@ mkdir -p $BUILDDIR
3247
mkdir -p $BINDIR
3348

3449
#build library:
35-
$FCOMPILER $FCOMPILERFLAGS -c $SRCDIR$MODCODE$FEXT -Fo$BUILDDIR -module $BUILDDIR
50+
$FCOMPILER $FCOMPILERFLAGS -c $SRCDIR$MODCODE$FEXT $FCMODULEPATHFLAG$BUILDDIR
51+
mv $MODCODE$OBJEXT $BUILDDIR
3652
$ARCHIVER $ARCHIVERFLAGS $BUILDDIR$LIBOUT$LIBEXT $BUILDDIR$MODCODE$OBJEXT
3753

3854
#build example:
39-
$FCOMPILER $FCOMPILERFLAGS -o $BINDIR$EXEOUT -module $BUILDDIR $SRCDIR$EXAMPLECODE$FEXT $BUILDDIR$LIBOUT$LIBEXT
55+
$FCOMPILER $FCOMPILERFLAGS -o $BINDIR$EXEOUT $FCMODULEPATHFLAG$BUILDDIR $SRCDIR$EXAMPLECODE$FEXT $BUILDDIR$LIBOUT$LIBEXT

src/json_module.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ module json_module
224224
subroutine array_callback_func(element, i, count)
225225
import :: json_value
226226
implicit none
227-
type(json_value), pointer :: element
227+
type(json_value), pointer,intent(in) :: element
228228
integer,intent(in) :: i !index
229229
integer,intent(in) :: count !size of array
230230
end subroutine array_callback_func

0 commit comments

Comments
 (0)