get_field Subroutine

public subroutine get_field(field, states, state_intent, unusable, field_name, substate_name, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Field), intent(out) :: field
type(MultiState), intent(in) :: states
character(len=*), intent(in) :: state_intent
class(KeywordEnforcer), intent(in), optional :: unusable
character(len=*), intent(in) :: field_name
character(len=*), intent(in), optional :: substate_name
integer, intent(out) :: rc

Calls

proc~~get_field~~CallsGraph proc~get_field get_field esmf_stateget esmf_stateget proc~get_field->esmf_stateget none~get_state~2 MultiState%get_state proc~get_field->none~get_state~2 none~get_state_by_esmf_intent MultiState%get_state_by_esmf_intent none~get_state~2->none~get_state_by_esmf_intent none~get_state_by_esmf_intent->none~get_state~2 proc~mapl_return MAPL_Return none~get_state_by_esmf_intent->proc~mapl_return proc~mapl_verify MAPL_Verify none~get_state_by_esmf_intent->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~get_field~~CalledByGraph proc~get_field get_field proc~test_child_outer_items_created test_child_outer_items_created proc~test_child_outer_items_created->proc~get_field

Source Code

   subroutine get_field(field, states, state_intent, unusable, field_name, substate_name, rc)
      type(ESMF_Field), intent(out) :: field
      type(MultiState), intent(in) :: states
      class(KeywordEnforcer), optional, intent(in) :: unusable
      character(*), intent(in) :: state_intent
      character(*), intent(in) :: field_name
      character(*), optional, intent(in) :: substate_name
      integer, intent(out) :: rc

      integer :: status
      type(ESMF_State) :: state, substate

      rc = +1
      call states%get_state(state, state_intent, rc=status)
      if (status /= 0) then
         rc = +2
         return
      end if

      if (present(substate_name)) then
         call ESMF_StateGet(state, substate_name, substate, rc=status)
         if (status /= 0) then
            rc = +3
            return
         end if
      else
         substate = state
      end if

      call ESMF_StateGet(substate, field_name, field, rc=status)
      if (status /= 0) then
         rc = 4
         return
      end if

      rc = 0
         
   end subroutine get_field