Building a 3D porosity model for carbonate reservoirs is crucial for the planning of hydrocarbon development. However, properly estimating the porosity of carbonate reservoirs using wireline logs is still a challenge task due to the complexity of vugs. We have treated the porosity estimate of carbonate as an optimization problem and propose to estimate the porosity of carbonate reservoir by integrating several kinds of petrophysics data. We begin with establishing a series of linear equations between the porosity and wireline logs. The objective is computing a porosity value that simultaneously minimizes the defined linear equations. The multifunction minimization can successfully improve the robustness of the proposed method to noise and the “small” wireline log values due to the complex dissolution vug reservoirs. We build a 3D porosity model by applying the cooperative kriging stochastic simulation algorithm to the porosity estimated at well bore locations and inverted P impedance from seismic data. We examine the proposed workflow by applying it to the Ordovician carbonate dissolution vug reservoir in the L area of the Tahe oilfield. The statistical analysis shows that the built 3D model has a high correlation with the dynamic production data of the reservoir.