18 character(LEN=*),
intent(in) :: dir_name
21 call system(
'mkdir "'//dir_name//
'" 2> NUL')
23 call system(
'mkdir -p "'//dir_name//
'"')
30 character(LEN=*),
intent(in) :: filepath
33 call system(
'del "'//filepath//
'"')
35 call system(
'rm "'//filepath//
'"')
42 character(LEN=*),
intent(in) :: dir_name
45 call system(
'rmdir "'//dir_name//
'" /s /q')
47 call system(
'rm -r "'//dir_name//
'"')
56 character(LEN=*),
intent(in) :: fileloc
57 logical,
intent(inout) :: dircheck
59#ifdef __INTEL_COMPILER
60 inquire (directory=trim(fileloc), exist=dircheck)
62 inquire (file=trim(fileloc), exist=dircheck)
69 character(LEN=*),
intent(out) :: cwd
76 character(LEN=*),
intent(in) :: dirpath
77 character(LEN=*),
intent(out) :: basename
80 character(len=30) :: tmpfilepath
82 write (tmpfilepath,
'(A,I0)')
'basename_', proc_rank
85 call system(
'for /F %i in ("'//trim(dirpath)//
'") do @echo %~ni > '//trim(tmpfilepath))
87 call system(
'basename "'//trim(dirpath)//
'" > '//trim(tmpfilepath))
90 open (newunit=iunit, file=trim(tmpfilepath), form=
'formatted', status=
'old')
91 read (iunit,
'(A)') basename
Platform-specific file and directory operations: create, delete, inquire, getcwd, and basename.
impure subroutine s_delete_file(filepath)
Deletes a file at the given path using a platform-specific system command.
impure subroutine s_get_basename(dirpath, basename)
Extracts the base filename from a directory path using the system basename command.
impure subroutine s_delete_directory(dir_name)
Recursively deletes a directory using a platform-specific system command.
impure subroutine s_get_cwd(cwd)
Retrieves the current working directory path via the GETCWD intrinsic.
impure subroutine my_inquire(fileloc, dircheck)
Inquires on the existence of a directory.
impure subroutine s_create_directory(dir_name)
Creates a directory and all its parents if it does not exist.
Broadcasts user inputs and decomposes the domain across MPI ranks for pre-processing.