ESMF_FieldSet Subroutine

public subroutine ESMF_FieldSet(field, keywordEnforcer, name, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Field), intent(inout) :: field
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
character(len=*), intent(in), optional :: name
integer, intent(out), optional :: rc

Source Code

  subroutine ESMF_FieldSet(field, keywordEnforcer, name, rc)

!
! !ARGUMENTS:
    type(ESMF_Field),   intent(inout)         :: field
    type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
    character(len = *), intent(in),  optional :: name
    integer,            intent(out), optional :: rc
!
! !DESCRIPTION:
!     Sets adjustable settings in an {\tt ESMF\_Field} object. 
!
!     The arguments are:
!     \begin{description}
!     \item [field]
!       {\tt ESMF\_Field} object for which to set properties.
!     \item [{[name]}]
!       The Field name.
!     \item [{[rc]}]
!       Return code; equals {\tt ESMF\_SUCCESS} if there are no errors.
!     \end{description}
!
!EOP
!------------------------------------------------------------------------------
    integer                 :: localrc      ! local return code

    ! initialize return code; assume routine not implemented
    localrc = ESMF_RC_NOT_IMPL
    if (present(rc)) rc = ESMF_RC_NOT_IMPL
    
    ! Check init status of arguments
    ESMF_INIT_CHECK_DEEP(ESMF_FieldGetInit, field, rc)
    
    ! Set the name in Base object
    if (present(name)) then
      if (field%isNamedAlias) then
        field%name = trim(name)
      else
        call ESMF_SetName(field%ftypep%base, name=name, rc=localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, &
          ESMF_CONTEXT, rcToReturn=rc)) return
      endif
    endif

    ! return successfully
    if (present(rc)) rc = ESMF_SUCCESS

  end subroutine ESMF_FieldSet