49 result(does_file_exist)
52 character(len=*),
intent(in) :: orig_file
53 character(len=*),
intent(out) :: actual_file
54 logical(INT_KIND),
intent(out) :: read_dist
56 type(domainug),
intent(in) :: domain
57 logical(INT_KIND) :: does_file_exist
60 logical(INT_KIND) :: fexist
61 type(domainug),
pointer :: io_domain
62 integer(INT_KIND) :: io_tile_id
63 character(len=256) :: fname
64 character(len=512) :: actual_file_tmp
68 does_file_exist = .false.
73 if (index(orig_file,
".nc",back=.true.) .eq. 0)
then
74 inquire(file=trim(orig_file),exist=fexist)
76 actual_file = orig_file
77 does_file_exist = .true.
85 call get_mosaic_tile_file_ug(orig_file, &
88 inquire(file=trim(actual_file),exist=fexist)
90 does_file_exist = .true.
97 io_domain => mpp_get_ug_io_domain(domain)
100 io_tile_id = mpp_get_ug_domain_tile_id(io_domain)
107 write(fname,
'(a,i4.4)') trim(actual_file)//
'.',io_tile_id
108 inquire(file=trim(fname),exist=fexist)
109 if (.not. fexist)
then
110 write(fname,
'(a,i6.6)') trim(actual_file)//
'.',io_tile_id
111 inquire(file=trim(fname),exist=fexist)
115 does_file_exist = .true.
121 if (len_trim(filename_appendix) .gt. 0)
then
122 call get_instance_filename(orig_file, &
124 if (index(orig_file,
'.nc',back=.true.) .eq. 0)
then
125 inquire(file=trim(actual_file),exist=fexist)
127 does_file_exist = .true.
134 actual_file_tmp = actual_file
135 call get_mosaic_tile_file_ug(actual_file_tmp, &
138 inquire(file=trim(actual_file),exist=fexist)
140 does_file_exist = .true.
146 io_domain => mpp_get_ug_io_domain(domain)
149 io_tile_id = mpp_get_ug_domain_tile_id(io_domain)
155 write(fname,
'(a,i4.4)') trim(actual_file)//
'.',io_tile_id
156 inquire(file=trim(fname),exist=fexist)
157 if (.not. fexist)
then
158 write(fname,
'(a,i6.6)') trim(actual_file)//
'.',io_tile_id
159 inquire(file=trim(fname),exist=fexist)
163 does_file_exist = .true.
logical(int_kind) function fms_io_unstructured_get_file_name(orig_file, actual_file, read_dist, domain)
For an inputted file name, check if it or any of its variants exist. For a file named "foo",...