A repressed British mystery writer finds both inspiration and liberation while vacationing at her publisher’s French country house in Francois Ozon’s “Swimming Pool.” Though, like the writer-director’s “Under the Sand,” it stars Charlotte Rampling, the new picture lacks that film’s dark depths. And while it too features Ludivine Sagnier, one of the stars of Ozon’s musical murder mystery “8 Women,” it doesn’t emulate its lighthearted cheekiness. “Swimming Pool” does have certain elements in common with those earlier efforts–like “Sand,” it revels in ambiguity, and like “Women” it’s primarily a study of the female psyche. But the tone and approach are very different from either. “Swimming Pool” is a cool, cerebral psychological exercise, with a twist that you’ll find either cleverly satisfying or extremely frustrating, depending on your perspective. This reviewer falls into the former category.

Rampling plays Sarah Morton, a rigid, unhappy woman who’s known for a series of novels featuring a celebrated inspector. (Just think of P.D. James.) After she expresses frustration over her work to her publisher John Bosload (Charles Dance)–in whom she clearly has a more than professional interest–he persuades her to try writing in the more restful environment of his home in Languedoc by implying that he’ll drop in for a weekend visit with her. To Sarah’s gradually-building consternation, however, John doesn’t come; instead it’s his rude, high-spirited French daughter Julie (Ludivine Sagnier) who shows up, disrupting her work schedule and offending her morals with her loose life and loud sexual escapades. Despite her intense disapproval of the young woman’s behavior, however, Sarah becomes fascinated and befriends her in an effort to extract details about her past. The tense but peaceful atmosphere between them is shattered, however, when Julie brings home Frank (Jean-Marie Lamour), a local waiter whom Sarah has gotten to know, for a tryst by the swimming pool and violence follows.

Ozon’s film, as it turns out, is hardly as simply as that–it’s not merely a whodunit, or more properly a whathappened. The ending makes that clear, but the observant viewer may have gotten an inkling of what the writer-director is up to in a carefully crafted sequence in which mirrors are prominently featured and there’s a quirky shot that first shows Sarah at the extreme edge of the frame and then pans so that she’s far over on the other side. At the time these might strike you simply as affected stylistic flourishes, but as it turns out there’s a point to them. It’s the nature of that “turning out” that will confound some viewers and irritate others. It’s not that the denouement isn’t prepared perfectly well; it’s that it could be dismissed as a facile cop-out for those expecting a straightforward revelation. To be more specific might spoil things.

In any event, Rampling gives another superb performance for Ozon. It’s a turn that doesn’t demand as much as “Under the Sand,” with its more profound themes, did, but it does require a hint of fire simmering beneath a highly controlled exterior, and this she provides beautifully. Sagnier has the showier role, and she exhibits lots of tautness and voluptuousness–as well as plenty of skin and sex appeal. The other cast members give solid support: Dance is suitably priggish, and Lamour attractively grubby. There’s also a pleasant turn by Marc Fayolle as the aged caretaker at the chateau, and another by Mireille Mosse, in a curiously unsettling appearance as his daughter. Yorick Le Saux’s camerawork is atmospheric, and Philippe Rombi’s score is spare at the beginning, becoming an integral part of things as the film progresses.

“Swimming Pool” is bound to divide viewers, but if you approach it with an open mind, you should find it a moodily effective thriller that in the end also works as a clever commentary on the creative process.