QLModel.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:niwqg 作者: crocha700 项目源码 文件源码
def _invert(self):

        """ Calculate the streamfunction given the potential vorticity.
            The algorithm is:
                1) Calculate wave potential vorticity
                2) Invert for wave, pw, and vortex stremfunctions, pv.
                3) Calculate geostrophic stremfunction, p = pv+pw.
        """

        # the wavy PV
        self.phich = self.fft(np.conj(self.phi))
        self.phi2 = np.abs(self.phi)**2
        self.jacph = self.jacobian_phic_phi()
        self.gphi2h = -self.wv2*self.fft(self.phi2)
        self.qwh = (0.5*self.gphi2h  + 1j*self.jacph)/self.f/2.
        self.qwh *= self.filtr
        # invert for psi
        self.ph = -self.wv2i*(self.qh-self.qwh)
        # calculate in physical space
        self.p = self.ifft(self.ph).real
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号