f_esmf_stategetfield Subroutine

subroutine f_esmf_stategetfield(state, fieldName, field, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_State) :: state
character(len=*) :: fieldName
type(ESMF_Field) :: field
integer, intent(out) :: rc

Source Code

   subroutine f_esmf_stategetfield(state, fieldName, field, rc)
#undef  ESMF_METHOD
#define ESMF_METHOD "f_esmf_stategetfield"

       use ESMF_UtilTypesMod
       use ESMF_LogErrMod
       use ESMF_BaseMod    ! ESMF base class
       use ESMF_StateMod
       use ESMF_FieldMod
       implicit none

       type(ESMF_State) :: state        !in
       character(len=*) :: fieldName    !in
       type(ESMF_Field) :: field        !out
       integer, intent(out) :: rc       !out

       integer :: localrc

       ! Initialize return code; assume routine not implemented
       rc = ESMF_RC_NOT_IMPL

       call ESMF_StateGet(state=state, itemName=fieldName, &
                               field=field, rc=localrc)
       if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU,  &
           ESMF_CONTEXT, rcToReturn=rc)) return

       rc = localrc

   end subroutine f_esmf_stategetfield