Given a non-degenerate symplectic form $\omega$ on a finite dimensional vector space $V$ and a complex structure $J$ (that is, $J\in End(V),~J^2=-Id$). If $J$ is compatible with $\omega$ in the sense that $$\omega(Jv,Jw) = \omega(v,w),~ \omega(v,Jv) > 0,$$ then we can define a positive definite inner product by setting $$g(v,w) = \omega(v,Jw).$$ Then $g$ is also Hermitian in the sense that $$g(Jv,Jw) = g(v,w).$$
Question. Now suppose we start with a symplectic form $\omega$ and a positive definite inner product $g$, under what conditions does there exist an almost complex structure such that $\omega$ and $g$ are related by the above equation? And how does this correspond to the linear algebra statement that $$U(n) = GL(n,\mathbb{C})\cap Sp(2n,\mathbb{R})\cap O(2n).$$
It is a standard fact that given a metric $g$, there exists a canonical $J$ compatible with $\omega$, but the problem is that the $J$ so found need not satisfy $$\omega(v,Jw) = g(v,w).$$