ain-soaked Union Jacks flew alongside Old Glory and guns boomed in royal salute as the yacht Britannia carrying Queen Elizabeth II and the Duke of Edinburgh sailed into San Diego harbor today. The Britannia's arrival began the queen's first tour of the West Coast.

A crowd estimated by police at 10,000 turned out to greet the royal couple, despite rain and cold winds. Few Irish-American or anti-British protesters were seen, despite several groups' announced plans to mount large demonstrations.

Lunch aboard the aircraft carrier USS Ranger was one of the queen's major afternoon stops here. She sipped a California Chardonnay and was served lobster, seafood chowder and apple pie with cheese.

On her tour of the carrier she dodged puddles on the flight deck while inspecting planes and meeting members of the 5,000-man crew.

Later in the day, the royal couple visited the Scripps Institution of Oceanography to watch a sea lion swimming in a research tank and view marine life projects. The queen was presented with a book of 8,000 photographs of brightly colored sea slugs and a gift for the British Museum of Natural History--an ancient mollusk found in the ocean.

The queen then traveled to the Old Globe Theater, a model of the London theater where William Shakespeare staged his plays. She listened to sonnets and unveiled a 6-foot, 200-pound bronze statue of Shakespeare.

The prince went separately to the San Diego Zoo, where he snuggled Pooya, a 2-year-old koala bear, and received a gold medal for his efforts to expand wildlife conservation as president of the World Wildlife Fund. "If you really try, you can save world wildlife," the prince told zoo officials, praising them for their work in captive breeding and preserving endangered species.

The prince also visited a proposed site for equestrian competition during the 1984 Olympic Games.

When the royal couple arrived at mid-morning, California Gov. George Deukmejian and his wife, Gloria, led the official welcoming delegation that included Sen. Pete Wilson, former mayor of San Diego, and acting Mayor William Cleator.

Also greeting the queen at the start of her 10-day tour were presidential aides Michael K. Deaver and Edwin Meese III, chief of protocol Selwa Roosevelt and Adm. Sylvester Foley, commander-in-chief of the Pacific fleet.

The Britannia, flying the queen's red, yellow and blue standard, docked right on time this morning, and when Wilson greeted Prince Philip on the pier, the duke congratulated the senator on his election victory last November.

There was more friendly American irreverance in the crowd than anti-British hostility. An almost life-sized picture of Prince Charles' head and shoulders with an automated hand that waved back and forth decorated a placard which read, "Hi, Mom. What's for dinner?"

Farther back in the crowd, far from the queen's line of vision, were three anti-royalists with signs that read: "Ireland for the Irish" and "England Out of Ireland."

Small craft, defying warnings, darted around the harbor like minnows, trying to get a glimpse of the British monarch aboard her vessel. Her last U.S. visit was during the bicentennial in 1976.

Deaver, accompanied by Roosevelt, went on board shortly after 9:30 a.m. to give the queen President Reagan's official greetings.

At 10, Queen Elizabeth and Prince Philip came into view. She, like her sailors, wore navy blue and white. Her silk dress was topped off with a "nautical cap" of matching fabric. The duke wore his naval uniform as admiral of the British fleet.

The queen descended the gangplank on the traditional red carpet, to be met by Deukmejian and others lined up according to protocol. When she reached Josephine Louis, wife of the U.S. ambassador to Britain, John J. Louis Jr., the queen received a curtsy. The only other curtsy was by the wife of British Consul General George Finlayson of Los Angeles.

The British party meeting the queen included her ambassador to Washington, Sir Oliver Wright, and Lady Wright. They and their luggage went aboard the Britannia for a three-night sail "in the honeymoon suite," according to Lady Wright. They will disembark in Santa Barbara, where British Foreign Secretary Francis Pym and his wife will take the Wrights' place.

Deaver is the only American the queen has invited to sleep on board every night that she and the duke are aboard Britannia. He drew a "single state room" and presumably will be moved to a larger one in San Francisco, where the queen has invited his wife, Carolyn, to spend Friday night.

That is also the night President and Mrs. Reagan will sleep aboard, after the 31st wedding anniversary dinner party the queen is planning for them. Then Nancy Reagan will spend two other nights on the yacht when she embarks in Santa Barbara.

Deaver said today that the queen's visit to the Reagan ranch is all set. The president, however, has not yet decided which of his horses his royal visitor will ride.

Despite her troubles at home with the press, Queen Elizabeth invited 200 representatives of the press for a reception aboard her yacht shortly before noon. She shook hands with each and talked with many of them. An advisory accompanying her invitation informed reporters that her conversations and those of the duke were "off the record."

While the queen was meeting the reporters, about 80 people gathered five blocks away to protest the British presence in Northern Ireland and the queen's presence in San Diego.

The crowd heard speeches by Al O'Brien, a leader of the Congress of Irish Organizations, an ad hoc group created to protest this visit, and Sean Patrick Walsh, a historian and former New York assemblyman.

A message of support for the protesters from the mother of Bobby Sands, the Irish Republican Army hunger striker who died, was read, but an intended reading of names of all the dead hunger strikers was canceled because of the rain.

Following services at St. Paul's Episcopal Church here Sunday, the queen and Prince Philip will fly by presidential jet to Palm Springs. They will be entertained at lunch by former U.S. ambassador to Britain Walter Annenberg and his wife, Lee.

Other stops will include Hollywood, the Reagan ranch near Santa Barbara, San Francisco, Sacramento and Yosemite National Park.