"Whatever Works" isn't topnotch Woody Allen, but it's still immensely funny. Allen revisits familiar ground in this bittersweet romance between a nubile Mississippi beauty queen and a kvetching New York know-it-all. It's not much of a romp -- it sort of trudges -- but it boasts moments of zany inspiration only Allen could provide.

Larry David plays Boris Yellnikoff, a cranky Harvard physicist reduced to tutoring children in chess. Not exactly a people person, he's given to calling his pupils "incompetent zombies" and dumping the pieces on their heads. Boris has a gift for making the worst of any personal relationship. Years earlier, he concluded that his marriage to a smart, lovely, wealthy woman was perfect on paper, "but life isn't on paper." He resolved this situation by jumping out their apartment window, adding a pronounced limp to his list of grievances.

Although Boris was once considered for a Nobel Prize, his real specialty is cynicism. Because the universe is coming apart at the speed of light, "any way you can filch a little joy in this pointless black chaos" without hurting others is OK: Whatever works.

Boris' fatalistic world view brightens a bit when he encounters an urchin outside his apartment and takes in the stray. Melodie (Evan Rachel Wood) is a guileless sweetheart on the lam from a world of beauty pageants and small-town constraints, who takes the glib, scoffing intellectual as her champion.

Quickly, improbably, Melodie develops a crush, and Yellnikoff, like Henry Higgins in "My Fair Lady," becomes accustomed to Melodie's face and screwball sex appeal. Soon Melodie begins speaking in Boris' distinctively neurotic cadences, and they marry. Sure, it's improbable, but Larry King is on No. 12 now, isn't he?

When Melodie's Bible-banging parents (Patricia Clarkson and Ed Begley Jr.) pursue her to Boris' apartment, they fall under the Big Apple's bohemian spell as well. And while he'd never admit it, Boris learns a few lessons from perpetually perky Melodie. By the warm, golden-toned fadeout, his "whatever works" motto comes to mean something less amoral and more compassionate.

Allen's lightest films involve lots of griping. He saves actual human pain for his dramas. His best -- "Annie Hall," "Manhattan," "Hannah and Her Sisters" -- make giddy romance and regret work side by side. "Whatever Works" falls short of those classics, but shares the sweet-and-sour tone. It begins with Groucho Marx crooning "Hello, I Must Be Going," a nonsense patter song that stands here as a symbol for the time-stamped nature of human attachments and life itself. The soundtrack's signature theme, "If I Could Be With You (One Hour Tonight)" reinforces the message. On their first date, Melodie and Boris visit Grant's Tomb.

Despite references to the Taliban and Donald Trump, the script feels cobwebby. Allen wrote it three decades ago as a vehicle for Zero Mostel. We can only imagine how differently the film would have played with that Jewish Falstaff as the seedy, sarcastic scholar circling a hillbilly Lolita. David, verbally entertaining but no actor, plants himself in front of the camera and chews his lines like a rat terrier. Allen just lets the camera sit there.

As always, though, Allen serves his actresses well. Wood plays Melodie broadly, but the lens loves her zestful energy and goosey grace. Clarkson turns a high-strung, potentially annoying character into a beguiling scene stealer. Allen's 42nd film is slight but clever, enjoyable for all its faults. It works.

Colin Covert • 612-673-7186