ESMFL_StateGetFieldArray Subroutine

public subroutine ESMFL_StateGetFieldArray(state, name, array, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_State), intent(in) :: state
character(len=*), intent(in) :: name
type(ESMF_Array), intent(out) :: array
integer, intent(out), optional :: rc

Calls

proc~~esmfl_stategetfieldarray~~CallsGraph proc~esmfl_stategetfieldarray ESMFL_StateGetFieldArray esmf_fieldget esmf_fieldget proc~esmfl_stategetfieldarray->esmf_fieldget esmf_stateget esmf_stateget proc~esmfl_stategetfieldarray->esmf_stateget proc~mapl_return MAPL_Return proc~esmfl_stategetfieldarray->proc~mapl_return proc~mapl_verify MAPL_Verify proc~esmfl_stategetfieldarray->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

Source Code

 subroutine ESMFL_StateGetFieldArray(state, NAME, ARRAY, RC)
   type(ESMF_State),  intent(IN)  :: state
   type(ESMF_Array),  intent(OUT) :: array
   character(len=*),   intent(IN) :: name
   integer, optional, intent(OUT) :: rc


   integer          :: status
   type(ESMF_Field) :: field
   type(ESMF_StateItem_Flag) :: itemType

   call ESMF_StateGet(state, name, itemType=itemType, rc=status)
   _VERIFY(STATUS)

   if (itemType /= ESMF_STATEITEM_FIELD) then
      if (present(RC)) then
         RC=STATUS
         return
      end if
   else
      call ESMF_StateGet(state, name, field, rc=status)
      _VERIFY(STATUS)

      call ESMF_FieldGet(field, Array=array, rc=status)
      _VERIFY(STATUS)
   end if

   _RETURN(ESMF_SUCCESS)
 end subroutine ESMFL_StateGetFieldArray