The author studies the so called 3D viscous primitive equations of geophysical fluid dynamics which are given as follows: $$\aligned & \partial_t v+(v\nabla)v+w\partial_z v+\nabla p+fv^\perp+L_1v=0\\
& \partial_z p + \theta=0,\quad \nabla\cdot v+\partial_zw=0\\
& \partial_t\theta+(u\nabla)\theta+w\partial_z\theta+L_2\theta=Q.\endaligned\tag 1$$ Here $v=(v_1,v_2)$, $v^\perp=(-v_2,v_1)$, $L_i=-\nu_i\Delta - \mu_i\partial^2_z$, $i=1,2$ and $\Delta=\partial^2_x+\partial^2_y$, while $\nabla=(\partial_x,\partial_y)$. The domain underlying (1) has the form $\Omega=M\times (-h,0)$ where $M\subseteq\Bbb R^2$ is a smooth bounded domain. System (1) is supplied by appropriate (inhomogeneous) boundary conditions. Based on the third and the fourth equation in (1), system (1) can be transformed into a new, equivalent system, to be denoted by ($1'$), which involves only the unknowns $v=(v_1,v_2)$ and $\theta$ and which is supplied by homogeneous boundary conditions. It is this modified system $(1')$ which is investigated by the author. He introduces appropriate function spaces $$H_1\subseteq L^2(\Omega)^2,\quad V_1\subseteq H^1(\Omega)^2,\quad H_2=L^2(\Omega), \quad V_2= H^1(\Omega),$$ and considers $(1')$, properly interpreted, as an evolution equation on the spaces $H=H_1\times H_2$ and $V=V_1\times V_2$ respectively. A standard definition of weak solution of $(1')$ is then given, which however is not used in the sequel since a result of Cao and Titi states: given $Q\in H^1(\Omega)$ and $(v_0,\theta_0)\in V_1\times V_2$ then there is a unique global strong solution $(v,\theta)$ of $(1')$ with initial data $(v_0,\theta_0)$; the dependence on $(v_0,\theta_0)$ is continuous. By this theorem, the author can restrict attention on strong solutions and so avoid lengthy computations via the Galerkin method. The author now first proves $L^2$- and $L^6$-estimates for the temperature $\theta$, and then $L^6$- and $H^1$-estimates for the velocity vector $v=(v_1,v_2)$. The proofs of these estimates are quite difficult and based on a tricky combination of embedding inequalities and variants of Gronwalls inequality. Subsequently the continuity of strong solutions $(v(t),\theta(t))$, $t\ge 0$ with respect to time $t$ is proved. Based on this preparatory steps, the author proves his main theorem (Thm. 6.1) which asserts among others that the solution semigroup $S(t)$, $t\ge 0$, associated with the system $(1')$, admits a compact global attractor.