/[MITgcm]/MITgcm/verification/OpenAD/code_ad/insertTemplateDir.bash
ViewVC logotype

Contents of /MITgcm/verification/OpenAD/code_ad/insertTemplateDir.bash

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Wed Nov 30 21:33:41 2005 UTC (18 years, 5 months ago) by utke
Branch: MAIN
changed mechanism to insert template directives (for now until we make them permanent in the code)

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 "doing $srName"
8 echo "/^ SUBROUTINE $srName/i\\" >> temp.sed
9 if [ "$srName" = "the_first_level_loop" -o "$srName" = "the_second_level_loop" -o "$srName" = "the_third_level_loop" -o "$srName" = "the_fourth_level_loop" ]
10 then
11 echo "c\$openad XXX Template ../code_ad/ad_template.checkpoint.f" >> temp.sed
12 else
13 echo "c\$openad XXX Template ../code_ad/ad_template.split.f" >> temp.sed
14 fi
15 done
16 cat $1 | sed -f temp.sed > $2
17

  ViewVC Help
Powered by ViewVC 1.1.22