By John Kemp

LONDON, Sept 4 (Reuters) - Hedge funds turned bearish towards U.S. crude while boosting bullish positions in gasoline and heating oil in the final week of August, anticipating major disruption to U.S. refineries as a result of Hurricane Harvey.

Hedge fund operators responded in the classic textbook manner for a supply interruption expected to hit refineries rather than crude production by selling crude while buying fuels.

Hedge funds and other money managers cut their net long position in futures and options contracts linked to Brent and WTI by 107 million barrels to 582 million barrels in the week to Aug. 29.

Almost all the reduction in positions came from WTI (which fell by 105 million barrels) rather than Brent (which were declined by just 1 million barrels) reflecting the specific disruption in the United States.

The one-week decline in net long positions in WTI was the largest on record, as fund managers prepared for a big drop in crude consumption due to the refinery closures in Texas.

But fund managers boosted their net long position in U.S. gasoline by 12 million barrels to 49 million barrels, anticipating an acute shortage of refined fuels.

Portfolio managers also raised their bullish net long position in U.S. heating oil by 10 million barrels to 30 million barrels, according to position data published by regulators and exchanges.

Overall position changes in the petroleum complex were slightly negative, with the net long position in the five major futures and options contracts cut by 84 million barrels to 661 million. Bearish selling of WTI exceeded bullish buying of gasoline and heating oil.

The impact of the hurricane and associated position changes on the flat prices of crude and fuels was fairly limited but the effect on calendar spreads was dramatic.

U.S. crude, which had been edging towards backwardation, swung to a large contango, anticipating a temporary oversupply of crude and inadequate refining capacity.

Price discounts for U.S. crude delivered in October compared with December widened to $1.33 per barrel on Aug. 31 from 26 cents on Aug. 21.

By contrast, the gasoline market tightened sharply, with the October-December backwardation surging to 24 cents per gallon on Aug. 31 from 5 cents on Aug. 21.

The refinery disruptions should prove temporary so many of these position and price changes are likely to be reversed in the coming days.

The backwardation in gasoline is already narrowing as tankers head from Europe to bring relief fuel supplies and U.S. refineries embark on the complicated process of restarting.

And the large number of short positions in WTI is likely to put upward pressure on the price of short-dated U.S. crude futures as they are closed out.

As a result, the discount to Brent is likely to narrow in the days ahead and the contango in nearby WTI futures is also likely to shrink.

((; +44 207 542 9726 and on twitter @JKempEnergy))