Skip to content

Commit

Permalink
stat: initialize common block. (#148)
Browse files Browse the repository at this point in the history
* stat: initialize common block.

* Move debug_init.f90/stat_init.f90 to dbgini.f/staini.f.

In cases where one has 2 fortran compilers (F77+F90), the reference code
base and (missing) related common initialisations will be compiled
consistently by the same (F77) compiler. F90 will handle ICB (f2003-f2008)
that could not be compiled by F77.

Note: in F77, code starts at col 7, continuation line with & at col 6,
length line is limited, names must be smaller than 7 chars (no underscore).

* [BUG FIX] compile dbgini.f staini.f with AND without ICB.
fghoussen authored and sylvestre committed Sep 15, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3829c44 commit 78d7812
Showing 6 changed files with 42 additions and 20 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -174,13 +174,13 @@ endif()
# file(GLOB arpacklapack_STAT_SRCS lapack/*.f)
#endif()
#file(GLOB arpackutil_STAT_SRCS util/*.f)
file(GLOB arpacksrc_STAT_SRCS ${arpack_SOURCE_DIR}/SRC/*.f)
file(GLOB arpacksrc_STAT_SRCS dbgini.f staini.f ${arpack_SOURCE_DIR}/SRC/*.f)

set(arpacksrc_ICB "")
set(parpacksrc_ICB "")
if(ICB)
file(GLOB arpacksrc_ICB SRC/icba*.f90 debug_init.f90 debug_icb.f90 stat_icb.f90)
file(GLOB parpacksrc_ICB PARPACK/SRC/MPI/icbp*.f90 debug_init.f90 debug_icb.f90 stat_icb.f90)
file(GLOB arpacksrc_ICB SRC/icba*.f90 debug_icb.f90 stat_icb.f90)
file(GLOB parpacksrc_ICB PARPACK/SRC/MPI/icbp*.f90 debug_icb.f90 stat_icb.f90)
endif()

set(arpackutil_STAT_SRCS
@@ -202,7 +202,7 @@ set(arpackutil_STAT_SRCS

if (MPI)
file(GLOB parpackutil_STAT_SRCS PARPACK/UTIL/MPI/*.f)
file(GLOB parpacksrc_STAT_SRCS PARPACK/SRC/MPI/*.f)
file(GLOB parpacksrc_STAT_SRCS dbgini.f staini.f PARPACK/SRC/MPI/*.f)
endif()

# use -DBUILD_SHARED_LIBS=ON|OFF to control static/shared
5 changes: 3 additions & 2 deletions PARPACK/SRC/MPI/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug_init/icb.f90 are not in current directory.
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug/stat* are not in current directory.

F77 = $(MPIF77)
FFLAGS_SAV = @FFLAGS@
@@ -34,7 +34,8 @@ libparpack@LIBSUFFIX@_noopt_la_FFLAGS = -O0

lib_LTLIBRARIES = libparpack@LIBSUFFIX@.la
libparpack@LIBSUFFIX@_la_SOURCES = $(PSRC) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/debug_init.f90
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/dbgini.f
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/staini.f
if ICB
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/debug_icb.f90
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/stat_icb.f90
5 changes: 3 additions & 2 deletions SRC/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug_init/icb.f90 are not in current directory.
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug/stat* are not in current directory.

SSRC = snaitr.f snapps.f snaup2.f snaupd.f snconv.f sneigh.f sneupd.f sngets.f sstatn.f \
ssaitr.f ssapps.f ssaup2.f ssaupd.f ssconv.f sseigt.f sseupd.f ssgets.f sstats.f \
@@ -25,7 +25,8 @@ EXTRA_DIST = debug.h stat.h version.h

lib_LTLIBRARIES = libarpack@LIBSUFFIX@.la
libarpack@LIBSUFFIX@_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/debug_init.f90
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/dbgini.f
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/staini.f
if ICB
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/debug_icb.f90
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/stat_icb.f90
13 changes: 13 additions & 0 deletions dbgini.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
c Initialisation of the debug common block to "no debug".
block data dbgini
common /debug/ logfil, ndigit, mgetv0,
& msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
& mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
& mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
data logfil, ndigit, mgetv0,
& msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
& mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
& mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
& / 6, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
& 0, 0, 0, 0, 0, 0 /
end
12 changes: 0 additions & 12 deletions debug_init.f90

This file was deleted.

19 changes: 19 additions & 0 deletions staini.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
c Initialisation of the stat common block.
block data staini
common /timing/
& nopx, nbx, nrorth, nitref, nrstrt,
& tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv,
& tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv,
& tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv,
& tmvopx, tmvbx, tgetv0, titref, trvec
data nopx, nbx, nrorth, nitref, nrstrt,
& tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv,
& tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv,
& tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv,
& tmvopx, tmvbx, tgetv0, titref, trvec
& / 0, 0, 0, 0, 0,
& 0., 0., 0., 0., 0., 0., 0.,
& 0., 0., 0., 0., 0., 0., 0.,
& 0., 0., 0., 0., 0., 0., 0.,
& 0., 0., 0., 0., 0. /
end

0 comments on commit 78d7812

Please sign in to comment.