Host-side fail-loud gate over the device-supported variant
set. Device point routines (!$acc routine seq) cannot
error stop, so membership in the device-callable set is
guaranteed HERE at configure time; the device else branch
is then unreachable-by-contract.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(eos_t), | intent(in) | :: | eos | |||
| integer, | intent(out), | optional | :: | ierr |
|
subroutine eos_validate(eos, ierr) !! Host-side fail-loud gate over the device-supported variant !! set. Device point routines (`!$acc routine seq`) cannot !! `error stop`, so membership in the device-callable set is !! guaranteed HERE at configure time; the device `else` branch !! is then unreachable-by-contract. use rdb_ocean_status, only: OCEAN_STATUS_ERR_SETUP, OCEAN_STATUS_OK use rdb_error_ring, only: fail type(eos_t), intent(in) :: eos integer, intent(out), optional :: ierr !! `OCEAN_STATUS_ERR_SETUP` on an unsupported/unknown EOS variant !! when present; absent behaves as today (`error stop`). select case (eos%variant) case (EOS_VARIANT_LINEAR, EOS_VARIANT_WRIGHT_97, EOS_VARIANT_ROQUET_SPV) ! Device-callable — OK. case (EOS_VARIANT_TEOS10) call fail("ocean_eos: TEOS-10 variant is not yet device-callable", ierr, & OCEAN_STATUS_ERR_SETUP) return case default call fail("ocean_eos: unknown eos%variant", ierr, OCEAN_STATUS_ERR_SETUP) return end select if (present(ierr)) ierr = OCEAN_STATUS_OK end subroutine eos_validate