From e62c5fdc0583acc3ccbfd3668d83c3783e980cb8 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 15 May 2014 09:40:43 +0000 Subject: [PATCH] added consistency check in material.f90: Microstructure index in geometry must not exceed number of sections in material.config better error messages in case of recursive file input in IO.f90. also supports absolute path now --- code/IO.f90 | 8 ++++++-- code/material.f90 | 5 ++++- code/numerics.f90 | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/code/IO.f90 b/code/IO.f90 index 8f59390a4..414c75464 100644 --- a/code/IO.f90 +++ b/code/IO.f90 @@ -160,10 +160,14 @@ recursive function IO_read(fileUnit,reset) result(line) inquire(UNIT=unitOn(stack),NAME=path) ! path of current file stack = stack+1_pInt - pathOn(stack) = path(1:scan(path,SEP,.true.))//input ! glue include to current file's dir + if(scan(input,SEP) == 1) then ! absolut path given (UNIX only) + pathOn(stack) = input + else + pathOn(stack) = path(1:scan(path,SEP,.true.))//input ! glue include to current file's dir + endif open(newunit=unitOn(stack),iostat=myStat,file=pathOn(stack)) ! open included file - if (myStat /= 0_pInt) call IO_error(100_pInt,ext_msg=path) + if (myStat /= 0_pInt) call IO_error(100_pInt,ext_msg=pathOn(stack)) line = IO_read(fileUnit) diff --git a/code/material.f90 b/code/material.f90 index e8e2bd9e3..6c5a948f6 100644 --- a/code/material.f90 +++ b/code/material.f90 @@ -202,7 +202,7 @@ subroutine material_init write(6,'(/,a)') ' <<<+- material init -+>>>' write(6,'(a)') ' $Id$' - write(6,'(a16,a)') ' Current time : ',IO_timeStamp() + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" if (.not. IO_open_jobFile_stat(FILEUNIT,material_localFileExt)) & ! no local material configuration present... @@ -393,6 +393,9 @@ subroutine material_parseMicrostructure(fileUnit,myPart) allocate(microstructure_active(Nsections), source=.false.) allocate(microstructure_elemhomo(Nsections), source=.false.) + if(any(mesh_element(4,1:mesh_NcpElems) > Nsections)) & + call IO_error(155_pInt,ext_msg='Microstructure in geometry > Sections in material.config') + forall (e = 1_pInt:mesh_NcpElems) microstructure_active(mesh_element(4,e)) = .true. ! current microstructure used in model? Elementwise view, maximum N operations for N elements microstructure_Nconstituents = IO_countTagInPart(fileUnit,myPart,'(constituent)',Nsections) diff --git a/code/numerics.f90 b/code/numerics.f90 index 376e42cba..c92c9f221 100644 --- a/code/numerics.f90 +++ b/code/numerics.f90 @@ -141,7 +141,7 @@ subroutine numerics_init write(6,'(/,a)') ' <<<+- numerics init -+>>>' write(6,'(a)') ' $Id$' - write(6,'(a16,a)') ' Current time : ',IO_timeStamp() + write(6,'(a15,a)') ' Current time: ',IO_timeStamp() #include "compilation_info.f90" !$ call GET_ENVIRONMENT_VARIABLE(NAME='DAMASK_NUM_THREADS',VALUE=DAMASK_NumThreadsString,STATUS=gotDAMASK_NUM_THREADS) ! get environment variable DAMASK_NUM_THREADS...