#!/bin/tcsh # # usage: minerals # # Cshell-Script for creating a list of EQ3/6 mineral stoichiometry # # Author: Dr.Vinzenz Brendler, FZ Dresden-Rossendorf e.V. # Institute of Radiochemistry # # Version: 0.40 Date: 19-Aug-2010 setenv PATH $PATH\:$EQ36CO # include EQ3/6 binaries # (and also 'gets' on some systems) set LIST = $EQ36DA/minerals.list set TEMP = $LIST.$$ # Temporary Output File cat /dev/null > $LIST foreach DB (fzr nea sup) set DB_FILE = $EQ36DA/data0.$DB.R2 awk '\ /^solids/,/^liquids/ { print }\ ' $DB_FILE | awk '\ /^\*/ {next}\ /^[A-Za-z(]/ { print "#", $1 }\ /element/,/species/ { if(NF>1) print }\ ' | sed 's/element.*$//\ s/chemical.*$//\ /solids/d\ /species/d\ /liquids/d\ s/^ *//\ s/ */ /g' | awk '\ /^#/ { printf "%s ", $0 ; next }\ { print }\ ' | awk '\ /^#/ { printf "\n%s ", $0 ; next }\ { printf "%s " , $0 }\ END { printf "\n" }\ ' | sed 's/ */ /g\ /^$/d\ s/# //\ s/ $//' >> $LIST end cat $LIST | sort -u > $TEMP mv $TEMP $LIST