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:
parent
d00c3c9e19
commit
2a7888c7e1
13
code/IO.f90
13
code/IO.f90
|
@ -546,7 +546,7 @@ integer(pInt) function IO_countSections(myFile,part)
|
||||||
integer(pInt), intent(in) :: myFile
|
integer(pInt), intent(in) :: myFile
|
||||||
character(len=*), intent(in) :: part
|
character(len=*), intent(in) :: part
|
||||||
|
|
||||||
character(len=1024) :: line = ''
|
character(len=1024) :: line
|
||||||
|
|
||||||
IO_countSections = 0_pInt
|
IO_countSections = 0_pInt
|
||||||
rewind(myFile)
|
rewind(myFile)
|
||||||
|
@ -583,12 +583,13 @@ function IO_countTagInPart(myFile,part,myTag,Nsections)
|
||||||
|
|
||||||
integer(pInt), dimension(Nsections) :: counter
|
integer(pInt), dimension(Nsections) :: counter
|
||||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||||
integer(pInt) :: section = 0_pInt
|
integer(pInt) :: section
|
||||||
character(len=1024) :: line ='', &
|
character(len=1024) :: line, &
|
||||||
tag
|
tag
|
||||||
|
|
||||||
rewind(myFile)
|
rewind(myFile)
|
||||||
counter = 0_pInt
|
counter = 0_pInt
|
||||||
|
section = 0_pInt
|
||||||
|
|
||||||
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
||||||
read(myFile,'(a1024)',END=100) line
|
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
|
IO_spotTagInPart = .false. ! assume to nowhere spot tag
|
||||||
section = 0_pInt
|
section = 0_pInt
|
||||||
line = ''
|
|
||||||
rewind(myFile)
|
rewind(myFile)
|
||||||
|
|
||||||
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
do while (IO_getTag(line,'<','>') /= part) ! search for part
|
||||||
|
@ -851,7 +851,6 @@ pure function IO_lc(line)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=*), intent(in) :: line
|
character(len=*), intent(in) :: line
|
||||||
|
|
||||||
character(len=len(line)) :: IO_lc
|
character(len=len(line)) :: IO_lc
|
||||||
|
|
||||||
integer :: i ! no pInt (len returns default integer)
|
integer :: i ! no pInt (len returns default integer)
|
||||||
|
@ -871,8 +870,8 @@ subroutine IO_lcInplace(line)
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
character(len=*), intent(inout) :: line
|
character(len=*), intent(inout) :: line
|
||||||
|
|
||||||
character(len=len(line)) :: IO_lc
|
character(len=len(line)) :: IO_lc
|
||||||
|
|
||||||
integer :: i ! no pInt (len returns default integer)
|
integer :: i ! no pInt (len returns default integer)
|
||||||
|
|
||||||
IO_lc = line
|
IO_lc = line
|
||||||
|
@ -892,6 +891,7 @@ subroutine IO_skipChunks(myUnit,N)
|
||||||
implicit none
|
implicit none
|
||||||
integer(pInt), intent(in) :: myUnit, &
|
integer(pInt), intent(in) :: myUnit, &
|
||||||
N
|
N
|
||||||
|
|
||||||
integer(pInt), parameter :: maxNchunks = 64_pInt
|
integer(pInt), parameter :: maxNchunks = 64_pInt
|
||||||
|
|
||||||
integer(pInt) :: remainingChunks
|
integer(pInt) :: remainingChunks
|
||||||
|
@ -1444,6 +1444,7 @@ recursive function abaqus_assembleInputFile(unit1,unit2) result(createSuccess)
|
||||||
unit2
|
unit2
|
||||||
|
|
||||||
integer(pInt), parameter :: maxNchunks = 6_pInt
|
integer(pInt), parameter :: maxNchunks = 6_pInt
|
||||||
|
|
||||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||||
character(len=300) :: line,fname
|
character(len=300) :: line,fname
|
||||||
logical :: createSuccess,fexist
|
logical :: createSuccess,fexist
|
||||||
|
|
|
@ -1299,8 +1299,10 @@ function kdtree2_r_count_around_point(tp,idxin,correltime,r2) result(nfound)
|
||||||
!
|
!
|
||||||
implicit none
|
implicit none
|
||||||
type (kdtree2), pointer :: tp
|
type (kdtree2), pointer :: tp
|
||||||
|
|
||||||
integer(pInt), intent (In) :: correltime, idxin
|
integer(pInt), intent (In) :: correltime, idxin
|
||||||
real(pReal), intent(in) :: r2
|
real(pReal), intent(in) :: r2
|
||||||
|
|
||||||
integer(pInt) :: nfound
|
integer(pInt) :: nfound
|
||||||
! ..
|
! ..
|
||||||
! ..
|
! ..
|
||||||
|
@ -1711,8 +1713,8 @@ subroutine kdtree2_n_nearest_brute_force(tp,qv,nn,results)
|
||||||
! does.
|
! does.
|
||||||
implicit none
|
implicit none
|
||||||
type (kdtree2), pointer :: tp
|
type (kdtree2), pointer :: tp
|
||||||
real(pReal), intent (In) :: qv(:)
|
real(pReal), intent(in) :: qv(:)
|
||||||
integer(pInt), intent (In) :: nn
|
integer(pInt), intent(in) :: nn
|
||||||
type(kdtree2_result) :: results(:)
|
type(kdtree2_result) :: results(:)
|
||||||
|
|
||||||
integer(pInt) :: i, j, k
|
integer(pInt) :: i, j, k
|
||||||
|
@ -1752,8 +1754,8 @@ subroutine kdtree2_r_nearest_brute_force(tp,qv,r2,nfound,results)
|
||||||
! does.
|
! does.
|
||||||
implicit none
|
implicit none
|
||||||
type (kdtree2), pointer :: tp
|
type (kdtree2), pointer :: tp
|
||||||
real(pReal), intent (In) :: qv(:)
|
real(pReal), intent(in) :: qv(:)
|
||||||
real(pReal), intent (In) :: r2
|
real(pReal), intent(in) :: r2
|
||||||
integer(pInt), intent(out) :: nfound
|
integer(pInt), intent(out) :: nfound
|
||||||
type(kdtree2_result) :: results(:)
|
type(kdtree2_result) :: results(:)
|
||||||
|
|
||||||
|
|
|
@ -19,14 +19,15 @@
|
||||||
!##############################################################
|
!##############################################################
|
||||||
!* $Id$
|
!* $Id$
|
||||||
!##############################################################
|
!##############################################################
|
||||||
MODULE numerics
|
module numerics
|
||||||
!##############################################################
|
!##############################################################
|
||||||
|
|
||||||
use prec, only: pInt, pReal
|
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
|
integer(pInt) :: iJacoStiffness = 1_pInt, & ! frequency of stiffness update
|
||||||
iJacoLpresiduum = 1_pInt, & ! frequency of Jacobian update of residuum in Lp
|
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")
|
nHomog = 20_pInt, & ! homogenization loop limit (only for debugging info, loop limit is determined by "subStepMinHomog")
|
||||||
|
@ -94,12 +95,9 @@ CONTAINS
|
||||||
!*******************************************
|
!*******************************************
|
||||||
! initialization subroutine
|
! 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)
|
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, &
|
use IO, only: IO_error, &
|
||||||
IO_open_file_stat, &
|
IO_open_file_stat, &
|
||||||
IO_isBlank, &
|
IO_isBlank, &
|
||||||
|
@ -107,20 +105,17 @@ subroutine numerics_init()
|
||||||
IO_stringValue, &
|
IO_stringValue, &
|
||||||
IO_lc, &
|
IO_lc, &
|
||||||
IO_floatValue, &
|
IO_floatValue, &
|
||||||
IO_intValue
|
IO_intValue, &
|
||||||
|
IO_warning
|
||||||
!$ use OMP_LIB ! the openMP function library
|
!$ use OMP_LIB ! the openMP function library
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
|
integer(pInt), parameter :: fileunit = 300_pInt ,&
|
||||||
!*** local variables ***!
|
maxNchunks = 2_pInt
|
||||||
integer(pInt), parameter :: fileunit = 300_pInt
|
|
||||||
integer(pInt), parameter :: maxNchunks = 2_pInt
|
|
||||||
!$ integer :: gotDAMASK_NUM_THREADS = 1
|
!$ integer :: gotDAMASK_NUM_THREADS = 1
|
||||||
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
integer(pInt), dimension(1+2*maxNchunks) :: positions
|
||||||
character(len=64) :: tag
|
character(len=64) :: tag
|
||||||
character(len=1024) :: line
|
character(len=1024) :: line
|
||||||
|
|
||||||
! OpenMP variable
|
|
||||||
!$ character(len=6) DAMASK_NumThreadsString !environment variable DAMASK_NUM_THREADS
|
!$ character(len=6) DAMASK_NumThreadsString !environment variable DAMASK_NUM_THREADS
|
||||||
|
|
||||||
!$OMP CRITICAL (write2out)
|
!$OMP CRITICAL (write2out)
|
||||||
|
@ -425,6 +420,7 @@ subroutine numerics_init()
|
||||||
write(6,'(a)') ' Random is random!'
|
write(6,'(a)') ' Random is random!'
|
||||||
!$OMP END CRITICAL (write2out)
|
!$OMP END CRITICAL (write2out)
|
||||||
endif
|
endif
|
||||||
endsubroutine
|
|
||||||
|
|
||||||
END MODULE numerics
|
end subroutine numerics_init
|
||||||
|
|
||||||
|
end module numerics
|
||||||
|
|
Loading…
Reference in New Issue