fillMembersState Subroutine

private recursive subroutine fillMembersState(self, state, root_key, keywordEnforcer, rc)

Type Bound

ESMF_InfoDescribe

Arguments

Type IntentOptional Attributes Name
class(ESMF_InfoDescribe), intent(inout) :: self
type(ESMF_State), intent(in) :: state
character(len=*), intent(in) :: root_key
type(ESMF_KeywordEnforcer), optional :: keywordEnforcer
integer, intent(inout), optional :: rc

Calls

proc~~fillmembersstate~~CallsGraph proc~fillmembersstate ESMF_InfoDescribe%fillMembersState esmf_stateget esmf_stateget proc~fillmembersstate->esmf_stateget none~update ESMF_InfoDescribe%Update proc~fillmembersstate->none~update proc~esmf_logfounderror ESMF_LogFoundError proc~fillmembersstate->proc~esmf_logfounderror proc~updatewitharray ESMF_InfoDescribe%updateWithArray none~update->proc~updatewitharray proc~updatewitharraybundle ESMF_InfoDescribe%updateWithArrayBundle none~update->proc~updatewitharraybundle proc~updatewithcplcomp ESMF_InfoDescribe%updateWithCplComp none~update->proc~updatewithcplcomp proc~updatewithdistgrid ESMF_InfoDescribe%updateWithDistGrid none~update->proc~updatewithdistgrid proc~updatewithfield ESMF_InfoDescribe%updateWithField none~update->proc~updatewithfield proc~updatewithfieldbundle ESMF_InfoDescribe%updateWithFieldBundle none~update->proc~updatewithfieldbundle proc~updatewithgrid ESMF_InfoDescribe%updateWithGrid none~update->proc~updatewithgrid proc~updatewithgridcomp ESMF_InfoDescribe%updateWithGridComp none~update->proc~updatewithgridcomp proc~updatewithlocstream ESMF_InfoDescribe%updateWithLocStream none~update->proc~updatewithlocstream proc~updatewithmesh ESMF_InfoDescribe%updateWithMesh none~update->proc~updatewithmesh proc~updatewithroutehandle ESMF_InfoDescribe%updateWithRouteHandle none~update->proc~updatewithroutehandle proc~updatewithscicomp ESMF_InfoDescribe%updateWithSciComp none~update->proc~updatewithscicomp proc~updatewithstate ESMF_InfoDescribe%updateWithState none~update->proc~updatewithstate proc~updatewithxgrid ESMF_InfoDescribe%updateWithXGrid none~update->proc~updatewithxgrid 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~~fillmembersstate~~CalledByGraph proc~fillmembersstate ESMF_InfoDescribe%fillMembersState none~update ESMF_InfoDescribe%Update proc~fillmembersstate->none~update none~fillmembers ESMF_InfoDescribe%FillMembers none~fillmembers->proc~fillmembersstate proc~updatewitharraybundle ESMF_InfoDescribe%updateWithArrayBundle proc~updatewitharraybundle->none~fillmembers proc~updatewithfield ESMF_InfoDescribe%updateWithField proc~updatewithfield->none~fillmembers proc~updatewithfieldbundle ESMF_InfoDescribe%updateWithFieldBundle proc~updatewithfieldbundle->none~fillmembers proc~updatewithstate ESMF_InfoDescribe%updateWithState proc~updatewithstate->none~fillmembers none~update->proc~updatewitharraybundle none~update->proc~updatewithfield none~update->proc~updatewithfieldbundle none~update->proc~updatewithstate proc~esmf_attributecopyarraybundletoarraybundle ESMF_AttributeCopyArrayBundleToArrayBundle proc~esmf_attributecopyarraybundletoarraybundle->none~update proc~esmf_attributecopyarraytoarray ESMF_AttributeCopyArrayToArray proc~esmf_attributecopyarraytoarray->none~update proc~esmf_attributecopycplcomptocplcomp ESMF_AttributeCopyCplCompToCplComp proc~esmf_attributecopycplcomptocplcomp->none~update proc~esmf_attributecopydistgridtodistgrid ESMF_AttributeCopyDistGridToDistGrid proc~esmf_attributecopydistgridtodistgrid->none~update proc~esmf_attributecopyfieldbundletofieldbundle ESMF_AttributeCopyFieldBundleToFieldBundle proc~esmf_attributecopyfieldbundletofieldbundle->none~update proc~esmf_attributecopyfieldtofield ESMF_AttributeCopyFieldToField proc~esmf_attributecopyfieldtofield->none~update proc~esmf_attributecopygridcomptogridcomp ESMF_AttributeCopyGridCompToGridComp proc~esmf_attributecopygridcomptogridcomp->none~update proc~esmf_attributecopygridtogrid ESMF_AttributeCopyGridToGrid proc~esmf_attributecopygridtogrid->none~update proc~esmf_attributecopylocstreamtolocstream ESMF_AttributeCopyLocStreamToLocStream proc~esmf_attributecopylocstreamtolocstream->none~update proc~esmf_attributecopymeshtomesh ESMF_AttributeCopyMeshToMesh proc~esmf_attributecopymeshtomesh->none~update proc~esmf_attributecopyscicomptoscicomp ESMF_AttributeCopySciCompToSciComp proc~esmf_attributecopyscicomptoscicomp->none~update proc~esmf_attributecopystatetostate ESMF_AttributeCopyStateToState proc~esmf_attributecopystatetostate->none~update proc~esmf_infocacheupdatefields ESMF_InfoCache%ESMF_InfoCacheUpdateFields proc~esmf_infocacheupdatefields->none~update proc~esmf_infosynccplcomp ESMF_InfoSyncCplComp proc~esmf_infosynccplcomp->none~update proc~esmf_infosyncfield ESMF_InfoSyncField proc~esmf_infosyncfield->none~update proc~esmf_infosyncfieldbundle ESMF_InfoSyncFieldBundle proc~esmf_infosyncfieldbundle->none~update proc~esmf_infosyncgridcomp ESMF_InfoSyncGridComp proc~esmf_infosyncgridcomp->none~update proc~esmf_infosyncscicomp ESMF_InfoSyncSciComp proc~esmf_infosyncscicomp->none~update proc~esmf_infosyncstate ESMF_InfoSyncState proc~esmf_infosyncstate->none~update proc~fillmembersarraybundle ESMF_InfoDescribe%fillMembersArrayBundle proc~fillmembersarraybundle->none~update proc~fillmembersfield ESMF_InfoDescribe%fillMembersField proc~fillmembersfield->none~update proc~fillmembersfieldbundle ESMF_InfoDescribe%fillMembersFieldBundle proc~fillmembersfieldbundle->none~update program~esmf_infocacheutest ESMF_InfoCacheUTest program~esmf_infocacheutest->none~update program~esmf_infodescribeutest ESMF_InfoDescribeUTest program~esmf_infodescribeutest->none~update program~esmf_infosyncutest ESMF_InfoSyncUTest program~esmf_infosyncutest->none~update

