<p><b>dwj07@fsu.edu</b> 2011-10-17 09:04:26 -0600 (Mon, 17 Oct 2011)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Adding a bash script that will help renaming subroutines and files.<br>
</p><hr noshade><pre><font color="gray">Added: branches/source_renaming/convertFile.sh
===================================================================
--- branches/source_renaming/convertFile.sh                                (rev 0)
+++ branches/source_renaming/convertFile.sh        2011-10-17 15:04:26 UTC (rev 1083)
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+#Convert Subroutine Names
+SEARCHFILES=`ls src/core_sw/*.F`
+REPLACEFILES=`ls src/core_sw/*.F`
+SUBPREFIX=&quot;sw_&quot;
+
+for FILE in $SEARCHFILES
+do
+        SUBS=`cat $FILE | grep -i &quot;subroutine.*(&quot; | awk '{print $2}'`
+        for SUB in $SUBS
+        do
+                SUBNAME=`echo ${SUB%(*}`
+                NEWSUBNAME=`echo $SUBNAME | sed &quot;s/[A-Z]/_&amp;/g&quot; | tr &quot;[:upper:]&quot; &quot;[:lower:]&quot;`
+                NEWSUBNAME=`echo &quot;$SUBPREFIX$NEWSUBNAME&quot;`
+
+                echo &quot;From file: $FILE&quot;
+                echo &quot;Do you want to replace $SUBNAME with $NEWSUBNAME? (y/n/s) (s = skip)&quot;
+                read ANS
+
+                if [ $ANS ]; then
+                        if [ $ANS == &quot;n&quot; ]; then
+                                echo &quot;Enter the name you would like to replace $SUBNAME with:&quot;
+                                read NEWSUBNAME
+                                ANS=&quot;y&quot;
+                        fi
+                else
+                        ANS=&quot;y&quot;
+                fi
+
+
+                if [ $ANS == &quot;y&quot; ]; then
+                        for INFILE in $REPLACEFILES
+                        do
+                                cat $INFILE | sed &quot;s/ine ${SUBNAME}/ine ${NEWSUBNAME}/gI&quot; &gt; temp
+                                cat temp | sed &quot;s/call ${SUBNAME}/call $NEWSUBNAME/gI&quot; &gt; temp2
+                                mv temp2 $INFILE
+                                rm temp
+                        done
+                fi
+        done
+done
+
+for FILE in $FILES
+do
+        NAME=`echo $FILE | sed &quot;s/module_/mpas_sw_/g&quot;`
+        mv ${FILE} ${NAME}
+done
+


Property changes on: branches/source_renaming/convertFile.sh
___________________________________________________________________
Added: svn:executable
   + *

</font>
</pre>