Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_HConfig), | intent(in) | :: | expectations | |||
type(ESMF_State), | intent(inout) | :: | state | |||
character(len=*), | intent(in) | :: | short_name | |||
character(len=*), | intent(in) | :: | description | |||
integer, | intent(out) | :: | rc |
subroutine check_field_status(expectations, state, short_name, description, rc) type(ESMF_HConfig), intent(in) :: expectations type(ESMF_State), intent(inout) :: state character(*), intent(in) :: short_name character(*), intent(in) :: description integer, intent(out) :: rc character(len=:), allocatable :: expected_field_status_str type(ESMF_FieldStatus_Flag) :: expected_field_status type(ESMF_FieldStatus_Flag) :: found_field_status type(ESMF_StateItem_Flag) :: itemtype type(ESMF_Field) :: field integer :: status character(len=:), allocatable :: msg msg = short_name // ':: '// description call ESMF_StateGet(state, short_name, itemtype=itemtype, _RC) if (itemtype /= ESMF_STATEITEM_FIELD) then rc = 0 return end if expected_field_status_str = ESMF_HConfigAsString(expectations,keyString='status',_RC) expected_field_status = ESMF_FIELDSTATUS_GRIDSET select case (expected_field_status_str) case ('complete') expected_field_status = ESMF_FIELDSTATUS_COMPLETE case ('gridset') expected_field_status = ESMF_FIELDSTATUS_GRIDSET case ('empty') expected_field_status = ESMF_FIELDSTATUS_EMPTY case default _VERIFY(-1) end select call ESMF_StateGet(state, short_name, field, _RC) call ESMF_FieldGet(field, status=found_field_status, _RC) @assert_that(msg // ' field status: ',expected_field_status == found_field_status, is(true())) rc = 0 end subroutine check_field_status