allow for longer pathes when openening files

corrected error messages concerning file openening
This commit is contained in:
Franz Roters 2010-02-18 08:29:57 +00:00
parent 97db70cf23
commit 9c63005c8f
5 changed files with 12 additions and 8 deletions

View File

@ -52,7 +52,7 @@
endif endif
enddo enddo
else else
call IO_error(100) ! cannot open input file call IO_error(101) ! cannot open input file
endif endif
100 close(fileunit) 100 close(fileunit)

View File

@ -52,8 +52,9 @@ endsubroutine
character(len=*), parameter :: pathSep = achar(47)//achar(92) ! /, \ character(len=*), parameter :: pathSep = achar(47)//achar(92) ! /, \
character(len=*) relPath character(len=*) relPath
integer(pInt) unit integer(pInt) unit
character(256) path character(1024) path
path=''
inquire(6, name=path) ! determine outputfile inquire(6, name=path) ! determine outputfile
open(unit,status='old',err=100,file=path(1:scan(path,pathSep,back=.true.))//relPath) open(unit,status='old',err=100,file=path(1:scan(path,pathSep,back=.true.))//relPath)
IO_open_file = .true. IO_open_file = .true.
@ -75,9 +76,10 @@ endsubroutine
integer(pInt), intent(in) :: unit integer(pInt), intent(in) :: unit
integer(pInt) extPos integer(pInt) extPos
character(256) outName character(1024) outName
character(3) ext character(3) ext
outName=''
inquire(6, name=outName) ! determine outputfileName inquire(6, name=outName) ! determine outputfileName
extPos = len_trim(outName)-2 extPos = len_trim(outName)-2
! if(outName(extPos:extPos+2)=='out') then ! if(outName(extPos:extPos+2)=='out') then
@ -788,7 +790,7 @@ endfunction
use prec, only: pReal,pInt use prec, only: pReal,pInt
implicit none implicit none
integer(pInt) unit,i,j,l,count integer(pInt) unit,l,count
integer(pInt) IO_countContinousIntValues integer(pInt) IO_countContinousIntValues
integer(pInt), parameter :: maxNchunks = 64 integer(pInt), parameter :: maxNchunks = 64
integer(pInt), dimension(1+2*maxNchunks) :: pos integer(pInt), dimension(1+2*maxNchunks) :: pos
@ -948,7 +950,9 @@ endfunction
case (50) case (50)
msg = 'Error writing constitutive output description' msg = 'Error writing constitutive output description'
case (100) case (100)
msg = 'Error reading from configuration file' msg = 'Cannot open config file'
case (101)
msg = 'Cannot open input file'
case (105) case (105)
msg = 'Error reading from ODF file' msg = 'Error reading from ODF file'
case (110) case (110)

View File

@ -675,7 +675,7 @@ subroutine lattice_init()
write(6,*) '$Id$' write(6,*) '$Id$'
write(6,*) write(6,*)
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file if(.not. IO_open_file(fileunit,material_configFile)) call IO_error(100) ! cannot open config file
Nsections = IO_countSections(fileunit,material_partPhase) Nsections = IO_countSections(fileunit,material_partPhase)
lattice_Nstructure = 2_pInt + sum(IO_countTagInPart(fileunit,material_partPhase,'covera_ratio',Nsections)) ! fcc + bcc + all hex lattice_Nstructure = 2_pInt + sum(IO_countTagInPart(fileunit,material_partPhase,'covera_ratio',Nsections)) ! fcc + bcc + all hex
! lattice_Nstructure = Nsections + 2_pInt ! most conservative assumption ! lattice_Nstructure = Nsections + 2_pInt ! most conservative assumption

View File

@ -81,7 +81,7 @@ subroutine material_init()
write(6,*) '$Id$' write(6,*) '$Id$'
write(6,*) write(6,*)
if(.not. IO_open_file(fileunit,material_configFile)) call IO_error (100) ! corrupt config file if(.not. IO_open_file(fileunit,material_configFile)) call IO_error(100) ! cannot open config file
call material_parseHomogenization(fileunit,material_partHomogenization) call material_parseHomogenization(fileunit,material_partHomogenization)
call material_parseMicrostructure(fileunit,material_partMicrostructure) call material_parseMicrostructure(fileunit,material_partMicrostructure)
call material_parseTexture(fileunit,material_partTexture) call material_parseTexture(fileunit,material_partTexture)

View File

@ -242,7 +242,7 @@
parallelExecution = (mesh_Nelems == mesh_NcpElems) ! plus potential killer from non-local constitutive parallelExecution = (mesh_Nelems == mesh_NcpElems) ! plus potential killer from non-local constitutive
else else
call IO_error(100) ! cannot open input file call IO_error(101) ! cannot open input file
endif endif
FEsolving_execElem = (/1,mesh_NcpElems/) FEsolving_execElem = (/1,mesh_NcpElems/)