Source Code

recursive subroutine fillMembersState(self, state, root_key, keywordEnforcer, rc)
  class(ESMF_InfoDescribe), intent(inout) :: self
  type(ESMF_State), intent(in) :: state
  character(*), intent(in) :: root_key
type(ESMF_KeywordEnforcer), optional:: keywordEnforcer ! must use keywords below
  integer, intent(inout), optional :: rc

  type(ESMF_Array) :: array
  type(ESMF_ArrayBundle) :: arraybundle
  type(ESMF_Field), target :: field
  type(ESMF_FieldBundle) :: fieldbundle
  type(ESMF_RouteHandle) :: rh
  type(ESMF_State) :: state_nested
  type(ESMF_StateItem_Flag), dimension(:), allocatable :: stateTypes
  character(len=ESMF_MAXSTR), dimension(:), allocatable :: stateNames
  character(len=ESMF_MAXSTR) :: name
  integer :: ii, jj, itemCount, localrc

  localrc = ESMF_FAILURE
  if (present(rc)) rc = ESMF_RC_NOT_IMPL

  call ESMF_StateGet(state, itemCount=itemCount, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
  allocate(stateTypes(itemCount), stateNames(itemCount))
  call ESMF_StateGet(state, itemTypeList=stateTypes, itemNameList=stateNames, rc=localrc)
  if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return

  do ii=1,itemCount
    select case (stateTypes(ii)%ot)
    case(ESMF_STATEITEM_ARRAY%ot)
      call ESMF_StateGet(state, trim(stateNames(ii)), array, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
      call self%Update(array, root_key, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
    case(ESMF_STATEITEM_ARRAYBUNDLE%ot)
      call ESMF_StateGet(state, trim(stateNames(ii)), arraybundle, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
      call self%Update(arraybundle, root_key, rc=localrc)
      if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
    case(ESMF_STATEITEM_STATE%ot)
     call ESMF_StateGet(state, trim(stateNames(ii)), state_nested, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
     call self%Update(state_nested, root_key, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
   case(ESMF_STATEITEM_FIELD%ot)
     call ESMF_StateGet(state, trim(stateNames(ii)), field, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
     call self%Update(field, root_key, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
   case(ESMF_STATEITEM_FIELDBUNDLE%ot)
     call ESMF_StateGet(state, trim(stateNames(ii)), fieldbundle, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
     call self%Update(fieldbundle, root_key, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
   case(ESMF_STATEITEM_ROUTEHANDLE%ot)
     call ESMF_StateGet(state, trim(stateNames(ii)), rh, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
     call self%Update(rh, root_key, rc=localrc)
     if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=rc)) return
    case default
      if (ESMF_LogFoundError(ESMF_RC_OBJ_NOT_CREATED, msg="Object type not supported for Inquire", &
       ESMF_CONTEXT, rcToReturn=rc)) return
    end select
  end do
  deallocate(stateTypes, stateNames)

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