Merge branch 'use-IO-in-CLI' into 'development'

Use IO in CLI

See merge request damask/DAMASK!798
This commit is contained in:
Philip Eisenlohr 2023-08-11 13:30:19 +00:00
commit c93309ed06
2 changed files with 5 additions and 1 deletions

View File

@ -178,7 +178,7 @@ subroutine CLI_init()
case ('-r', '--rs', '--restart') case ('-r', '--rs', '--restart')
if (.not. hasArg) call IO_error(610,ext_msg='--jobname') if (.not. hasArg) call IO_error(610,ext_msg='--jobname')
arg = getArg(i+1) arg = getArg(i+1)
read(arg,*,iostat=stat) CLI_restartInc CLI_restartInc = IO_strAsInt(arg)
if (CLI_restartInc < 0 .or. stat /= 0) call IO_error(611,ext_msg=arg) if (CLI_restartInc < 0 .or. stat /= 0) call IO_error(611,ext_msg=arg)
end select end select
end do end do

View File

@ -6,6 +6,7 @@
!> @author Philip Eisenlohr, Michigan State University !> @author Philip Eisenlohr, Michigan State University
!-------------------------------------------------------------------------------------------------- !--------------------------------------------------------------------------------------------------
module HDF5_utilities module HDF5_utilities
use IO
use HDF5 use HDF5
#ifdef PETSC #ifdef PETSC
#include <petsc/finclude/petscsys.h> #include <petsc/finclude/petscsys.h>
@ -190,6 +191,7 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel)
character :: m character :: m
integer(HID_T) :: plist_id integer(HID_T) :: plist_id
integer :: hdferr integer :: hdferr
logical :: exist
m = misc_optional(mode,'r') m = misc_optional(mode,'r')
@ -214,6 +216,8 @@ integer(HID_T) function HDF5_openFile(fileName,mode,parallel)
call H5Fopen_f(fileName,H5F_ACC_RDWR_F,HDF5_openFile,hdferr,access_prp = plist_id) call H5Fopen_f(fileName,H5F_ACC_RDWR_F,HDF5_openFile,hdferr,access_prp = plist_id)
call HDF5_chkerr(hdferr) call HDF5_chkerr(hdferr)
elseif (m == 'r') then elseif (m == 'r') then
inquire(file=fileName,exist=exist)
if (.not. exist) call IO_error(100,trim(fileName))
call H5Fopen_f(fileName,H5F_ACC_RDONLY_F,HDF5_openFile,hdferr,access_prp = plist_id) call H5Fopen_f(fileName,H5F_ACC_RDONLY_F,HDF5_openFile,hdferr,access_prp = plist_id)
call HDF5_chkerr(hdferr) call HDF5_chkerr(hdferr)
else else