corrected NaN in prec_single.f90 (was already silent but with typo), polished output and added switch in order to check range on all files except of prec.f90 (in which NaN is defined)

This commit is contained in:
Martin Diehl 2012-05-11 12:46:17 +00:00
parent 542768d712
commit 0d745adfa0
3 changed files with 10 additions and 8 deletions

View File

@ -186,13 +186,10 @@ endif
################################################################################################### ###################################################################################################
COMPILE_OPTIONS_gfortran :=-xf95-cpp-input\ COMPILE_OPTIONS_gfortran :=-xf95-cpp-input
-fno-range-check
ifneq "$(FASTBUILD)" "YES" ifneq "$(FASTBUILD)" "YES"
COMPILE_OPTIONS_gfortran :=$(COMPILE_OPTIONS_gfortran)\ COMPILE_OPTIONS_gfortran :=$(COMPILE_OPTIONS_gfortran)\
-xf95-cpp-input\
-ffree-line-length-132\ -ffree-line-length-132\
-fno-range-check\
-fimplicit-none\ -fimplicit-none\
-pedantic\ -pedantic\
-Warray-bounds\ -Warray-bounds\
@ -348,8 +345,13 @@ IO.o: IO.f90 \
DAMASK_spectral_interface.o: DAMASK_spectral_interface.f90 \ DAMASK_spectral_interface.o: DAMASK_spectral_interface.f90 \
prec.o prec.o
ifeq "$(COMPILERNAME)" "gfortran" # fno-range-check because NaN is defined in prec
prec.o: prec.f90 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 %.o : %.f90
$(PREFIX) $(COMPILERNAME) $(COMPILE) -c $< $(SUFFIX) $(PREFIX) $(COMPILERNAME) $(COMPILE) -c $< $(SUFFIX)

View File

@ -71,7 +71,7 @@ subroutine prec_init
write(6,'(a,i3)') ' Bytes for pReal: ',pReal write(6,'(a,i3)') ' Bytes for pReal: ',pReal
write(6,'(a,i3)') ' Bytes for pInt: ',pInt write(6,'(a,i3)') ' Bytes for pInt: ',pInt
write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt 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 write(6,'(a,l3)') ' NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN
if (DAMASK_NaN == DAMASK_NaN) call quit(9000) if (DAMASK_NaN == DAMASK_NaN) call quit(9000)
write(6,*) write(6,*)

View File

@ -41,7 +41,7 @@ module prec
! from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html ! from http://www.hpc.unimelb.edu.au/doc/f90lrm/dfum_035.html
! copy can be found in documentation/Code/Fortran ! copy can be found in documentation/Code/Fortran
#ifdef LEGACY_COMPILER #ifdef LEGACY_COMPILER
real(pReal), parameter, public :: DAMASK_NaN = Z'Z'7F800001', pReal' real(pReal), parameter, public :: DAMASK_NaN = Z'7F800001'
#else #else
real(pReal), parameter, public :: DAMASK_NaN = real(Z'7F800001', pReal) real(pReal), parameter, public :: DAMASK_NaN = real(Z'7F800001', pReal)
#endif #endif
@ -71,7 +71,7 @@ subroutine prec_init
write(6,'(a,i3)') ' Bytes for pReal: ',pReal write(6,'(a,i3)') ' Bytes for pReal: ',pReal
write(6,'(a,i3)') ' Bytes for pInt: ',pInt write(6,'(a,i3)') ' Bytes for pInt: ',pInt
write(6,'(a,i3)') ' Bytes for pLongInt: ',pLongInt 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 write(6,'(a,l3)') ' NaN /= NaN: ',DAMASK_NaN/=DAMASK_NaN
if (DAMASK_NaN == DAMASK_NaN) call quit(9000) if (DAMASK_NaN == DAMASK_NaN) call quit(9000)
write(6,*) write(6,*)