def addnote(md, string):

    # Local Variables: md, string, i, notes, miscellaneous, newnotes
    # Function calls: ischar, nargout, cell, nargin, length, addnote, error
    #ADDNOTE - add a note to the existing model notes field
    #
    #   Usage:
    #      md=addnote(md,string);
    #
    #   Example:
    #      md=addnote(md,'Pine Island, Geometry of 2007');
    
	if not isinstance(string,basetring):
        print 'addnote error message: second input argument should be a string'
		return []
    
    notes = md.miscellaneous.notes
    
	if isinstance(notes,basestring):
		newnotes=[notes,string]
    else:
		newnotes=[];
		for i in range(len(notes)):
			newnotes=newnotes+notes[i]
            
        newnotes=newnotes+nodes;
        
    md.miscellaneous.notes = newnotes
    return md
