From 9c63005c8f91877f8eae2e5bfe6b5f5ba2bec0d4 Mon Sep 17 00:00:00 2001 From: Franz Roters Date: Thu, 18 Feb 2010 08:29:57 +0000 Subject: [PATCH] allow for longer pathes when openening files corrected error messages concerning file openening --- code/FEsolving.f90 | 2 +- code/IO.f90 | 12 ++++++++---- code/lattice.f90 | 2 +- code/material.f90 | 2 +- code/mesh.f90 | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/code/FEsolving.f90 b/code/FEsolving.f90 index 86b995b37..6dd30548d 100644 --- a/code/FEsolving.f90 +++ b/code/FEsolving.f90 @@ -52,7 +52,7 @@ endif enddo else - call IO_error(100) ! cannot open input file + call IO_error(101) ! cannot open input file endif 100 close(fileunit) diff --git a/code/IO.f90 b/code/IO.f90 index 23699c898..02863b77d 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -52,8 +52,9 @@ endsubroutine character(len=*), parameter :: pathSep = achar(47)//achar(92) ! /, \ character(len=*) relPath integer(pInt) unit - character(256) path + character(1024) path + path='' inquire(6, name=path) ! determine outputfile open(unit,status='old',err=100,file=path(1:scan(path,pathSep,back=.true.))//relPath) IO_open_file = .true. @@ -75,9 +76,10 @@ endsubroutine integer(pInt), intent(in) :: unit integer(pInt) extPos - character(256) outName + character(1024) outName character(3) ext + outName='' inquire(6, name=outName) ! determine outputfileName extPos = len_trim(outName)-2 ! if(outName(extPos:extPos+2)=='out') then @@ -788,7 +790,7 @@ endfunction use prec, only: pReal,pInt implicit none - integer(pInt) unit,i,j,l,count + integer(pInt) unit,l,count integer(pInt) IO_countContinousIntValues integer(pInt), parameter :: maxNchunks = 64 integer(pInt), dimension(1+2*maxNchunks) :: pos @@ -948,7 +950,9 @@ endfunction case (50) msg = 'Error writing constitutive output description' case (100) - msg = 'Error reading from configuration file' + msg = 'Cannot open config file' + case (101) + msg = 'Cannot open input file' case (105) msg = 'Error reading from ODF file' case (110) diff --git a/code/lattice.f90 b/code/lattice.f90 index 9cf0d0e7d..b15f9826a 100644 --- a/code/lattice.f90 +++ b/code/lattice.f90 @@ -675,7 +675,7 @@ subroutine lattice_init() write(6,*) '$Id$' 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) 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 diff --git a/code/material.f90 b/code/material.f90 index db2b82be4..36a0d4fca 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -81,7 +81,7 @@ subroutine material_init() write(6,*) '$Id$' 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_parseMicrostructure(fileunit,material_partMicrostructure) call material_parseTexture(fileunit,material_partTexture) diff --git a/code/mesh.f90 b/code/mesh.f90 index 17bbdb9d7..97d4080fb 100644 --- a/code/mesh.f90 +++ b/code/mesh.f90 @@ -242,7 +242,7 @@ parallelExecution = (mesh_Nelems == mesh_NcpElems) ! plus potential killer from non-local constitutive else - call IO_error(100) ! cannot open input file + call IO_error(101) ! cannot open input file endif FEsolving_execElem = (/1,mesh_NcpElems/)