#!/bin/sh # # uses gather_results with known files . suffix if [ -z "$1" ];then echo "Usage: $0 " echo "where is one directory in the defaults-dir, containing pcp.*${suf} files." exit 1 fi for mol in $@; do DDir="${configdir}/$mol" SDir=$PWD TEX="$mol.tex" DVI="$mol.dvi" PS="$mol.ps" . suffix # start TeX-File echo "\documentclass[11pt, a4paper]{article}" >${DDir}/$TEX echo "\usepackage{rotating}" >>${DDir}/$TEX echo "\usepackage{graphicx}" >>${DDir}/$TEX echo "\usepackage{latexsym}" >>${DDir}/$TEX echo "\usepackage{amsfonts}" >>${DDir}/$TEX echo "\usepackage{amssymb}" >>${DDir}/$TEX echo "\begin{document}" >>${DDir}/$TEX # gather susceptibility, copy plot file, call gnuplot echo "Gathering susceptibility ..." ./gather_result ${DDir}/ chi ./average_result ${DDir}/ chi 9 "${DDir}/results-chi_avg${suf}" ./average_result ${DDir}/ chi 1 "${DDir}/results-chi_iso_avg${suf}" _iso echo "\include{results-chi}" >>${DDir}/$TEX echo "\include{results-chi_iso}" >>${DDir}/$TEX sed -e "s#results#results-chi#g" ${pcpdir}/util/plot-chi.plt >${DDir}/plot-chi.plt cd ${DDir} gnuplot plot-chi.plt sed -i -e "s#figure#sidewayfigure#g" results-chi.tex cd ${SDir} # go through all different sigmas elementliste="H C O Si" for type in $elementliste; do ion=0 while [ -e "$DDir/2Ht/pcp.sigma_i${ion}_${type}${suf}" ]; do echo "Gathering shielding tensor for ion ${ion} of type ${type} ..." ./gather_result ${DDir}/ "sigma_i${ion}_${type}" sed -e "s#sigma#sigma-i${ion}-${type}#g" -e "s#results#results-sigma_i${ion}_${type}#" ${pcpdir}/util/plot-sigma.plt >${DDir}/plot-sigma_i${ion}_${type}.plt cd ${DDir} gnuplot "plot-sigma_i${ion}_${type}.plt" sed -i -e "s#figure#sidewayfigure#g" results-sigma_i${ion}_${type}.tex cd ${SDir} echo "\include{results-sigma_i${ion}_${type}}" >>${DDir}/$TEX echo "\include{results-sigma_i${ion}_${type}_iso}" >>${DDir}/$TEX # step on to next ion, if exists. If not, go to next type and zeroth ion let ion=$ion+1 done if [ -e "$DDir/2Ht/pcp.sigma_i0_${type}${suf}" ]; then echo "Collecting shielding tensor, averaging and error estimation ..." ./average_result ${DDir}/ "sigma" ${type} 9 "${DDir}/results-sigma_${type}_avg${suf}" ./average_result ${DDir}/ "sigma" ${type} 1 "${DDir}/results-sigma_${type}_iso_avg${suf}" _iso fi ion=0 while [ -e "$DDir/2Ht/pcp.sigma_i${ion}_${type}_rezi${suf}" ]; do echo "Gathering reciprocal shielding tensor for ion ${ion} of type ${type} ..." ./gather_result ${DDir}/ "sigma_i${ion}_${type}_rezi" sed -e "s#sigma#sigma-i${ion}-${type}_rezi#g" -e "s#results#results-sigma_i${ion}_${type}_rezi#" ${pcpdir}/util/plot-sigma.plt >${DDir}/plot-sigma_i${ion}_${type}_rezi.plt cd ${DDir} gnuplot "plot-sigma_i${ion}_${type}_rezi.plt" sed -i -e "s#figure#sidewayfigure#g" results-sigma_i${ion}_${type}_rezi.tex cd ${SDir} echo "\include{results-sigma_i${ion}_${type}_rezi}" >>${DDir}/$TEX echo "\include{results-sigma_i${ion}_${type}_rezi_iso}" >>${DDir}/$TEX # step on to next ion, if exists. If not, go to next type and zeroth ion let ion=$ion+1 done if [ -e "$DDir/2Ht/pcp.sigma_i0_${type}_rezi${suf}" ]; then echo "Collecting reciprocal shielding tensor, averaging and error estimation ..." ./average_result ${DDir}/ "sigma" ${type} 9 "${DDir}/results-sigma_${type}_rezi_avg${suf}" "_rezi" ./average_result ${DDir}/ "sigma" ${type} 1 "${DDir}/results-sigma_${type}_rezi_iso_avg${suf}" "_rezi_iso" fi done # End TeX-File and call with latex echo "\end{document}" >>${DDir}/$TEX cd ${DDir} latex $TEX dvips -o $PS $DVI cd ${SDir} done echo "all done." exit 0