removed (in IO.f90) a dangerous initialization statement.

Please read http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#4
for more details.

Other files are just a little bit polished
This commit is contained in:
Martin Diehl 2012-03-07 10:07:29 +00:00
parent d00c3c9e19
commit 2a7888c7e1
3 changed files with 361 additions and 362 deletions

View File

@ -546,7 +546,7 @@ integer(pInt) function IO_countSections(myFile,part)
integer(pInt), intent(in) :: myFile
character(len=*), intent(in) :: part
character(len=1024) :: line = ''
character(len=1024) :: line
IO_countSections = 0_pInt
rewind(myFile)
@ -583,12 +583,13 @@ function IO_countTagInPart(myFile,part,myTag,Nsections)
integer(pInt), dimension(Nsections) :: counter
integer(pInt), dimension(1+2*maxNchunks) :: positions
integer(pInt) :: section = 0_pInt
character(len=1024) :: line ='', &
integer(pInt) :: section
character(len=1024) :: line, &
tag
rewind(myFile)
counter = 0_pInt
section = 0_pInt
do while (IO_getTag(line,'<','>') /= part) ! search for part
read(myFile,'(a1024)',END=100) line
@ -635,7 +636,6 @@ function IO_spotTagInPart(myFile,part,myTag,Nsections)
IO_spotTagInPart = .false. ! assume to nowhere spot tag
section = 0_pInt
line = ''
rewind(myFile)
do while (IO_getTag(line,'<','>') /= part) ! search for part
@ -851,7 +851,6 @@ pure function IO_lc(line)
implicit none
character(len=*), intent(in) :: line
character(len=len(line)) :: IO_lc
integer :: i ! no pInt (len returns default integer)
@ -871,8 +870,8 @@ subroutine IO_lcInplace(line)
implicit none
character(len=*), intent(inout) :: line
character(len=len(line)) :: IO_lc
integer :: i ! no pInt (len returns default integer)
IO_lc = line
@ -892,6 +891,7 @@ subroutine IO_skipChunks(myUnit,N)
implicit none
integer(pInt), intent(in) :: myUnit, &
N
integer(pInt), parameter :: maxNchunks = 64_pInt
integer(pInt) :: remainingChunks
@ -1444,6 +1444,7 @@ recursive function abaqus_assembleInputFile(unit1,unit2) result(createSuccess)
unit2
integer(pInt), parameter :: maxNchunks = 6_pInt
integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=300) :: line,fname
logical :: createSuccess,fexist

View File

@ -1299,8 +1299,10 @@ function kdtree2_r_count_around_point(tp,idxin,correltime,r2) result(nfound)
!
implicit none
type (kdtree2), pointer :: tp
integer(pInt), intent (In) :: correltime, idxin
real(pReal), intent(in) :: r2
integer(pInt) :: nfound
! ..
! ..
@ -1711,8 +1713,8 @@ subroutine kdtree2_n_nearest_brute_force(tp,qv,nn,results)
! does.
implicit none
type (kdtree2), pointer :: tp
real(pReal), intent (In) :: qv(:)
integer(pInt), intent (In) :: nn
real(pReal), intent(in) :: qv(:)
integer(pInt), intent(in) :: nn
type(kdtree2_result) :: results(:)
integer(pInt) :: i, j, k
@ -1752,8 +1754,8 @@ subroutine kdtree2_r_nearest_brute_force(tp,qv,r2,nfound,results)
! does.
implicit none
type (kdtree2), pointer :: tp
real(pReal), intent (In) :: qv(:)
real(pReal), intent (In) :: r2
real(pReal), intent(in) :: qv(:)
real(pReal), intent(in) :: r2
integer(pInt), intent(out) :: nfound
type(kdtree2_result) :: results(:)

View File

@ -19,14 +19,15 @@
!##############################################################
!* $Id$
!##############################################################
MODULE numerics
module numerics
!##############################################################
use prec, only: pInt, pReal
use IO, only: IO_warning
implicit none
character(len=64), parameter :: numerics_configFile = 'numerics.config' ! name of configuration file
implicit none
character(len=64), parameter, private ::&
numerics_configFile = 'numerics.config' ! name of configuration file
integer(pInt) :: iJacoStiffness = 1_pInt, & ! frequency of stiffness update
iJacoLpresiduum = 1_pInt, & ! frequency of Jacobian update of residuum in Lp
nHomog = 20_pInt, & ! homogenization loop limit (only for debugging info, loop limit is determined by "subStepMinHomog")
@ -94,12 +95,9 @@ CONTAINS
!*******************************************
! initialization subroutine
!*******************************************
subroutine numerics_init()
subroutine numerics_init
use, intrinsic :: iso_fortran_env ! to get compiler_version and compiler_options (at least for gfortran 4.6 at the moment)
!*** variables and functions from other modules ***!
use prec, only: pInt, &
pReal
use IO, only: IO_error, &
IO_open_file_stat, &
IO_isBlank, &
@ -107,20 +105,17 @@ subroutine numerics_init()
IO_stringValue, &
IO_lc, &
IO_floatValue, &
IO_intValue
IO_intValue, &
IO_warning
!$ use OMP_LIB ! the openMP function library
implicit none
!*** local variables ***!
integer(pInt), parameter :: fileunit = 300_pInt
integer(pInt), parameter :: maxNchunks = 2_pInt
integer(pInt), parameter :: fileunit = 300_pInt ,&
maxNchunks = 2_pInt
!$ integer :: gotDAMASK_NUM_THREADS = 1
integer(pInt), dimension(1+2*maxNchunks) :: positions
character(len=64) :: tag
character(len=1024) :: line
! OpenMP variable
!$ character(len=6) DAMASK_NumThreadsString !environment variable DAMASK_NUM_THREADS
!$OMP CRITICAL (write2out)
@ -425,6 +420,7 @@ subroutine numerics_init()
write(6,'(a)') ' Random is random!'
!$OMP END CRITICAL (write2out)
endif
endsubroutine
END MODULE numerics
end subroutine numerics_init
end module numerics