| 1 |
heimbach |
1.1 |
#!/bin/bash |
| 2 |
|
|
echo "#generated file" > temp.sed |
| 3 |
|
|
for i in `grep '^ SUBROUTINE ' $1 | awk '{print $2}'` |
| 4 |
|
|
do |
| 5 |
|
|
# extract the name |
| 6 |
|
|
srName=${i%%\(*} |
| 7 |
|
|
echo "/^ SUBROUTINE $srName/i\\" >> temp.sed |
| 8 |
|
|
if [ "$srName" = "the_first_level_loop" -o "$srName" = "the_second_level_loop" -o "$srName" = "the_third_level_loop" -o "$srName" = "the_fourth_level_loop" ] |
| 9 |
|
|
then |
| 10 |
utke |
1.3 |
echo "c\$openad XXX Template ../code_shallow_openad/ad_template.checkpoint.f" >> temp.sed |
| 11 |
heimbach |
1.1 |
else |
| 12 |
utke |
1.2 |
if [ "$srName" = "the_first_level_plain" -o "$srName" = "the_second_level_plain" -o "$srName" = "the_third_level_plain" -o "$srName" = "the_fourth_level_plain" ] |
| 13 |
|
|
then |
| 14 |
utke |
1.3 |
echo "c\$openad XXX Template ../code_shallow_openad/ad_template.plain.f" >> temp.sed |
| 15 |
utke |
1.2 |
else |
| 16 |
utke |
1.3 |
echo "c\$openad XXX Template ../code_shallow_openad/ad_template.split.f" >> temp.sed |
| 17 |
utke |
1.2 |
fi |
| 18 |
heimbach |
1.1 |
fi |
| 19 |
|
|
done |
| 20 |
|
|
cat $1 | sed -f temp.sed > $2 |
| 21 |
|
|
|