34 character(len=*),
intent(in) :: filename
35 integer(INT_KIND),
intent(out) :: funit
36 integer(INT_KIND),
intent(out) :: index_file
37 logical(INT_KIND),
intent(in) :: read_dist
39 type(domainug),
intent(in) :: domain
42 integer(INT_KIND) :: i
51 if (trim(files_read(i)%name) .eq. trim(filename))
then
53 funit = files_read(index_file)%unit
55 call mpp_error(fatal, &
56 "fms_io_unstructured_get_file_unit:" &
57 //
" the file "//trim(filename) &
58 //
" was previously opened, but is not" &
68 if (num_files_r .eq. max_files_r)
then
69 call mpp_error(fatal, &
70 "fms_io_unstructured_get_file_unit: the number of" &
71 //
" files currently open for reading exceeds" &
72 //
" max_files_r. Pleaes increase this value via" &
73 //
" the fms_io_nml namelist.")
77 num_files_r = num_files_r + 1
78 files_read(num_files_r)%name = trim(filename)
79 allocate(files_read(num_files_r)%var(max_fields))
80 files_read(num_files_r)%nvar = 0
81 index_file = num_files_r
85 call mpp_open(funit, &
89 threading=mpp_multi, &
93 call mpp_open(funit, &
97 threading=mpp_multi, &
102 files_read(index_file)%unit = funit
subroutine fms_io_unstructured_get_file_unit(filename, funit, index_file, read_dist, domain)
Return the file unit and index in the "files_read" module array for the inputted file....
logical function mpp_file_is_opened(unit)
return if certain file with unit is opened or not