ESMF_AttributeWriteFieldBundle Subroutine

private subroutine ESMF_AttributeWriteFieldBundle(target, fileName, keywordEnforcer, convention, purpose, attwriteflag, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_FieldBundle), intent(inout) :: target
character(len=*), intent(in) :: fileName
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
character(len=*), intent(in), optional :: convention
character(len=*), intent(in), optional :: purpose
type(ESMF_AttWriteFlag), intent(in), optional :: attwriteflag
integer, intent(out), optional :: rc

Calls

proc~~esmf_attributewritefieldbundle~~CallsGraph proc~esmf_attributewritefieldbundle ESMF_AttributeWriteFieldBundle esmf_fieldbundlegetinit esmf_fieldbundlegetinit proc~esmf_attributewritefieldbundle->esmf_fieldbundlegetinit interface~esmf_infocreate ESMF_InfoCreate proc~esmf_attributewritefieldbundle->interface~esmf_infocreate none~getinfo ESMF_InfoDescribe%GetInfo proc~esmf_attributewritefieldbundle->none~getinfo proc~esmf_imerr ESMF_IMErr proc~esmf_attributewritefieldbundle->proc~esmf_imerr proc~esmf_infodestroy ESMF_InfoDestroy proc~esmf_attributewritefieldbundle->proc~esmf_infodestroy proc~esmf_infoformatkey ESMF_InfoFormatKey proc~esmf_attributewritefieldbundle->proc~esmf_infoformatkey proc~esmf_infowritejson ESMF_InfoWriteJSON proc~esmf_attributewritefieldbundle->proc~esmf_infowritejson proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_attributewritefieldbundle->proc~esmf_logfounderror proc~esmf_infocreatebykey ESMF_InfoCreateByKey interface~esmf_infocreate->proc~esmf_infocreatebykey proc~esmf_infocreatebyparse ESMF_InfoCreateByParse interface~esmf_infocreate->proc~esmf_infocreatebyparse proc~esmf_infocreateempty ESMF_InfoCreateEmpty interface~esmf_infocreate->proc~esmf_infocreateempty proc~esmf_infocreatefrominfo ESMF_InfoCreateFromInfo interface~esmf_infocreate->proc~esmf_infocreatefrominfo proc~getinfoarray ESMF_InfoDescribe%getInfoArray none~getinfo->proc~getinfoarray proc~getinfoarraybundle ESMF_InfoDescribe%getInfoArrayBundle none~getinfo->proc~getinfoarraybundle proc~getinfocplcomp ESMF_InfoDescribe%getInfoCplComp none~getinfo->proc~getinfocplcomp proc~getinfodistgrid ESMF_InfoDescribe%getInfoDistGrid none~getinfo->proc~getinfodistgrid proc~getinfofield ESMF_InfoDescribe%getInfoField none~getinfo->proc~getinfofield proc~getinfofieldbundle ESMF_InfoDescribe%getInfoFieldBundle none~getinfo->proc~getinfofieldbundle proc~getinfogeom ESMF_InfoDescribe%getInfoGeom none~getinfo->proc~getinfogeom proc~getinfogrid ESMF_InfoDescribe%getInfoGrid none~getinfo->proc~getinfogrid proc~getinfogridcomp ESMF_InfoDescribe%getInfoGridComp none~getinfo->proc~getinfogridcomp proc~getinfolocstream ESMF_InfoDescribe%getInfoLocStream none~getinfo->proc~getinfolocstream proc~getinfomesh ESMF_InfoDescribe%getInfoMesh none~getinfo->proc~getinfomesh proc~getinfoscicomp ESMF_InfoDescribe%getInfoSciComp none~getinfo->proc~getinfoscicomp proc~getinfostate ESMF_InfoDescribe%getInfoState none~getinfo->proc~getinfostate proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep proc~esmf_infodestroy->proc~esmf_logfounderror interface~c_info_destroy c_info_destroy proc~esmf_infodestroy->interface~c_info_destroy proc~esmf_infoformatkey->proc~esmf_logfounderror proc~esmf_infowritejson->proc~esmf_logfounderror interface~c_info_write_json c_info_write_json proc~esmf_infowritejson->interface~c_info_write_json esmf_breakpoint esmf_breakpoint proc~esmf_logfounderror->esmf_breakpoint proc~esmf_logrc2msg ESMF_LogRc2Msg proc~esmf_logfounderror->proc~esmf_logrc2msg proc~esmf_logwrite ESMF_LogWrite proc~esmf_logfounderror->proc~esmf_logwrite

Called by

proc~~esmf_attributewritefieldbundle~~CalledByGraph proc~esmf_attributewritefieldbundle ESMF_AttributeWriteFieldBundle interface~esmf_attributewrite ESMF_AttributeWrite interface~esmf_attributewrite->proc~esmf_attributewritefieldbundle

Source Code

subroutine ESMF_AttributeWriteFieldBundle(target, filename, keywordenforcer, convention, purpose, attwriteflag, rc)
  ! 39.11.42 - attwrite flag only supports JSON
  type(ESMF_FieldBundle), intent(inout) :: target
  character(len=*), intent(in) :: fileName
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer ! must use keywords below
  character(len=*), intent(in), optional :: convention
  character(len=*), intent(in), optional :: purpose
  type(ESMF_AttWriteFlag), intent(in), optional :: attwriteflag
  integer, intent(out), optional :: rc

  integer :: localrc
  type(ESMF_InfoDescribe) :: eidesc
  type(ESMF_Info) :: info, isrc
  character(:), allocatable :: key

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

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

  if (present(convention)) then
    call ESMF_InfoFormatKey(key, "", localrc, convention=convention, purpose=purpose)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

    info = ESMF_InfoCreate(isrc, key, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
  else
    info = isrc
  endif

  call ESMF_InfoWriteJSON(info, filename, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  if (present(convention)) then
    deallocate(key)
    call ESMF_InfoDestroy(info, rc=localrc)
    if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
  endif

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