user_run Subroutine

public 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

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_ArrayBundle):: srcArraybundle, dstArraybundle

    ! Initialize return code
    rc = ESMF_SUCCESS

    print *, "User Coupler Run starting"

    ! Get source ArrayBundle out of import state
    call ESMF_StateGet(importState, "srcAryBndl", srcArrayBundle, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out

    ! Get destination ArrayBundle out of export state
    call ESMF_StateGet(exportState, "dstAryBndl", dstArraybundle, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out

    ! Use ESMF_ArrayBundleRedist() to take data
    ! from srcArraybundle to dstArraybundle
    call ESMF_ArrayBundleRedist(srcArrayBundle=srcArraybundle, &
      dstArrayBundle=dstArraybundle, routehandle=routehandle, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
  
    print *, "User Coupler Run returning"

  end subroutine user_run