Skip to content

Commit

Permalink
turned off force_ftz.c, which creates numerous portability issues, an…
Browse files Browse the repository at this point in the history
…d turned FIX_UNDERFLOW_PROBLEM to .false. by default (not needed any more on modern processors). Also added a comment in flags.guess about -Werror=no-unused-function
  • Loading branch information
komatits committed Aug 30, 2018
1 parent a2d23d2 commit 42abac6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions flags.guess
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ case $my_FC in
# GNU gfortran
#
# optimization report: "-fopt-info" or very verbose: "-fopt-info-all"
#
# with some versions of gfortran/gcc you make get errors about unused functions when compiling with the options below;
# if so, either change -Wunused to -Wunused -Werror=no-unused-function, or remove -Wunused, or remove -Werror
#
DEF_FFLAGS="-std=f2003 -fimplicit-none -frange-check -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow -ffpe-trap=invalid,zero,overflow -Wunused -Werror" # -mcmodel=medium
OPT_FFLAGS="-O3 -finline-functions"
DEBUG_FFLAGS="-g -O0 -ggdb -fbacktrace -fbounds-check"
Expand Down
6 changes: 3 additions & 3 deletions setup/constants.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@
!----------- do not modify anything below -------------
!------------------------------------------------------

! on some processors (e.g. some Intel chips) it is necessary to suppress underflows
! by using a small initial field instead of zero
logical, parameter :: FIX_UNDERFLOW_PROBLEM = .true.
!! DK DK August 2018: on modern processors this does not happen any more,
!! DK DK August 2018: and thus no need to purposely lose accuracy to avoid underflows; thus turning it off by default
logical, parameter :: FIX_UNDERFLOW_PROBLEM = .false. ! .true.

! some useful constants
double precision, parameter :: PI = 3.141592653589793d0
Expand Down
12 changes: 9 additions & 3 deletions src/shared/force_ftz.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
!=====================================================================
!========================================================================
!
! S p e c f e m 3 D V e r s i o n 3 . 0
! ---------------------------------------
Expand All @@ -17,14 +17,16 @@
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License along
! with this program; if not, write to the Free Software Foundation, Inc.,
! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
!
!=====================================================================
! The full text of the license is available in file "LICENSE".
!
!========================================================================
*/

/* Dimitri Komatitsch, University of Toulouse, May 2011: */
Expand Down Expand Up @@ -69,6 +71,10 @@
void
FC_FUNC_(force_ftz,FORCE_FTZ)()
{

// DK DK Aug 2018: not needed anymore these days, and we had numerous portability issues with this routine, thus turning it off
#undef FORCE_FTZ

#ifdef __GNUC__
#ifdef FORCE_FTZ
unsigned int x;
Expand Down
Binary file removed utils/combine_result_singals_to_one_hdf5/combine
Binary file not shown.
Binary file not shown.

0 comments on commit 42abac6

Please sign in to comment.