RICHMOND -- They clean up the morgue for visitors, but by now Patricia Cornwell has given so many tours that she routinely guides guests out of the tile-cold hall through a garage and into the outdoor light. Fresh air, she knows, is what people need after their first trip through. Sometimes she needs the clean air and light herself.

For the past five years, Patsy Cornwell has worked here in the office of Richmond's chief medical examiner, a grim, bloody place dedicated to discovering the story behind mysterious and violent deaths. She came for a brief visit, a former newspaper reporter and novice mystery writer hoping to learn some basic facts about the life of a medical examiner, but then stayed -- fascinated, repelled, angry and oddly at home.

"There's a part of me that always wants to know what really happened -- to go behind one more curtain," says Cornwell, "Of course, this is the ultimate version of that. As a reporter, you never get into the morgue, and I wanted to pull back that sheet. Here, you finally do that."

After observing more than 200 autopsies, Cornwell has succeeded in pulling back the sheet. She hung around long enough for chief medical examiner David Wiecking to decide she might as well work there, so he hired her. She has seen grisly things, funny things, poignant things, and like the others who work in the morgue, has become inured to shocking sights. The bloodied clothes are familiar by now. She can recognize a knife cut or a bullet hole without a moment's hesitation. Much of the time she no longer even notices the thick antiseptic smell, so dense it only calls attention to the fact there are worse odors it is intended to mask.

Out of her experiences, and her observations of assistant medical examiner Marcella Fierro, came "Postmortem," a thriller starring a female medical examiner named Kay Scarpetta that received enthusiastic reviews and marked the beginning of a series Cornwell plans to continue. The second Scarpetta novel will be published next year, and she is working on a third.

"Postmortem" is a murder mystery, the story of a series of gruesome rapes and murders, but it is also an introduction to the contemporary world of forensic medicine. From lasers to computerized fingerprint analysis to DNA tracing, Cornwell writes about the new technologies that have reshaped the medical examiner's work over the last decade. Television viewers may remember "Quincy," the adventures of a sleuthing medical examiner played by Jack Klugman, but Cornwell's technical detail and the assurance with which she wields it reveal a realm of scientific complexity certain to be new to most readers.

Scarpetta becomes deeply involved in solving a series of brutal murders that Cornwell based on the acts of a real Richmond serial killer. And although Cornwell admits her heroine is "more pro-active" in her investigations than the average medical examiner, she has seen Fierro and other M.E.s go well beyond their official duties to explore a case. At times, the police have asked Fierro to examine surviving crime victims in the hospital in the hope that she can find clues on their bodies.

For years, Cornwell, a small, trim woman who exudes nervous energy, dreamed of writing novels. She worked as a police reporter for the Charlotte (N.C.) Observer and in her early 20s wrote a biography of the wife of Billy Graham. Then she moved to Richmond with her husband (from whom she is now divorced). Without a job, she turned her mind to mysteries. She was not particularly a fan of the genre, but "it seemed to me whenever I tried to write a novel, someone died," she says. She did some reporting, seeking out Fierro to help her with the details of death. "I spent three hours with her," Cornwell remembers. "I asked specific things: 'When you go out on a case, what do you carry? What do you look for?'"

When she began actually working in the office, she did technical writing. Since then Cornwell has become master of the computer, collating data as well as writing the office newsletter. But it is the work of the doctors and morgue technicians she finds compelling.

"I don't know why I'm interested in this, because I don't consider myself a voyeuristic or morbid person," she says. "I just wanted to know what it looks like. I think people are intrigued by death because it's the one thing we really can't understand."

A morgue offers the promise that understanding is possible. An identity is found for an unidentified body. The movements of a murderer are deciphered in the pattern of the wounds. Cornwell's fascination with those answers is familiar to Fierro, who was drawn to the pathologist's profession for the same reasons.

"It appeals to scientists who have a sort of investigative, problem-solving interest," says Fierro, who came to the Richmond office 18 years ago. "I like to figure out what happened."

Cornwell writes about such investigations with meticulous care. In one scene, Scarpetta and a laser technician study the still-warm body of a strangled woman.

We explored inches of the suffused flesh at a time. Tiny fibers lit up like hot wires, and I began collecting them with forceps, my movements staccato in the strobe, creating the illusion of slow motion . . .

What we saw didn't register at first.

