ESMF_AttributeGetAttPackFieldBundle Subroutine

private subroutine ESMF_AttributeGetAttPackFieldBundle(target, convention, purpose, keywordEnforcer, attpack, attnestflag, isPresent, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_FieldBundle), intent(in) :: target
character(len=*), intent(in) :: convention
character(len=*), intent(in) :: purpose
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
type(ESMF_AttPack), intent(inout), optional :: attpack
type(ESMF_AttNest_Flag), intent(in), optional :: attnestflag
logical, intent(out), optional :: isPresent
integer, intent(out), optional :: rc

Calls

proc~~esmf_attributegetattpackfieldbundle~~CallsGraph proc~esmf_attributegetattpackfieldbundle ESMF_AttributeGetAttPackFieldBundle esmf_fieldbundlegetinit esmf_fieldbundlegetinit proc~esmf_attributegetattpackfieldbundle->esmf_fieldbundlegetinit none~getinfo ESMF_InfoDescribe%GetInfo proc~esmf_attributegetattpackfieldbundle->none~getinfo proc~attpack_initialize ESMF_AttPack%attpack_initialize proc~esmf_attributegetattpackfieldbundle->proc~attpack_initialize proc~esmf_imerr ESMF_IMErr proc~esmf_attributegetattpackfieldbundle->proc~esmf_imerr proc~esmf_infodump ESMF_InfoDump proc~esmf_attributegetattpackfieldbundle->proc~esmf_infodump proc~esmf_infoispresent ESMF_InfoIsPresent proc~esmf_attributegetattpackfieldbundle->proc~esmf_infoispresent proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_attributegetattpackfieldbundle->proc~esmf_logfounderror proc~esmf_logwrite ESMF_LogWrite proc~esmf_attributegetattpackfieldbundle->proc~esmf_logwrite

Called by

proc~~esmf_attributegetattpackfieldbundle~~CalledByGraph proc~esmf_attributegetattpackfieldbundle ESMF_AttributeGetAttPackFieldBundle interface~esmf_attributegetattpack ESMF_AttributeGetAttPack interface~esmf_attributegetattpack->proc~esmf_attributegetattpackfieldbundle proc~checkcomponentattribute checkComponentAttribute proc~checkcomponentattribute->interface~esmf_attributegetattpack proc~checkcomponentmetadata checkComponentMetadata proc~checkcomponentmetadata->interface~esmf_attributegetattpack proc~checkfieldattribute checkFieldAttribute proc~checkfieldattribute->interface~esmf_attributegetattpack proc~checkfieldmetadata checkFieldMetadata proc~checkfieldmetadata->interface~esmf_attributegetattpack proc~checkstate checkState proc~checkstate->interface~esmf_attributegetattpack proc~checkstateattribute checkStateAttribute proc~checkstateattribute->interface~esmf_attributegetattpack proc~nuopc_checkcplcomponentattribute NUOPC_CheckCplComponentAttribute proc~nuopc_checkcplcomponentattribute->interface~esmf_attributegetattpack proc~nuopc_checkcplcomponentmetadata NUOPC_CheckCplComponentMetadata proc~nuopc_checkcplcomponentmetadata->interface~esmf_attributegetattpack proc~nuopc_checkfield NUOPC_CheckField proc~nuopc_checkfield->interface~esmf_attributegetattpack proc~nuopc_checkfieldattribute NUOPC_CheckFieldAttribute proc~nuopc_checkfieldattribute->interface~esmf_attributegetattpack proc~nuopc_checkgridcomponentattribute NUOPC_CheckGridComponentAttribute proc~nuopc_checkgridcomponentattribute->interface~esmf_attributegetattpack proc~nuopc_checkgridcomponentmetadata NUOPC_CheckGridComponentMetadata proc~nuopc_checkgridcomponentmetadata->interface~esmf_attributegetattpack proc~nuopc_checkstate NUOPC_CheckState proc~nuopc_checkstate->interface~esmf_attributegetattpack proc~nuopc_checkstateattribute NUOPC_CheckStateAttribute proc~nuopc_checkstateattribute->interface~esmf_attributegetattpack proc~userm1_run userm1_run proc~userm1_run->interface~esmf_attributegetattpack proc~userm1_run~2 userm1_run proc~userm1_run~2->interface~esmf_attributegetattpack proc~userm1_run~4 userm1_run proc~userm1_run~4->interface~esmf_attributegetattpack proc~userm1_run~5 userm1_run proc~userm1_run~5->interface~esmf_attributegetattpack program~esmf_scompex ESMF_SCompEx program~esmf_scompex->interface~esmf_attributegetattpack

Source Code

subroutine ESMF_AttributeGetAttPackFieldBundle(target, convention, purpose, keywordEnforcer, attpack, attnestflag, isPresent, rc)
  ! 39.11.21
  type(ESMF_FieldBundle), intent(in) :: target
  character(len=*), intent(in) :: convention
  character(len=*), intent(in) :: purpose
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer ! must use keywords below
  type(ESMF_AttPack), intent(inout), optional :: attpack
  type(ESMF_AttNest_Flag), intent(in), optional :: attnestflag
  logical, intent(out), optional :: isPresent
  integer, intent(out), optional :: rc

  integer :: localrc
  character(:), allocatable :: key
  logical :: is_present
  type(ESMF_Info) :: info
  type(ESMF_InfoDescribe) :: eidesc
  type(ESMF_AttNest_Flag) :: local_attnestflag

  logical, parameter :: debug = .false.

  localrc = ESMF_FAILURE
  if (present(rc)) rc = ESMF_RC_NOT_IMPL
  ! Check object initialization
  ESMF_INIT_CHECK_DEEP(ESMF_FieldBundleGetInit, target, rc)

  if (present(attnestflag)) then
    local_attnestflag = attnestflag
  else
    local_attnestflag = ESMF_ATTR_DEFAULT_ATTNEST
  end if

  info = eidesc%GetInfo(target, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (debug) then
    call ESMF_LogWrite(ESMF_METHOD//": convention="//TRIM(convention))
    call ESMF_LogWrite(ESMF_METHOD//": purpose="//TRIM(purpose))
    call ESMF_LogWrite(ESMF_METHOD//": Info Dump="//ESMF_InfoDump(info, rc=localrc), rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
  end if

  key = "/"//TRIM(convention)//"/"//TRIM(purpose)
  is_present = ESMF_InfoIsPresent(info, key, attnestflag=local_attnestflag, isPointer=.true., rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (present(isPresent)) then
    isPresent = is_present
  end if

  ! If the attpack object is provided but it does not exist, then bail out since
  ! the attpack will never be initialized properly
  if (.not. is_present) then
    if (present(attpack)) then
      if (.not. present(isPresent)) then
        if (debug) then
          call ESMF_LogWrite(ESMF_METHOD//": convention="//TRIM(convention))
          call ESMF_LogWrite(ESMF_METHOD//": purpose="//TRIM(purpose))
        end if
        if (ESMF_LogFoundError(ESMF_RC_NOT_FOUND, msg="convention/purpose not found and attpack object present", &
          ESMF_CONTEXT, rcToReturn=rc)) return
      end if
    end if
  end if

  if (is_present) then
    if (present(attpack)) then
      call attpack%initialize(info, convention=convention, purpose=purpose, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
      if (debug) then
        call ESMF_LogWrite(ESMF_METHOD//": attpack%root_key="//TRIM(attpack%root_key), rc=localrc)
        if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
      end if
    end if
  end if

  if (present(rc)) rc = ESMF_SUCCESS
end subroutine ESMF_AttributeGetAttPackFieldBundle