Units of wave spectrum In ocean spectra such as the Pierson Moskowitz or the JONSWAP models, the units of $S(\omega)$ are $m^2/(rad/s)$ (or whatever unit of measurement you are working in). Where does the $m^2$ come from and what does it mean physically?

I understand that the integral of the spectrum over all frequencies, i.e. $\int S(\omega) \,d\omega $, is the variance which means that the integral should have $m^2$ units? Please correct me if I am wrong.
I understand that the integral of the spectrum over all frequencies is the variance which means that the integral should have $m^2$ units? Please correct me if I am wrong.


You are correct. If elevation $\eta(t)$ is the measured quantity (units of $m$), the Fourier transform of wave variance $\eta^2$ yields spectrum $S(f)$ with the units of $m^2/Hz$, or if you are working with angular frequency $\omega = 2\pi f$, it yields $S(\omega)$ with the units of $m^2/rad/Hz$.

More details can be found in the answer to this question.