Source code for polaris.ocean.convergence.spherical.forward

from polaris.ocean.convergence import ConvergenceForward


[docs]class SphericalConvergenceForward(ConvergenceForward): """ A step for performing forward ocean component runs as part of a spherical convergence test Attributes ---------- resolution : float The resolution of the (uniform) mesh in km package : Package The package name or module object that contains the YAML file yaml_filename : str A YAML file that is a Jinja2 template with model config options """
[docs] def compute_cell_count(self): """ Compute the approximate number of cells in the mesh, used to constrain resources Returns ------- cell_count : int or None The approximate number of cells in the mesh """ # use a heuristic based on QU30 (65275 cells) and QU240 (10383 cells) cell_count = 6e8 / self.resolution**2 return cell_count