There’s a startling scene early in this movie between the lead character, Joan, and her husband, Robin. At their son’s wedding, she learns that Robin has accepted a job transfer from the East Coast to Wichita, Kansas.

He hasn’t bothered to consult Joan at all, assuming that as empty nesters, she will tag along him.

Later, in bed, Robin, played with brisk pretensions of authority by Michael Cristofer, shrugs off her concerns with something like contempt.

At the end of their argument, Joan, played by Karen Allen with patience and precision, asks, “Why do you love me?” Mishearing, he says “Yes.”

When she repeats the question, he responds, “Because you’re my wife. Men love their wives.” Twisting his knife, he finishes, “And their mothers.”

Here, what seemed to Joan like a good marriage unveils itself as something wholly other. The movie deliberately descends from this brutal height to something friendlier, more encouraging and, alas, substantially more quaint.

Based on a memoir by Joan Anderson, “Year by the Sea” depicts Joan taking up solo residence in Cape Cod, in search of self-realization. After meeting an array of droll locals, she encounters a woman (Celia Imrie), a dancer and the wife of the pioneering psychoanalyst Erik Erikson — who, among other things, coined the term “identity crisis.”

The writer and first-time director Alexander Janko is also a composer, and he leavens the movie’s anecdotal structure with airs designed to enhance aperçus like “From adversity comes transcendence.”

Allen, she of the inviting smile, fetching freckles and deadly punch to Harrison Ford’s jaw in “Raiders of the Lost Ark” does much to add warmth and buoyancy to the predictable plot.

As Joan’s ebullient new best friend, Imrie makes Ruth Gordon in “Harold & Maude” look positively morose, while S. Epatha Merkerson, as Joan’s quirky, ebullient old best friend, energizes an essentially tacked-on role. Yannick Bisson has presence as Joan’s hunky fisherman boss and platonic pal.

The movie is not entirely my cup of tea, although it is refreshing in its depiction of diverse, older female characters. The pleasure of Joan’s screen company is not insubstantial.