IN AN upstairs loft hidden away in a derelict San Francisco neighborhood, Melvin Douglas, once the prototype of the urbane, stylish leading man -- the actor who made Garbo laugh more than 40 years ago -- is finishing up a love story of a very different sort. A love story wrapped in tears.

His bony shoulders clearly visible through a gray cardigan sweater, Douglas sits quietly in an old kitchen chair as director Lee Grant, a fourtime Academy Award nominee as an actress, points to his cheek and explains where the tears will fall.

"What we have to see," she tells her cameraman, "is a drop of water coming right down here." Later, when Douglas plays the scene in a soft, European accent, ending on the line, "How hard it is to die," the silence on the set is heartbreaking.

What is being shot here is "Tell Me a Riddle," one of the very best pieces of 20th-centry American fiction and also one of the least known. Its author, Tillie Olsen, also fits that description. Called "a short-story writer of genius" by John Leonard, she has published sparingly: a fragment of a novel, "Yonnondio"; "Silences," a meditation on the reasons writers don't write; and a collection of stories. But she has made every word count. "Everything Tillie Olsen has written," says Robert Coles, "has almost immediately become a classic."

"Tell Me a Riddle" is a story of David and Eva, how they had slowly grown apart during their 47 years of marriage -- "How deep back the stubborn, gnarled roots of the quarrel reached, no one could say" -- and how they painfully came together during the last months of Eva's life. It is a story at once delicate, sad and triumphant. And the act of filming it has been almost as extraordinary -- involving an ailing star, an untried group of young producers, a very concerned author and a literary work that seems at times almost too moving to put on film.

"Sometimes I've cried so hard I couldn't say 'Cut,'" says Grant. Mindy Affrime, one of the three women who make up Godmother Productions, the film's producers, adds, "You cry on the set, you cry at the dailies, you cry a lot. There's no getting around the fact that it's a very sad story, but the film goes beyond that."

So far beyond in fact that Michael Rosenberg, executive vice president of Fantasy Films -- the company that will oversee the projected Fall 1980 marketing and distribution of "Riddle" -- can barely restrain his enthusiasm. "This film has the potential for quite a few Oscar nominations," he says. "I know saying that from the dailies sounds ridiculous, but the dailies have been truly unbelievable."

Rosenberg is not worried about the problems of marketing a film about the elderly. "When Fantasy made 'One Flew Over the Cuckoo's Nest," that property had been around for 12 years. Every studio in town had passed on it, everyone said, 'Who's going to see a picture about crazy people?' The answer is it's one of the top 14 grossers of all time."

Though it cost an absolute bargain-basement $1 million, the miracle of "Tell Me a Riddle" is that it got made at all. "We had five strikes against us going in," says Godmother Susan O'Connell. "We were young [average age of the trio is 28], we were all women, this was our first film, it was our director's first feature, and the subject was non-commerical." Yet, Grant feels, "It's their inexperience that got it made. Experienced producers would have looked at the project and said, 'Never.' I told my husband, 'if they don't come down to Los Angeles where everyone will tell them how impossible it is, they might just to it.'"

The idea for the project began in 1973 when Affrime and the third Godmother, Rachel Lyon, were students at Washington University in St. Louis. "We heard Tillie read the story aloud and it knocked us out," Affrime remembers. "We both considered ourselves artists, we wanted to do something creative. And though we didn't know exactly what, we kept the thought of Tillie's story in the back of our minds."

After graduation the frieds moved to San Francisco and found work on other people's films, where they met Susan O'Connell, an actress. Realizing that "the only way to have an imprint on the film is to pay for it and own it," the trio formed Godmother Productions three years ago and decided on "Riddle" as their first project.

"My knees were a little weak at the thought of approaching Tillie -- she's a very intense woman," O'Connell says. And in fact the author, who divides her time between San Francisco and Santa Cruz, had turned down several previous film offers for her work. But we were very determined," says Affrime. "It took a lot of meetings and a lot of phone calls, but after six months she said, 'Yes.'"

After raising $50,000 in development money with the help of San Francisco attorney Peter Buchanan, the Godmothers chose Hoyce Eliason, a novelist ("Fresh Meat/Warm Weather"), to do the screenplay, and Lee Grant, best known as an Oscar-Emmy-Tony-winning actress, to direct. "It reopened a door on the kinds of things I originally wanted to do creatively," says Grant, whose best-known directional effort was a version of Strindberg's "The Stronger" done for the American Film Institute. "I feel that the quintessential questions in terms of film -- the questions of life and death that go below a certain level of chat -- have been left to foreign directors and really not done in this country."

Having determined that "Riddle's" budget would be $1 million, the Godmothers' next task was to raise it. "Most of the men we were dealing with, if they gave money to women it was to their wives and children -- kind of 'go out and buy something, dear.' Not, 'Bring my money back -- plus 10 percent plus a lot of other things." But we went in our silks and tweeds and looked like we could handle it," says O'Connell.

The women also learned a lot about tax laws to increase their credibility once they got in the door, registered their prospects with California's corporate commission and posted a completion bond guaranteeing that the film would be finished no matter what. After a year and a half, 35 investors came up with amounts ranging from $15,000 to $160,000. Not one penny came from Los Angeles.

While the money was being raised, the film had been cast, with Douglas as David and Lila Kedrovna (best known for her Academy Award-winning performance as the dying Madame Hortense in "Zorba the Greek") as Eva. Neither choice was made without difficulty, however: a physical one in Douglas' case and a psychological one in Kedrovna's.

