def parse_filename(filename):
    """
    Routine to parse CMIP5 filename into consituent facets
    :returns: institute, model, experiment, frequency, realm, table, ensemble, version, variable, ncfile
    """

    facets = [part.strip() for part in filename.split("/")]
    
    institute, model, experiment, frequency, realm, table, ensemble, latest, variable, ncfile = facets[6:]
    return institute, model, experiment, frequency, realm, table, ensemble, variable, ncfile