Country music star Merle Haggard, who with Willie Nelson organized the star-studded Farm Aid benefit concert scheduled for Sept. 22, got his Farm Aid train with a little help from a fan in the White House.

The train -- which will whistle-stop on a route stretching from Bakersfield, Calif. (Haggard's home town), to the concert site in Champaign-Urbana, Ill. -- was a last-minute idea, and that apparently was the problem. Haggard was having difficulties booking a train and a route on such short notice, so he called his pal, President Reagan, vacationing at the Western White House in Santa Barbara, 90 miles from Bakersfield.

"Merle Haggard got in touch with the president's staff out there," said Patrick Buchanan, White House director of communications. "I was back here at the White House, sort of as a duty officer. They called me from the coast and asked me to look into it."

Thus, White House intervention connected two camps -- Amtrak and American farmers -- whose subsidy programs have been under budget attack by the administration.

This is how it came about:

Buchanan contacted Haggard, who was on a concert tour in North Carolina. "I returned his call for the president, basically. He told me about his concerns and interests and what he wanted. All I was doing was basically talking to Merle Haggard's folks and putting them in touch with the folks that could provide help, if we could provide it. Apparently we were able to do some things."

What Buchanan was able to do was clear the channels and accelerate communications so that Haggard, whom he described as "a personal friend of the president," could realize his plan.

"Here's a group of people who are going to draw attention to a real dilemma and problem, which is a crisis in certain sectors of the farm belt," Buchanan continued. "There's nothing wrong with that, and there's an awful lot right about it, so if we can help them to put that together consistent with what we're allowed to do, why not do it?

"The president's as concerned as anybody else about the situation in the farm belt. We disagree on how you should go about alleviating it, but highlighting is a good thing.

"Whether Haggard talked directly to the president, I don't know," Buchanan added. "He called the president in Santa Barbara and they told me to respond for the president."

Buchanan in turn called James Burnley, deputy secretary at the Department of Transportation.

"The request to us to assist Mr. Haggard and his folks in putting together the train and making sure they had the equipment they needed and access to the tracks that they needed came from the White House," Burnley said. "Pat Buchanan conveyed the president's request to us."

The president's relationship with Haggard goes back quite a while: In 1972, while Reagan was governor of California, he pardoned Haggard and had his criminal record cleared, an act that was not made public until two years later. Haggard had been convicted of second-degree burglary in 1958 and had served two years and nine months, with another two years on probation. After he was released from San Quentin, Haggard embarked on a career in country music that had made him a star by the time Reagan pardoned him. A year after the pardon, Haggard performed at the White House for President Nixon.

"Three years ago, when President Reagan was out in California at the ranch, Merle came up and did a big concert for him," said Jim Walker, a publicist for Haggard. "I believe President Reagan appreciated the favor and this was a returning of the favor. Merle needed to put this together, it was a cause that he really believed in, and he needed an introduction to Amtrak and that's how it was afforded."

The problem may have been that Haggard, an avid train buff whose father once worked for the Santa Fe Railroad and whose tour buses are painted the same colors and carry the same logo as that railway, was mixing apples and oranges: Since 1971, the Santa Fe has been strictly a freight railroad, while Amtrak has been responsible for all passenger service.

"Haggard was talking with a private railroad whose concern is not the passenger business," said Burnley. "He didn't connect with Amtrak directly and Amtrak was not involved until DOT got into it. After the president asked that we help him work through his problem, we immediately went to Amtrak and the Association of American Railroads to enlist their assistance in getting access to some of the private cars that some of the commercial freight railroads own."

Haggard's original proposal, according to one source, had been "outlandishly complex," including railroad flatcars to carry buses on them and the mixing of freight and passenger cars, which presents difficult operational and mechanical problems.

Everyone is quick to point out that Amtrak's involvement is strictly a business proposition, albeit one that was put together quickly.

"They are going to pay the full cost," Burnley said of Farm Aid. "Amtrak is not being asked, and in fact we asked them to make it clear, we're not doing this to make any kind of charitable donation.

"What they're getting out of this is the same as John Q. Citizen. Amtrak is perfectly happy, if you pay the rate, to rent equipment. There's no special concession here. It was just a question of getting the right people to talk to each other."

Yesterday, Farm Aid announced the train's winding itinerary, which will include 39 stops in eight states -- California, Arizona, New Mexico, Texas, Oklahoma, Kansas, Missouri and Illinois. Most of those stops will be for 10 to 15 minutes, though one overnight stop, Fort Worth, will also feature a benefit concert at the huge Billy Bob's nightclub. The 16-car, four-locomotive train is called The American, and so far the passenger list includes Haggard, Nelson, Tammy Wynette, the Judds, former University of Texas football coach Darrell Royal, actor-singer John Schneider (who will cohost the trip with Haggard), Waylon Jennings and Arlo Guthrie, who immortalized the best-ever train song, Steve Goodman's "City of New Orleans."

The cost of running the train from Bakersfield to Chicago (the morning after the concert) is still Haggard's personal responsibility, but negotiations for sponsorship continued yesterday with more than a half-dozen major corporations. A Farm Aid spokesman said a sole sponsorship is being offered for $750,000. If that falls through, individual car sponsorships would be available for $150,000.

The concert has already taken in $1.4 million from the sale of 78,000 tickets, which were gone in three days. Concert organizers hope to raise $40 million to $50 million through donations called into a toll-free number or mailed to a post office box and sales of Farm Aid merchandise such as T-shirts, posters and programs. Concert organizers are still determining how the funds will be distributed.

The concert lineup continues to expand: There are now more than 40 major acts scheduled, with more being announced every day. On the country side, they include Haggard, Nelson, Jennings, Alabama, Lacy J. Dalton, George Jones, John Conlee, Kris Kristofferson, Charley Pride and Kenny Rogers. Rock performers include Billy Joel, John Cougar Mellencamp, Lou Reed, Carole King, The Blasters, X, Rickie Lee Jones, Don Henley, Daryl Hall and Bob Dylan, who, during his performance at Philadelphia's Live Aid concert, made a pitch for some of the millions in donations being directed to America's farmers. Other Live Aid performers scheduled for Farm Aid: the Beach Boys, Tom Petty, B.B. King and Neil Young. The huge concert stage, with a 60-foot-diameter revolving platform, is the same one used at July's Live Aid concert in Philadelphia.

The noon-to-midnight concert will be broadcast, gavel to gavel, by the Nashville Network, which is available on local cable systems. There currently are no plans for major network coverage, though an ad hoc network of independent stations and CBS and NBC affiliates is being put together. As of yesterday, there were close to 70 stations committed to carrying a prime-time portion of the show (8-11 p.m. EDT), with a syndication representative hoping for a final total of 115 stations reaching 90 percent of U.S. television homes.

Don't look for it here unless you have cable, though. "We have gone to every station in the market," said Bill Madden of the Nashville Network, "and so far, snake eyes." On the radio side, WPKX-FM will carry the entire concert as part of another ad hoc network that numbers 180 radio stations; that total could double by show time.