SetServices Subroutine

public subroutine SetServices(model, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp) :: model
integer, intent(out) :: rc

Calls

proc~~setservices~3~~CallsGraph proc~setservices~3 SetServices ESMF_GridCompSetEntryPoint ESMF_GridCompSetEntryPoint proc~setservices~3->ESMF_GridCompSetEntryPoint ESMF_LogFoundError ESMF_LogFoundError proc~setservices~3->ESMF_LogFoundError ESMF_MethodRemove ESMF_MethodRemove proc~setservices~3->ESMF_MethodRemove NUOPC_CompDerive NUOPC_CompDerive proc~setservices~3->NUOPC_CompDerive NUOPC_CompSetEntryPoint NUOPC_CompSetEntryPoint proc~setservices~3->NUOPC_CompSetEntryPoint NUOPC_CompSpecialize NUOPC_CompSpecialize proc~setservices~3->NUOPC_CompSpecialize proc~mapl_return MAPL_Return proc~setservices~3->proc~mapl_return at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception

Source Code

    subroutine SetServices(model, rc)
        type(ESMF_GridComp)  :: model
        integer, intent(out) :: rc

        ! the NUOPC model component will register the generic methods
        call NUOPC_CompDerive(model, model_routine_SS, rc=rc)
        VERIFY_NUOPC_(rc)

        call ESMF_GridCompSetEntryPoint(model, ESMF_METHOD_INITIALIZE, &
                userRoutine=initialize_p0, phase=0, rc=rc)
        VERIFY_NUOPC_(rc)

        ! set entry point for methods that require specific implementation
        call NUOPC_CompSetEntryPoint(model, ESMF_METHOD_INITIALIZE, &
                phaseLabelList=["IPDv05p1"], userRoutine=advertise_fields, rc=rc)
        VERIFY_NUOPC_(rc)

        call NUOPC_CompSetEntryPoint(model, ESMF_METHOD_INITIALIZE, &
                phaseLabelList=["IPDv05p4"], userRoutine=realize_fields, rc=rc)
        VERIFY_NUOPC_(rc)

        ! attach specializing method(s)
        call NUOPC_CompSpecialize(model, specLabel=model_label_DataInitialize, &
                specRoutine=initialize_data, rc=rc)
        VERIFY_NUOPC_(rc)

        call NUOPC_CompSpecialize(model, specLabel=model_label_Advance, &
                specRoutine=model_advance, rc=rc)
        VERIFY_NUOPC_(rc)

        call ESMF_MethodRemove(model, label=model_label_CheckImport, rc=rc)
        VERIFY_NUOPC_(rc)

        call NUOPC_CompSpecialize(model, specLabel=model_label_CheckImport, &
                specRoutine=CheckImport, rc=rc)
        VERIFY_NUOPC_(rc)

        call NUOPC_CompSpecialize(model, specLabel=model_label_SetClock, &
                specRoutine=set_clock, rc=rc)
        VERIFY_NUOPC_(rc)

        ! call NUOPC_CompSpecialize(model, specLabel=model_label_CheckImport, &
        !      specRoutine=CheckImport, rc=rc)
        ! if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, &
        !      line=__LINE__, &
        !      file=__FILE__)) &
        !      return  ! bail out

        call NUOPC_CompSpecialize(model, specLabel=label_Finalize, &
                specRoutine=model_finalize, rc=rc)
        VERIFY_NUOPC_(rc)

        print*,"Wrapper finish SetServices"

        _RETURN(_SUCCESS)
    end subroutine SetServices