user_final Subroutine

public subroutine user_final(comp, importState, exportState, clock, rc)

Arguments

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

Calls

proc~~user_final~92~~CallsGraph proc~user_final~92 user_final esmf_arraydestroy esmf_arraydestroy proc~user_final~92->esmf_arraydestroy esmf_arrayget esmf_arrayget proc~user_final~92->esmf_arrayget esmf_stateget esmf_stateget proc~user_final~92->esmf_stateget interface~esmf_arraybundleget ESMF_ArrayBundleGet proc~user_final~92->interface~esmf_arraybundleget proc~esmf_arraybundledestroy ESMF_ArrayBundleDestroy proc~user_final~92->proc~esmf_arraybundledestroy proc~esmf_distgriddestroy ESMF_DistGridDestroy proc~user_final~92->proc~esmf_distgriddestroy proc~esmf_arraybundlegetitem ESMF_ArrayBundleGetItem interface~esmf_arraybundleget->proc~esmf_arraybundlegetitem proc~esmf_arraybundlegetlist ESMF_ArrayBundleGetList interface~esmf_arraybundleget->proc~esmf_arraybundlegetlist proc~esmf_arraybundlegetlistall ESMF_ArrayBundleGetListAll interface~esmf_arraybundleget->proc~esmf_arraybundlegetlistall c_esmc_arraybundledestroy c_esmc_arraybundledestroy proc~esmf_arraybundledestroy->c_esmc_arraybundledestroy proc~esmf_arraybundlegetinit ESMF_ArrayBundleGetInit proc~esmf_arraybundledestroy->proc~esmf_arraybundlegetinit proc~esmf_imerr ESMF_IMErr proc~esmf_arraybundledestroy->proc~esmf_imerr proc~esmf_logfounderror ESMF_LogFoundError proc~esmf_arraybundledestroy->proc~esmf_logfounderror c_esmc_distgriddestroy c_esmc_distgriddestroy proc~esmf_distgriddestroy->c_esmc_distgriddestroy proc~esmf_distgridgetinit ESMF_DistGridGetInit proc~esmf_distgriddestroy->proc~esmf_distgridgetinit proc~esmf_distgriddestroy->proc~esmf_imerr proc~esmf_distgriddestroy->proc~esmf_logfounderror proc~esmf_arraybundlegetitem->proc~esmf_arraybundlegetinit proc~esmf_arraybundlegetitem->proc~esmf_imerr proc~esmf_arraybundlegetitem->proc~esmf_logfounderror c_esmc_arraybundlegetcount c_esmc_arraybundlegetcount proc~esmf_arraybundlegetitem->c_esmc_arraybundlegetcount c_esmc_arraybundlegetispresent c_esmc_arraybundlegetispresent proc~esmf_arraybundlegetitem->c_esmc_arraybundlegetispresent c_esmc_arraybundlegetitem c_esmc_arraybundlegetitem proc~esmf_arraybundlegetitem->c_esmc_arraybundlegetitem esmf_arraysetinitcreated esmf_arraysetinitcreated proc~esmf_arraybundlegetitem->esmf_arraysetinitcreated proc~esmf_arraybundlegetlist->proc~esmf_arraybundlegetinit proc~esmf_arraybundlegetlist->proc~esmf_imerr proc~esmf_arraybundlegetlist->proc~esmf_logfounderror c_esmc_arraybundlegetlist c_esmc_arraybundlegetlist proc~esmf_arraybundlegetlist->c_esmc_arraybundlegetlist proc~esmf_arraybundlegetlist->esmf_arraysetinitcreated esmf_arraysetthis esmf_arraysetthis proc~esmf_arraybundlegetlist->esmf_arraysetthis proc~esmf_arraybundlegetlistall->proc~esmf_arraybundlegetinit proc~esmf_arraybundlegetlistall->proc~esmf_imerr proc~esmf_arraybundlegetlistall->proc~esmf_logfounderror c_esmc_arraybundlegetlistall c_esmc_arraybundlegetlistall proc~esmf_arraybundlegetlistall->c_esmc_arraybundlegetlistall c_esmc_getvm c_esmc_getvm proc~esmf_arraybundlegetlistall->c_esmc_getvm proc~esmf_arraybundlegetlistall->esmf_arraysetinitcreated proc~esmf_arraybundlegetlistall->esmf_arraysetthis interface~c_esmc_getname c_ESMC_GetName proc~esmf_arraybundlegetlistall->interface~c_esmc_getname proc~esmf_vmsetinitcreated ESMF_VMSetInitCreated proc~esmf_arraybundlegetlistall->proc~esmf_vmsetinitcreated proc~esmf_imerr->proc~esmf_logfounderror proc~esmf_initcheckdeep ESMF_InitCheckDeep proc~esmf_imerr->proc~esmf_initcheckdeep 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

Source Code

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

    ! Local variables
    type(ESMF_DistGrid)   :: distgrid
    type(ESMF_Array)      :: array(3)
    type(ESMF_ArrayBundle):: arraybundle

    ! Initialize return code
    rc = ESMF_SUCCESS

    print *, "User Comp2 Final starting"

    call ESMF_StateGet(importState, "dstAryBndl", arraybundle, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_ArrayBundleGet(arraybundle, arrayList=array, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_ArrayBundleDestroy(arraybundle, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_ArrayGet(array(1), distgrid=distgrid, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_ArrayDestroy(array(1), rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_ArrayDestroy(array(2), rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_ArrayDestroy(array(3), rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out
    call ESMF_DistGridDestroy(distgrid, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out

    print *, "User Comp2 Final returning"

  end subroutine user_final