U.S. Deputy Secretary of State William P. Clark met twice today with Prime Minister Pieter W. Botha in a further high-level American effort to get a clear-out South African commitment to a plan for bringing black majority rule to the territory of Namibia, now administered by South Africa.

Clark said his discussions, which included meetings with Defense Minister Magnus Malan and Foreign Minister Pik Botha, were "going fine." But Clarke said he would not make public details of the talks until he had reported to Secretary of State Alexander M. Haig Jr. and President Reagan.

Foreign Minister Botha called the meetings between Clark and the prime minister "constructive." There were indications that the talks involved some hard bargaining by South Africa and that they occasionally ran into disagreement.

Clark's visit here is a follow-up to Pik Botha's discussions with Haig in Washington last month.

Clark is the highest-ranking U.S. official to visit South Africa then-secretary of state Cyrus Vance came in 1978 -- also in an effort to get South Africa to agree to a Western-designed independence plan for Namibia.

South Africa was given a mandate to administer Namibia 60 years ago by the old League of Nations and has refused to comply with U.S. resolutions that it should evacuate the territory. For the past 15 years, it has been fighting a guerrilla war against the Soviet-amred black nationalist South West Africa People's Organization (SAWAPO).

The United States reportedly has offered Pretoria the prospect of warmer relations and an easing of its international isolation in exchanges for cooperation on a settlement plan on Namibia. None of the specific incentives Washington is offering have been officially disclosed, but they are reliably reported to include the mutual increase in defense attache personnel at the U.S. and South African embassies; permission for South Africa to open additional consulates in two American cities and possibly a visit to the United States by Prime Minister Botha.

The Reagan administration has aroused the ire of black African states who criticize Washington for considering changes in a U.N. plan agreed to by Pretoria in 1978.

The U.S. delegation, which also includes the assistant secretary of state for Africa, Chester Crocker, and the assistant secretary for international organizations, Elliot Abrams, arrived yesterday. This morning they went to Westbrooke, the prime minister's official Cape Town residence, for a working breakfast after which the two delegations talked for two hours.

Clarke said his second meeting with the prime minister was at the latter's invitation. They met alone for an hour in Botha's office.

The Americans were taken on a helicopter tour of Cape Point, the rocky peninsula where the Indians and Atlantic oceans meet at the southern tip of this continent. The South Africans, who are eager for closer military ties with Washington to counter what they portray as Soviet expansionism on the continent, see strategic importance in the Cape sea route, their sophisticated underground radar ship-tracking station and the nearby South African naval base of Simonstown, from which U.S. ships are barred.