Return index of first registered name in names, or 0.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | names(:) |
Canonical field names, in order of preference. |
pure function first_field(names) result(f) !! Return index of first registered name in `names`, or 0. ! Arguments character(len=*), intent(in) :: names(:) !! Canonical field names, in order of preference. integer(int32) :: f, i, k f = 0 if (.not. allocated(field_names)) return do i = 1, size(names) do k = 1, nfields if (trim(field_names(k)) == trim(names(i))) then f = k return end if end do end do end function first_field