From 934ca56811597048b7d7260d565a0dc9fe49df82 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sat, 15 Sep 2018 14:54:56 +0200 Subject: [PATCH] clean exit if required files not found --- src/DAMASK_interface.f90 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/DAMASK_interface.f90 b/src/DAMASK_interface.f90 index 02a1ad1d8..473e9c935 100644 --- a/src/DAMASK_interface.f90 +++ b/src/DAMASK_interface.f90 @@ -284,11 +284,17 @@ character(len=1024) function getGeometryFile(geometryParameter) implicit none character(len=1024), intent(in) :: geometryParameter + logical :: file_exists getGeometryFile = trim(geometryParameter) if (scan(getGeometryFile,'/') /= 1) getGeometryFile = trim(getCWD())//'/'//trim(getGeometryFile) getGeometryFile = makeRelativePath(trim(getCWD()), getGeometryFile) + inquire(file=trim(getGeometryFile), exist=file_exists) + if (.not. file_exists) then + write(6,'(a)') ' Geometry file does not exists ('//trim(getGeometryFile)//')' + call quit(1_pInt) + endif end function getGeometryFile @@ -302,11 +308,18 @@ character(len=1024) function getLoadCaseFile(loadCaseParameter) implicit none character(len=1024), intent(in) :: loadCaseParameter + logical :: file_exists getLoadCaseFile = trim(loadCaseParameter) if (scan(getLoadCaseFile,'/') /= 1) getLoadCaseFile = trim(getCWD())//'/'//trim(getLoadCaseFile) getLoadCaseFile = makeRelativePath(trim(getCWD()), getLoadCaseFile) + inquire(file=trim(getLoadCaseFile), exist=file_exists) + if (.not. file_exists) then + write(6,'(a)') ' Geometry file does not exists ('//trim(getLoadCaseFile)//')' + call quit(1_pInt) + endif + end function getLoadCaseFile