Roles in "Being There" and "The Seduction of Joe Tynan" have resulted in a renaissance of sorts for Douglas' career. But his physical condition at age 78, he says slyly, is "not all that could be desired. I have arthritis, a pinched nerve in my back and other old-age ailments; and I was concerned about whether I'd be physically up to a starring role." And despite conveniences like a mechanical lift that saved him from walking the stairs to the loft set, "it's not been easy for me," Douglas says, still the elegant gentleman. "At the end of a day's shooting, I just fall into bed with a heating pad and various medicines, tired to my teeth."

With Kedrovna the problem was reversed: Grant worried that at age 60 the Russian-born, French-raised actress might be too young for the role. "Lila's very French, she's into perfume, she's into makeup, very sensual, and I knew she'd have to bleach her hair and gray it to play Eva," Grant explains. "And as far as clothes, I had very specific shmates [rags] I wanted her to wear, like a black coat two inches shorter than her dress. It was a back-and-forth thing, but by the time she'd finished, she'd made her peace with it."

Resting in her tiny dressing room between scenes, Kedrovna apologizes for her appearance with an impish "You know I am dying. Always for journalists I try to be as cheerful as possible, but now I'm dying. Yesterday I was dying all day, with yelling and screaming, but finally I was not dead, so today I have to start again."

She took the role of Eva in a rare American film appearance because, she says earnestly, "I was seduced by the character of this woman. She is very Russian, an enthusiast full of purity and humanity, full of good things and that I like. There is a lot of love between her and her husband, but there is like a fog lying on them, he doesn't understand her." Still, she feels "there is a lot of cheer in this picture. It is a human picture, not a dark, black something."

Even more delicate than the casting was the problem of adapting a fragile literary classic to the screen.

Most of the action of the novella is interior, detailing David and Eva's thoughts as they travel across the country from married child to married child, finally ending their journey at the home of a grandchild, Jeannie.

"We could have taken the story and made a haiku film, a great work of simplicity," says Grant. "To do it that way, we should have looked for a grant and done it for PBS. But the producers had already started to get investors who'd put in half the money necessary for a feature."

Once the haiku approach was discarded, changes in the story became inevitable because, explains scriptwriter Eliason, "We didn't feel we could make a film where for the last half you had a woman in bed dying. It's a valid thing, but you can't keep an audience interested."

Grant also leaned toward changes. "I know about transitions from one form to another while respecting the material," she says, referring to her work with Strindberg. "But over-respect for classics, treating one in a way that makes you feel a kind of worship or awe, prevents you from dealing with it so it comes to life. And my responsibility is to bring it to life."

The filmmakers expanded two elements of the original story. Eva's revolutionary political involvement as a young girl in Russia was to be emphasized at least partially because it was the ingredient that had originally attracted Grant to the story. And the character of the granddaughter Jeannie was greatly expanded because it seemed a logical place to open the story up and because, says Grant, "This was the area which the people putting money in were anxious to see more fully developed."

One of the results of this expanded Jeannie, played by Brooke Adams, is that the film's resolution is more clearly positive than the book's. "To me the movie is not just about death, but about a woman who in her last years is able to reach out and embrace life and hope and love," says Eliason. O'Connell adds, "What we end up with is a celebration of Eva's life. She's put back in touch with the feelings of her young revolutionary days and she's passing them on."

How Tillie Olsen reacted to all this and how the filmmakers reacted to Tillie Olsen is a question without a facile answer. "Tillie is a unique woman," explains Lee Grant. "I feel Tillie is crammed, crammed with much she wants to give, convey, communicate. There are like 1,200 things crammed in her pinkie -- if you could take one of those photographs of her aura, feelings and facts and observations and needs would be streaming out of every pore.

"Those things streaming at me were an enormous revelation. Her vision, the things she had to say, were just invaluable. But there were other times when I felt that she felt I made lesser choices. She may have been right, but I had to. We were working with a very limited budget and very limited time. You're making up your mind in a split of a second. The nature of this business is that none of us can work the way we'd like to."

Tillie Olsen understands all this. A person who is meticulous about her words and her thoughts, she does not want to be portrayed in "the classic position of all writers, feeling that no film could be worthy of what they wrote." She understands the necessity of changing literature to fit the demands of the screen, feels a fondness for the film people and thinks the cast is "magnificent." Yet she cannot escape the conclusion that this is not the film she wanted it to be.

"I'm in a very awkward position. I don't want to betray or harm the filming in any way," she says carefully. "I wish the situation had been different. I hoped to have had more input into the screenplay. But film is a world with its own compulsions and necessities, and time requirements made things happen differently than they were scheduled to. The whole process got so there wasn't time for the consultation I envisioned. It became too late to reverse certain things that had developed a momentum."

Olsen's own vision of the film "would have been different in tempo and development and focus. The film that's being made will be its own film, but it will not necessarily be 'Tell Me a Riddle' or realize its possibilities. I feel that there is yet another film to be made from 'Tell Me a Riddle.'"

The three Godmothers realize that Olsen, in Affrime's words, "isn't jumping up and down" about how things have turned out, but it hasn't shaken their belief in what they've done.

"Filmmakers don't think in terms of 'Maybe this or that shouldn't be a film.' They think, 'What's the best thing we can get?'" says Affrime, the most puckish of the trio. "Great literature is every great filmmaker's challenge, and since we're great filmmakers" -- a mischievous smile -- "we figured, why not go for the biggies."