def max_power_rule(mod, g, tmp):
    """
    **Constraint Name**: GenHydro_Max_Power_Constraint
    **Enforced Over**: GEN_HYDRO_OPR_HRZS

    Power plus upward reserves shall not exceed the maximum power output.
    The maximum power output (fraction) is a user input that is specified
    by horizon. If the unit is unavailable, it will be further de-rated.

    Example: The maximum power is 90% of the installed capacity in horizon
    1, which represents a winter week. If the installed capacity during the
    timepoint (period) of interest (which can be a user input or a decision
    variable, depending on the capacity type) is 1,000 MW and the project is
    fully available, the project's maximum power output is 900 MW.
    """
    return mod.GenHydro_Gross_Power_MW[g, tmp] \
        - mod.GenHydro_Curtail_MW[g, tmp] \
        + mod.GenHydro_Upwards_Reserves_MW[g, tmp] \
        <= mod.gen_hydro_max_power_fraction[
               g, mod.horizon[tmp, mod.balancing_type_project[g]]] \
        * mod.Capacity_MW[g, mod.period[tmp]] \
        * mod.Availability_Derate[g, tmp]