By CHRISTOPHER GRAY

Published: July 12, 1987

IF Harlem has an equivalent to the Dakota, the famed apartment building on Central Park West, it is Graham Court, a full blockfront on Adam Clayton Powell Jr. Boulevard, from 116th to 117th Streets.

Built in 1901 by the Astor family, the building has recently seen hard times - decay, drug problems and a near foreclosure by the city. But it has been purchased by a new owner, who promises a better future.

William Waldorf Astor became head of the family estate in 1890, and in the same year moved to England in an attempt to avoid the constant press attention on his family and his $100 million fortune. Although he lived abroad, Astor regularly returned to the United States to supervise his building projects. In addition to Graham Court, they included the Hotel Netherland in 1893, the Hotel Astor in 1904 and the Apthorp Apartments in 1908.

For Graham Court, Astor retained as architects Clinton & Russell, who would also design the Hotel Astor and the Apthorp. They produced a great, eight-story boxy mass in the mode of an Italian palazzo. The first two floors are of rusticated limestone, with tan or gray brick above and a crowning story of foliate terra-cotta capped by a copper cornice. While the basic facade is unremarkable, the courtyard plan of the building makes it unusual. A full blockfront on the avenue and 175 feet deep on the side street, the completed building had great height and presence for Harlem, where a five-story corner flat was still considered a big building in the early 1900's.

The courtyard, reached by an open arcaded entry from Seventh Avenue, is 79 feet by 108 feet square and was originally planted with grass and ornamental shrubbery. Its gate is now locked against intruders.

One of the great issues in apartment design at the turn of the century was the disposition of the courts - often reduced to mere air shafts. But because of its size, Graham Court could have a courtyard shared with no other building.

The court itself creates a genteel but cozy feeling, grand but also comfortably secure from the outside - an unusual amenity in a city where there are few private unroofed spaces. It also gives cross ventilation to every apartment. THE planning of the apartments was a bit crude. Andrew Alpern, in his book ''Apartments for the Affluent,'' says the building has an ''awkward circulation pattern'' and the bedrooms tend to be small and narrow. But each apartment combines features - oak kitchen cabinets, mosaic foyer floors, mahogany and oak flooring, paneled dining rooms and multiple fireplaces - that later, simpler buildings could only sample. Early tenants - the building was initially restricted to whites - were such professionals as Dr. Joseph Lumbard, an anesthetist at Harlem Hospital, and Henry Redfield, a Columbia law professor. Overbuilding in Harlem destroyed the rental market early in the century, and gradually the whites-only restrictions were dropped. In 1928, the first black tenant moved into Graham Court.

By the 1960's, the building had become a typical story of marginal maintenance and some troublesome tenants making life difficult for everyone else.

In 1979, Mohammed Siddiqui, a pharmacist whose license was suspended for three months last year for ''negligence'' in handling prescription drugs, bought the building for $55,000 and a promise to pay $150,000 in back taxes.

But he fell behind on his tax bill and, according to the tenants association, let the building slide further into disrepair. In the meantime, some residents said drugs were being sold illegally from apartments in the building.

Last September, the city moved to foreclose for $600,000 in back taxes. But Mr. Siddiqui finally paid the taxes last February and in April, he sold the building for $2 million to Leon Scharf, a West Side building owner.

Mr. Scharf said he is spending $1 million on improvements this year, and is optimistic about the future of the building. ''Eventually, maybe we would go to a co-op plan'' he said.

''I just got my apartment painted for the first time in 10 years,'' said Margaret Porter, who is the secretary of the tenants' association. ''And a new intercom system is going in. It's encouraging.'' As Mr. Scharf begins his work, the cast-iron lampposts in the courtyard lie broken or missing. The plantings are scruffy. The cornices have been stripped off and the front doors have the bars and locks typical of many neighborhoods.

But there is, even now, an underlying elegance and a few Graham Court tenants have begun to restore their apartments - stripping paint and prying up linoleum from the mosaic floors.

Photo of a section of the courtyard in 1901 Graham Court, building on Adam Clayton Powell Jr. Boulevard (Andrew Alpern/The Museum of the City of New York)