Was tag actually present in the file the last time this
registry was passed to ocean_restart_read_local? .false.
before any read, and .false. for an unknown tag (a caller
typo is a silent cold-seed, not a crash — callers that care
should assert the tag exists via a successful register_*
first). See restart_entry_t%found’s docstring for why this is
not the same question as optional.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(restart_registry_t), | intent(in) | :: | this | |||
| character(len=*), | intent(in) | :: | tag |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i |
pure function registry_entry_found(this, tag) result(found) !! Was `tag` actually present in the file the last time this !! registry was passed to `ocean_restart_read_local`? `.false.` !! before any read, and `.false.` for an unknown tag (a caller !! typo is a silent cold-seed, not a crash — callers that care !! should assert the tag exists via a successful `register_*` !! first). See `restart_entry_t%found`'s docstring for why this is !! not the same question as `optional`. class(restart_registry_t), intent(in) :: this character(len=*), intent(in) :: tag logical :: found integer :: i found = .false. do i = 1, this%n if (trim(this%entries(i)%tag) == trim(tag)) then found = this%entries(i)%found return end if end do end function registry_entry_found