diff --git a/code/Makefile b/code/Makefile index 28cb30b54..7b4a95c0e 100644 --- a/code/Makefile +++ b/code/Makefile @@ -186,13 +186,10 @@ endif ################################################################################################### -COMPILE_OPTIONS_gfortran :=-xf95-cpp-input\ - -fno-range-check +COMPILE_OPTIONS_gfortran :=-xf95-cpp-input ifneq "$(FASTBUILD)" "YES" COMPILE_OPTIONS_gfortran :=$(COMPILE_OPTIONS_gfortran)\ - -xf95-cpp-input\ -ffree-line-length-132\ - -fno-range-check\ -fimplicit-none\ -pedantic\ -Warray-bounds\ @@ -348,8 +345,13 @@ IO.o: IO.f90 \ DAMASK_spectral_interface.o: DAMASK_spectral_interface.f90 \ prec.o - +ifeq "$(COMPILERNAME)" "gfortran" # fno-range-check because NaN is defined in prec prec.o: prec.f90 + $(PREFIX) $(COMPILERNAME) $(COMPILE) -c -fno-range-check prec.f90 $(SUFFIX) +else +prec.o: prec.f90 + $(PREFIX) $(COMPILERNAME) $(COMPILE) -c prec.f90 $(SUFFIX) +endif %.o : %.f90 $(PREFIX) $(COMPILERNAME) $(COMPILE) -c $< $(SUFFIX) diff --git a/code/prec.f90 b/code/prec.f90 index 465a27391..5dc299a3e 100644 --- a/code/prec.f90 +++ b/code/prec.f90 @@ -71,7 +71,7 @@ subroutine prec_init write(6,'(a,i3)') ' Bytes for pReal: ',pReal write(6,'(a,i3)') ' Bytes for pInt: ',pInt write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt - write(6,'(a,e10.3)') ' NaN: ',DAMASK_NaN + write(6,'(a,e10.3)') ' NaN: ', DAMASK_NaN write(6,'(a,l3)') ' NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN if (DAMASK_NaN == DAMASK_NaN) call quit(9000) write(6,*) diff --git a/code/prec_single.f90 b/code/prec_single.f90 index dd57b6237..5159326db 100644 --- a/code/prec_single.f90 +++ b/code/prec_single.f90 @@ -41,7 +41,7 @@ module prec ! from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html ! copy can be found in documentation/Code/Fortran #ifdef LEGACY_COMPILER - real(pReal), parameter, public :: DAMASK_NaN = Z'Z'7F800001', pReal' + real(pReal), parameter, public :: DAMASK_NaN = Z'7F800001' #else real(pReal), parameter, public :: DAMASK_NaN = real(Z'7F800001', pReal) #endif @@ -71,7 +71,7 @@ subroutine prec_init write(6,'(a,i3)') ' Bytes for pReal: ',pReal write(6,'(a,i3)') ' Bytes for pInt: ',pInt write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt - write(6,'(a,e10.3)') ' NaN: ',DAMASK_NAN + write(6,'(a,e10.3)') ' NaN: ', DAMASK_NaN write(6,'(a,l3)') ' NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN if (DAMASK_NaN == DAMASK_NaN) call quit(9000) write(6,*)