report errors to STDERR

This commit is contained in:
Martin Diehl 2023-01-23 11:45:03 +01:00
parent 68b583e4da
commit 210dd8b497
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@
!> everything is fine. Exit code 1 signals an error, message according to IO_error. !> everything is fine. Exit code 1 signals an error, message according to IO_error.
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
subroutine quit(stop_id) subroutine quit(stop_id)
use, intrinsic :: ISO_fortran_env, only: ERROR_UNIT
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
use PETScSys use PETScSys
#if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY) #if (PETSC_VERSION_MAJOR==3 && PETSC_VERSION_MINOR>14) && !defined(PETSC_HAVE_MPI_F90MODULE_VISIBILITY)
@ -27,9 +28,9 @@ subroutine quit(stop_id)
call h5open_f(err_HDF5) ! prevents error if not opened yet call h5open_f(err_HDF5) ! prevents error if not opened yet
if (err_HDF5 /= 0) write(6,'(a,i5)') ' Error in h5open_f ',err_HDF5 if (err_HDF5 /= 0) write(ERROR_UNIT,'(a,i5)') ' Error in h5open_f ',err_HDF5
call h5close_f(err_HDF5) call h5close_f(err_HDF5)
if (err_HDF5 /= 0) write(6,'(a,i5)') ' Error in h5close_f ',err_HDF5 if (err_HDF5 /= 0) write(ERROR_UNIT,'(a,i5)') ' Error in h5close_f ',err_HDF5
call PetscFinalize(err_PETSc) call PetscFinalize(err_PETSc)