<commit_before># -*- coding: utf-8 -*-

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import numpy as np

__all__ = ['ocean_double_sigma_coordinate',
           'ocean_sigma_z_coordinate',
           'ocean_sigma_coordinate',
           'ocean_s_coordinate',
           'ocean_s_coordinate_g1',
           'ocean_s_coordinate_g2']


def ocean_double_sigma_coordinate(sigma, depth, z1, z2, a, href, k_c):
    """
    Creates a dimensioned version of ocean double sigma.

    """
    raise NotImplemented


def ocean_sigma_z_coordinate():
    """
    Creates a dimensioned version of ocean sigma over z.

    """
    raise NotImplemented


def ocean_sigma_coordinate(sigma, eta, depth):
    """
    Creates a dimensioned version of ocean sigma coordinate.

    z(n, k, j, i) = eta(n, j, i) + sigma(k) *
                    (depth(j, i) + eta(n, j, i))

    """
    return eta + sigma * (depth + eta)


def ocean_s_coordinate(s, eta, depth, a, b, depth_c):
    """
    Creates a dimensioned version of ocean s-coordinate.

    z(n,k,j,i) = eta(n,j,i)*(1+s(k)) + depth_c*s(k) +
                    (depth(j,i)-depth_c)*C(k)

    where:
        C(k) = (1-b) * sinh(a*s(k)) / sinh(a) +
                b * [tanh(a * (s(k) + 0.5)) / (2 * tanh(0.5*a)) - 0.5]<commit_msg>Added comments to implement last 2 ODVCs<commit_after># -*- coding: utf-8 -*-

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

import numpy as np

__all__ = ['ocean_double_sigma_coordinate',
           'ocean_sigma_z_coordinate',
           'ocean_sigma_coordinate',
           'ocean_s_coordinate',
           'ocean_s_coordinate_g1',
           'ocean_s_coordinate_g2']


def ocean_double_sigma_coordinate(sigma, depth, z1, z2, a, href, k_c):
    """
    Creates a dimensioned version of ocean double sigma.

    Definition:
      for k <= k_c
        z(k,j,i)= sigma(k)*f(j,i)
      for k > k_c
        z(k,j,i) = f(j,i) + (sigma(k)-1)*(depth(j,i)-f(j,i))
        f(j,i) = 0.5*(z1+ z2) + 0.5*(z1-z2)* tanh(2*a/(z1-z2)*(depth(j,i)-href))

    where z(k,j,i) is height, positive upwards, relative to ocean datum
    (e.g. mean sea level) at gridpoint (k,j,i) , sigma(k) is the dimensionless
    coordinate at vertical gridpoint (k) for k <= k_c , and depth(j,i) is the
    distance from ocean datum to sea floor (positive value) at horizontal
    gridpoint (j,i) . z1 , z2 , a , and href are constants.

    """
    raise NotImplemented


def ocean_sigma_z_coordinate(sigma, eta, depth, depth_c, nsigma, zlev):
    """
    Creates a dimensioned version of ocean sigma over z.

    Definition:
        for k <= nsigma
            z(n,k,j,i) = eta(n,j,i) + sigma(k)*(min(depth_c,depth(j,i))+eta(n,j,i))
        for k > nsigma
            z(n,k,j,i) = zlev(k)

        where z(n,k,j,i) is height, positive upwards, relative to ocean datum
        (e.g. mean sea level) at gridpoint (n,k,j,i) , eta(n,j,i) is the height
        of the ocean surface, positive upwards, relative to ocean datum at
        gridpoint (n,j,i) , sigma(k) is the dimensionless coordinate at
        vertical gridpoint (k) for k <= nsigma , and depth(j,i) is the distance
        from ocean datum to sea floor (positive value) at horizontal
        gridpoint (j,i) . Above depth depth_c there are nsigma layers.

    """
    raise NotImplemented


def ocean_sigma_coordinate(sigma, eta, depth):
    """
    Creates a dimensioned version of ocean sigma coordinate.

    z(n, k, j, i) = eta(n, j, i) + sigma(k) *
                    (depth(j, i) + eta(n, j, i))

    """
    return eta + sigma * (depth + eta)


def ocean_s_coordinate(s, eta, depth, a, b, depth_c):
    """
    Creates a dimensioned version of ocean s-coordinate.

    z(n,k,j,i) = eta(n,j,i)*(1+s(k)) + depth_c*s(k) +
                    (depth(j,i)-depth_c)*C(k)

    where:
        C(k) = (1-b) * sinh(a*s(k)) / sinh(a) +
                b * [tanh(a * (s(k) + 0.5)) / (2 * tanh(0.5*a)) - 0.5]
{'fraction_non_alphanumeric': 0.14054726368159204, 'fraction_numerical': 0.010696517412935324, 'mean_word_length': 2.5241016652059596, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3778094', 'n_tokens_mistral': 1542, 'n_tokens_neox': 1459, 'n_words': 386}