source: util/convert2old.sh@ 725869

Last change on this file since 725869 was a0bcf1, checked in by Frederik Heber <heber@…>, 17 years ago

-initial commit
-Minimum set of files needed from ESPACK SVN repository
-Switch to three tantamount package parts instead of all relating to pcp (as at some time Ralf's might find inclusion as well)

  • Property mode set to 100755
File size: 3.0 KB
Line 
1#!/bin/sh
2#
3# converts config file back to old format, used by pcpopt
4
5if [ -z "$2" ]; then
6 echo "Usage: $o <config file> <outputfile>"
7 exit 1
8fi
9
10input="$1"
11output="$2"
12
13echo "mainname pcp" >$output
14echo "defaultpath ../defaults/pcp" >>$output
15echo "pseudopotpath /nosave/heber/defaults/pseudopot" >>$output
16PEGamma="`grep ^ProcPEGamma $input | awk -F'\t' {'print $2'}`"
17PEPsi="`grep ^ProcPEPsi $input | awk -F'\t' {'print $2'}`"
18echo "ProcsGammaPsi $PEGamma $PEPsi" >>$output
19DoOutVis="`grep ^DoOutVis $input | awk -F'\t' {'print $2'}`"
20echo "DoOutVis 0" >>$output
21DoOutMes="`grep ^DoOutMes $input | awk -F'\t' {'print $2'}`"
22echo "DoOutMes $DoOutMes" >>$output
23AddGramSch="`grep ^AddGramSch $input | awk -F'\t' {'print $2'}`"
24echo "AddGramSch $AddGramSch" >>$output
25echo "MaxOuterStep 250 1.e-5" >>$output
26MaxPsiStep="`grep ^MaxPsiStep $input | awk -F'\t' {'print $2'}`"
27echo "MaxPsiStep $MaxPsiStep" >>$output
28
29MaxMinStep="`grep ^MaxMinStep $input | awk -F'\t' {'print $2'}`"
30RelEpsTotalE="`grep ^RelEpsTotalE $input | awk -F'\t' {'print $2'}`"
31RelEpsKineticE="`grep ^RelEpsKineticE $input | awk -F'\t' {'print $2'}`"
32MaxMinStopStep="`grep ^MaxMinStopStep $input | awk -F'\t' {'print $2'}`"
33#echo -e "MaxMinStep\t\t$MaxMinStep \t$RelEpsTotalE \t$RelEpsKineticE\t$MaxMinStopStep" >>$output
34echo "MaxMinStep 10 0.0001 0.01 1" >>$output
35MaxMinStep="`grep ^MaxInitMinStep $input | awk -F'\t' {'print $3'}`"
36RelEpsTotalE="`grep ^InitRelEpsTotalE $input | awk -F'\t' {'print $2'}`"
37RelEpsKineticE="`grep ^InitRelEpsKineticE $input | awk -F'\t' {'print $2'}`"
38MaxMinStopStep="`grep ^InitMaxMinStopStep $input | awk -F'\t' {'print $2'}`"
39#echo -e "MaxInitMinStep\t$MaxMinStep \t$RelEpsTotalE \t$RelEpsKineticE\t$MaxMinStopStep" >>$output
40echo "MaxInitMinStep 10 0.0001 0.01 1" >>$output
41
42# BoxLength
43BoxLength="`grep ^BoxLength $input --after-context=3 | awk -F"#" {'print $1'}`"
44echo "$BoxLength" >>$output
45
46ECut="`grep ^ECut $input | awk -F'\t' {'print $2'}`"
47echo "ECut 24." >>$output
48
49MaxLevel="`grep ^MaxLevel $input | awk -F'\t' {'print $2'}`"
50echo "MaxLevel $MaxLevel" >>$output
51Level0Factor="`grep ^Level0Factor $input | awk -F'\t' {'print $2'}`"
52echo "Level0Factor $Level0Factor" >>$output
53RiemannTensor="`grep ^RiemannTensor $input | awk -F'\t' {'print $2'}`"
54echo "RiemannTensor $RiemannTensor" >>$output
55PsiType="`grep ^PsiType $input | awk -F'\t' {'print $3'} | awk -F"#" {'print $1'}`"
56echo "PsiType $PsiType" >>$output
57
58MaxPsiDouble="`grep ^MaxPsiDouble $input | awk -F'\t' {'print $2'}`"
59echo -e "MaxPsiDouble\t$MaxPsiDouble" >>$output
60
61echo "Ions" >>$output
62RCut="`grep ^RCut $input | awk -F'\t' {'print $3'}`"
63echo "RCut 0.0" >>$output
64IsAngstroem="`grep ^IsAngstroem $input | awk -F'\t' {'print $2'}`"
65echo "IsAngstroem $IsAngstroem" >>$output
66
67MaxTypes="`grep ^MaxTypes $input | awk -F'\t' {'print $2'}`"
68echo "MaxTypes $MaxTypes" >>$output
69
70echo "Ions_Data" >>$output
71
72# IonsData
73i=0
74while [ "$i" -lt "$MaxTypes" ];do
75 let i=$i+1
76 grep "Ion_Type$i" $input | grep -v ^# | awk -F" " {'print $2" "$3" "$4" "$5" "$6" 0.05"'} | awk -F"#" {'print $1'} >>$output
77done
78
79
Note: See TracBrowser for help on using the repository browser.