def fill_nc_db_variable(nc, values, var_name, units, comment=None, 
                        long_name=None, std_name=None):
    """
    Copy data to a netCDF4-classic dataset variable.
    
    DO NOT CALL THIS FUNCTION DIRECTLY.  Instead, use `fill_nc_db`.
    
    This function is intended to only be called from fill_nc_db after it 
    determines where to insert an array of data into a netCDF4 dataset.  This
    function could be called directly by the user, but no checking will be 
    performed to ensure the inserted dataset is compatible with the other 
    data in the netCDF dataset.  Moreover, dimension mismatch, rugged arrays,
    or other errors could occur without the preprocessing in fill_nc_db.
    
    Parameters
    ----------
    nc : netCDF4 data object
        This is the existing netCDF dataset object that will receive the new
        variable values.
    values : ndarray, shape(z,)
        Array of variable values to add to the netCDF database.  Must have the
        same dimension as the current z values in the netCDF dataset.
    var_name : string
        Name to use in the netCDF dataset.  If it already exists, the 
        current variable space will be used; otherwise, a new variable will
        be created.
    units : string list
        Units of the input values
    comment : string, optional
        String containing comments for the comment attribute of the variable.
        For instance, 'Measured', 'Derived quantity', etc.
    long_name : string, optional
        String for the long_name attribute of the variable; only used if the
        variable does not already exist.
    std_name : string, optional
        String for the standard_name attribute of the variable; only used if
        the variable does not already exist.
    
    Returns
    -------
    nc : netCDF4 data object
        Returns the updated netCDF4 database with the data and metadata 
        included
    
    Raises
    ------
    ValueError : 
        If the variable already exists, then the input units are checked
        against the units already in the database.  If they do not match, 
        a ValueError and appriate message is raised.
    
    """
    if var_name in nc.variables:
        # Add data to an existing variable
        y = nc.variables[var_name]
        try:
            assert y.units == units
            y[:] = values
        except:
            raise ValueError('Error: %s units must be in %s not %s' % 
                             (var_name, y.units, units))
    
    else:
        # Create a new netCDF dataset variable
        z_dim = 'z'
        y = nc.createVariable(var_name, 'f8', (z_dim))
        y[:] = values
        y.long_name = long_name
        y.standard_name = std_name
        y.units = units
        y.coordinates = 'time lat lon z'
    
    # Insert comments
    if comment is not None:
        y.comment = comment
    
    return nc