added code to auto-generate modelx.dat where x=list of grams