From 1648a7878a8f6af20dfab95110ae4fa287b76aaf Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Wed, 15 Dec 2021 02:30:53 +0100 Subject: [PATCH] src/gray_params.f90: handle file not found error --- src/gray_params.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gray_params.f90 b/src/gray_params.f90 index 7413227..666a7bc 100644 --- a/src/gray_params.f90 +++ b/src/gray_params.f90 @@ -166,7 +166,7 @@ contains integer, intent(in), optional :: unit ! local variables - integer :: u + integer :: u, iostat if (present(unit)) then u=unit @@ -174,6 +174,10 @@ contains u = get_free_unit() end if open(u,file=filenm,status='old',action='read',iostat=iostat) + if (iostat>0) then + print'(a)', 'gray_params file not found!' + call EXIT(1) + end if ! Raytracing ! ========================================================================