user_run Subroutine

private subroutine user_run(comp, importState, exportState, clock, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_CplComp) :: comp
type(ESMF_State) :: importState
type(ESMF_State) :: exportState
type(ESMF_Clock) :: clock
integer, intent(out) :: rc

Calls

proc~~user_run~89~~CallsGraph proc~user_run~89 user_run esmf_stateget esmf_stateget proc~user_run~89->esmf_stateget interface~esmf_attributecopy ESMF_AttributeCopy proc~user_run~89->interface~esmf_attributecopy interface~esmf_attributeupdate ESMF_AttributeUpdate proc~user_run~89->interface~esmf_attributeupdate interface~esmf_vmget ESMF_VMGet proc~user_run~89->interface~esmf_vmget proc~esmf_cplcompget ESMF_CplCompGet proc~user_run~89->proc~esmf_cplcompget proc~esmf_attributecopyarraybundletoarraybundle ESMF_AttributeCopyArrayBundleToArrayBundle interface~esmf_attributecopy->proc~esmf_attributecopyarraybundletoarraybundle proc~esmf_attributecopyarraytoarray ESMF_AttributeCopyArrayToArray interface~esmf_attributecopy->proc~esmf_attributecopyarraytoarray proc~esmf_attributecopycplcomptocplcomp ESMF_AttributeCopyCplCompToCplComp interface~esmf_attributecopy->proc~esmf_attributecopycplcomptocplcomp proc~esmf_attributecopydistgridtodistgrid ESMF_AttributeCopyDistGridToDistGrid interface~esmf_attributecopy->proc~esmf_attributecopydistgridtodistgrid proc~esmf_attributecopyfieldbundletofieldbundle ESMF_AttributeCopyFieldBundleToFieldBundle interface~esmf_attributecopy->proc~esmf_attributecopyfieldbundletofieldbundle proc~esmf_attributecopyfieldtofield ESMF_AttributeCopyFieldToField interface~esmf_attributecopy->proc~esmf_attributecopyfieldtofield proc~esmf_attributecopygridcomptogridcomp ESMF_AttributeCopyGridCompToGridComp interface~esmf_attributecopy->proc~esmf_attributecopygridcomptogridcomp proc~esmf_attributecopygridtogrid ESMF_AttributeCopyGridToGrid interface~esmf_attributecopy->proc~esmf_attributecopygridtogrid proc~esmf_attributecopylocstreamtolocstream ESMF_AttributeCopyLocStreamToLocStream interface~esmf_attributecopy->proc~esmf_attributecopylocstreamtolocstream proc~esmf_attributecopymeshtomesh ESMF_AttributeCopyMeshToMesh interface~esmf_attributecopy->proc~esmf_attributecopymeshtomesh proc~esmf_attributecopyscicomptoscicomp ESMF_AttributeCopySciCompToSciComp interface~esmf_attributecopy->proc~esmf_attributecopyscicomptoscicomp proc~esmf_attributecopystatetostate ESMF_AttributeCopyStateToState interface~esmf_attributecopy->proc~esmf_attributecopystatetostate proc~esmf_attributeupdatecplcomp ESMF_AttributeUpdateCplComp interface~esmf_attributeupdate->proc~esmf_attributeupdatecplcomp proc~esmf_attributeupdatefield ESMF_AttributeUpdateField interface~esmf_attributeupdate->proc~esmf_attributeupdatefield proc~esmf_attributeupdatefieldbundle ESMF_AttributeUpdateFieldBundle interface~esmf_attributeupdate->proc~esmf_attributeupdatefieldbundle proc~esmf_attributeupdategridcomp ESMF_AttributeUpdateGridComp interface~esmf_attributeupdate->proc~esmf_attributeupdategridcomp proc~esmf_attributeupdatescicomp ESMF_AttributeUpdateSciComp interface~esmf_attributeupdate->proc~esmf_attributeupdatescicomp proc~esmf_attributeupdatestate ESMF_AttributeUpdateState interface~esmf_attributeupdate->proc~esmf_attributeupdatestate proc~esmf_vmgetdefault ESMF_VMGetDefault interface~esmf_vmget->proc~esmf_vmgetdefault proc~esmf_vmgetpetspecific ESMF_VMGetPetSpecific interface~esmf_vmget->proc~esmf_vmgetpetspecific proc~esmf_compget ESMF_CompGet proc~esmf_cplcompget->proc~esmf_compget proc~esmf_compstatusget ESMF_CompStatusGet proc~esmf_cplcompget->proc~esmf_compstatusget proc~esmf_cplcompgetinit ESMF_CplCompGetInit proc~esmf_cplcompget->proc~esmf_cplcompgetinit proc~esmf_imerr ESMF_IMErr proc~esmf_cplcompget->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_cplcompget->proc~esmf_logfounderror

Source Code

  subroutine user_run(comp, importState, exportState, clock, rc)
    type(ESMF_CplComp) :: comp
    type(ESMF_State) :: importState, exportState
    type(ESMF_Clock) :: clock
    integer, intent(out) :: rc

    ! Local variables
    type(ESMF_VM)               :: vm
    integer                     :: myPet
    
    ! for testing update
    type(ESMF_Array)            :: array
    integer, dimension(3)       :: rootList
    character(ESMF_MAXSTR)      :: conv,purp

    ! Initialize return code
    rc = ESMF_SUCCESS

    ! Determine petCount
    call ESMF_CplCompGet(comp, vm=vm, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_VMGet(vm, localPet=myPet, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out

    ! Get the import and export States
    call ESMF_StateGet(importState, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_StateGet(exportState, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    
    rootList = (/0,1,2/)
    call ESMF_AttributeUpdate(importState, vm, rootList=rootList, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
                          
    ! copy all Attribute information into export State
    call ESMF_AttributeCopy(importState, exportState, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
  
  end subroutine user_run