def visc(Tc, S, V = False):
    """
    Calculate the viscosity of water or seawater
    Reference:
        Sharqawy et al. 2009
        Thermophysical properties of seawater: a review of \
            existing correlations and data
        https://doi.org/10.5004/dwt.2010.1079
        Eq 22 and Eq 23
        viscosity unit in kg/m/s
    Parameters
    ----------
    Tc : scalar
        Temperature in °C.
    S : scalar
        Salinity in per mil (g/kg).
    V:  Bool
        whether or not return calculated viscosity, default is False

    Returns
    -------
    Viscosity or Seawater to water ratio.

    """
    Sref = S/1000 #reference salinity is written in kg/kg
    A = 1.541 + 1.998e-2 * Tc - 9.52e-5 * Tc**2
    B = 7.974 - 7.561e-2 * Tc + 4.724e-4 *Tc**2
    Sw_w = 1 + A*Sref + B*Sref**2#seawater to water ratio

    if V:        
        V_water = 4.2844e-5 + 1/( 0.157* (Tc+ 64.993)**2 -91.296)
        #water viscosity
        V_sw = V_water * Sw_w # seawater viscosity
        Sw_w = (Sw_w, V_sw)
        print("given viscosity is in kg/m/s, which is 1000 times of centipoise")
    
    return Sw_w