def get_array_info(subs, dictofsubs):
    """
    Returns information needed to create and access members of the numpy array
    based upon the string names given to them in the model file.

    Parameters
    ----------
    subs : Array of strings of subscripts
        These should be all of the subscript names that are needed to create the array

    dictofsubs : dictionary

    returns
    -------
    A dictionary of the dimensions associating their names with their numpy indices
    directory = {'dimension name 1':0, 'dimension name 2':1}

    A list of the length of each dimension. Equivalently, the shape of the array:
    shape = [5,4]
    """

    # subscript references here are lists of array 'coordinate' names
    if isinstance(subs,list):
        element=subs[0]
    else:
        element=subs
    # we collect the references used in each dimension as a set, so we can compare contents
    position=[]
    directory={}
    dirpos=0
    elements=element.replace('!','').replace(' ','').split(',')
    for element in elements:
        if element in dictofsubs.keys():
            if isinstance(dictofsubs[element],list):
                dir,pos = (get_array_info(dictofsubs[element][-1],dictofsubs))
                position.append(pos[0])
                directory[dictofsubs[element][-1]]=dirpos
                dirpos+=1
            else:
                position.append(len(dictofsubs[element]))
                directory[element]=dirpos
                dirpos+=1
        else:
            for famname,value in dictofsubs.iteritems():
                try:
                    (value[element])
                except: pass
                else:
                    position.append(len(value))
                    directory[famname]=dirpos
                    dirpos+=1
    return directory, position