The wand was probing several inches of Lori Petersen's right shoulder when directly over her right clavicle three irregular smudges suddenly leaped out as if they were painted with phosphorous. We both stood still and stared. Then he whistled through his teeth as a faint chill ran up my spine. Retrieving a jar of powder and a Magna brush, Vander delicately dusted what appeared to be three latent fingerprints left on Lori Petersen's skin.

Cornwell loves the laser and the other technical toys of the profession. Just as her decision to write about a female sleuth was unintentionally timely -- detective stories featuring women have been the hottest trend in mysteries for several years -- Cornwell's technical accuracy comes at a fortuitous time.

"The development of laser techniques, DNA technologies, automated fingerprint-identification systems -- it doesn't sound very exciting, but the ability to take a partial print and put it into the computer and get a name at the other end, it's nothing short of miraculous," says Fierro.

Cornwell is quick to point to Fierro as her inspiration and the model for Scarpetta. Fierro, however, demurs, and offers a comment that she has clearly made many times. "Kay is 105 pounds, blond and blue-eyed," she says. "I haven't seen 105 pounds since I was 10, and my eyes are brown."

Over the years, Cornwell and Fierro have become good friends. Cornwell turned to Fierro for advice on plot developments in her mysteries, books she kept writing despite a string of rejections.

After three novels had been rejected, Cornwell got some advice from a sympathetic publisher. Her stories were too ornate, too overwrought. Why didn't she write about the workings of a medical examiner's office?

"I was writing books with esoteric poisonings and river mansions and artistocratic murders," she says. "What I was doing was all theoretical. It might have worked 10 years ago. Then you had to have a detective spend 30 pages in a living room explaining everything that had happened."

But after several years at the medical examiner's office, she knew that such convoluted tales of murder were more true to literature than to life. "The reality is that murders are usually very simple and mundane and brutal. It's the subplots and and the investigations that are interesting. The red herrings are just the way life works."

When she wrote about that simple, mundane reality, her book was accepted by a publisher. Now she talks about Scarpetta as if describing a colleague who happens to be out of the building.

With the success of her first book, she has cut back on her hours at the office to make more time for writing, but her ideas about mystery writing are shaped by her experience. Her close acquaintance with death and violence have given her a strong sense of what is proper and left her ambivalent about some of the conventions of mysteries, especially the tendency to describe murders with what seems to be loving attention.

"I don't like to see the crimes occur," she says, and so she does not include the actual murder in her book. Scarpetta would come to the scene after the death, and so does Cornwell. "I want people to see what they look like when they come in here . . . beaten, their faces are bloated. Death is ugly. Skin goes purple-red where the blood settles, so if a body falls on its face, the face is that color. Fluids drain from the mouth and nose. That is part of the horror. I refuse to glamorize violence."

For Cornwell and her colleagues, the romanticization of death is distasteful to the point of pain. On the elaborate forms filled out for every autopsy, Cornwell says, she feels there should be this question: "Was this death stupid?" In her view, there are too many stupid deaths: friends killed by friends in a sudden rush of anger, drunk driving, gratuitous violence.

"The more time I spend here, the more angry I become," says Cornwell.

In small ways, those who work at the morgue try to overcome the grim coolness of their work, to treat the dead with respect and care, not as pieces of evidence or as disembodied parts. Several years ago when a detective who had worked with the medical examiner's office for years committed suicide, his wife asked Fierro to perform the autopsy, saying "You'll take care of him."

Fierro has found that men in particular are disturbed when they discover that she's a medical examiner. "Most middle-aged men gag," she says. "They can't conceive of a woman doing it. I don't know what people think we do, but from my point of view it's no more gory than being a surgeon or working in the emergency room."

"By and large, women don't have any trouble with it at all," she continues. "Women know they've been doing the dirty work for hundreds of years. They've been washing the blood off split lips and . . . are very attuned to tragedy. They understand all that."

Cornwell found herself understanding too, surprising herself with the equanimity she felt as she watched autopsy after autopsy. Recently that calm has begun to crumble.

"They bother me more now," she says of the TK number autopsies the office performs annually. "I've seen so many I'm not caught up in the techniques. I realize what's really going on. I think I had a lot of walls up originally so it wouldn't bother me, and I was determined to be brave and stoical. But after six years, I have a more emotional reaction."

Now, she avoids the morgue when she can and has come to hate the disinfectant smell.

"I have to stay in touch with those feelings so I can understand Scarpetta," she saya. "It was when I started writing about her that I began to feel queasy about it; the irony is it became more real to me."

But she cannot leave. Her heroine, and her work, are here.