Go to the source code of this file.
|
subroutine | check_file (filename, err_out) |
| Checks if a file is present or not.
|
|
◆ check_file()
subroutine check_file |
( |
character*70 |
filename, |
|
|
integer*4 |
err_out |
|
) |
| |
Checks if a file is present or not.
- Author
- Ilario Mazzieri
- Date
- September, 2013
- Version
- 1.0
- Parameters
-
[in] | filename | name of the file |
[out] | err_out | 0 if filename exists, 101 if filename does not exist |
Definition at line 26 of file CHECK_FILE.f90.
27
28 character*70 :: filename
29
30 logical*4 :: f_ex
31
32 integer*4 :: err_out
33 integer*4 :: i,file_a,file_b
34
35 do i=1,70
36 if (filename(i:i).ne.' ') exit
37 enddo
38
39 file_a=i
40 do i=70,1,-1
41 if (filename(i:i).ne.' ') exit
42 enddo
43 file_b=i
44
45 f_ex=.false.
46 err_out=0
47 inquire (file=filename,exist=f_ex)
48 if (f_ex) then
49 continue
50 else
51 err_out = 101
52
53 endif
54
55 return
56