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

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
    integer               :: localPet
    type(ESMF_Clock)      :: clockInternal
    
    ! Initialize user return code
    rc = ESMF_SUCCESS

    call ESMF_GridCompGet(comp, localPet=localPet, clock=clockInternal, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out

    print *, localPet, "User Comp2 Final starting"

    call ESMF_ClockDestroy(clockInternal, rc=rc)
    if (rc/=ESMF_SUCCESS) return ! bail out

    print *, localPet, "User Comp2 Final returning"

  end subroutine user_final