def calc_unsaturated_evaporation(pet, unsatStore, fieldCap, wetFrac):
    ' Calculate evaporation from the unsaturated zone\n\n    Parameters\n    ----------\n    pet : int or float\n        Potential evapotranspiration [mm day^-1]\n    unsatStore : int or float\n        Storage in the unsaturated zone [mm]\n    fieldCap : int or float\n        Field capacity [mm]\n    wetFrac : float\n        Wetted fraction of the canopy\n\n    Returns\n    -------\n    unsatEvap : float\n        Evaporation from the unsaturated zone [mm day^-1]\n    '
    if (unsatStore < fieldCap):
        unsatEvap = ((pet * (unsatStore / fieldCap)) * (1 - wetFrac))
    else:
        unsatEvap = (pet * (1 - wetFrac))
    return unsatEvap
Calculate evaporation from the unsaturated zone

Parameters
----------
pet : int or float
    Potential evapotranspiration [mm day^-1]
unsatStore : int or float
    Storage in the unsaturated zone [mm]
fieldCap : int or float
    Field capacity [mm]
wetFrac : float
    Wetted fraction of the canopy

Returns
-------
unsatEvap : float
    Evaporation from the unsaturated zone [mm day^-1]
def calc_unsaturated_evaporation(pet, unsatStore, fieldCap, wetFrac):
    ' Calculate evaporation from the unsaturated zone\n\n    Parameters\n    ----------\n    pet : int or float\n        Potential evapotranspiration [mm day^-1]\n    unsatStore : int or float\n        Storage in the unsaturated zone [mm]\n    fieldCap : int or float\n        Field capacity [mm]\n    wetFrac : float\n        Wetted fraction of the canopy\n\n    Returns\n    -------\n    unsatEvap : float\n        Evaporation from the unsaturated zone [mm day^-1]\n    '
    if (unsatStore < fieldCap):
        unsatEvap = ((pet * (unsatStore / fieldCap)) * (1 - wetFrac))
    else:
        unsatEvap = (pet * (1 - wetFrac))
    return unsatEvap