[cig-commits] [commit] master: Optimization of fieldtransform.sh (e8bb0c0)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri Sep 19 01:48:19 PDT 2014


Repository : https://github.com/geodynamics/axisem

On branch  : master
Link       : https://github.com/geodynamics/axisem/compare/bf3258866c83310e4c4b56c210dbe2ee78ad09a5...cfd0fcc28b053f40dd1aaf39b09d671b25c2d596

>---------------------------------------------------------------

commit e8bb0c06040e40bbee31534d0736c6ccdf272cdc
Author: Simon Stähler <staehler at geophysik.uni-muenchen.de>
Date:   Thu Sep 18 14:46:02 2014 +0200

    Optimization of fieldtransform.sh
    
     - switched from CShell to Bash to allow exit on error
     - Not created on the fly in submit.csh to keep that tidied up ;)


>---------------------------------------------------------------

e8bb0c06040e40bbee31534d0736c6ccdf272cdc
 SOLVER/UTILS/fieldtransform_force.sh  | 10 +++++++
 SOLVER/UTILS/fieldtransform_moment.sh | 18 ++++++++++++
 SOLVER/submit.csh                     | 54 +++++++++++++++++++++--------------
 3 files changed, 60 insertions(+), 22 deletions(-)

diff --git a/SOLVER/UTILS/fieldtransform_force.sh b/SOLVER/UTILS/fieldtransform_force.sh
new file mode 100755
index 0000000..6c87649
--- /dev/null
+++ b/SOLVER/UTILS/fieldtransform_force.sh
@@ -0,0 +1,10 @@
+#!/bin/bash 
+set -e
+cd PX
+echo "Transforming PX"
+../xfield_transform
+cd ..
+cd PZ
+echo "Transforming PZ"
+../xfield_transform
+cd ..
diff --git a/SOLVER/UTILS/fieldtransform_moment.sh b/SOLVER/UTILS/fieldtransform_moment.sh
new file mode 100755
index 0000000..d8852fc
--- /dev/null
+++ b/SOLVER/UTILS/fieldtransform_moment.sh
@@ -0,0 +1,18 @@
+#!/bin/bash 
+set -e
+cd MZZ
+echo "Transforming MZZ"
+../xfield_transform
+cd ..
+cd MXX_P_MYY
+echo "Transforming MXX_P_MYY"
+../xfield_transform
+cd ..
+cd MXZ_MYZ
+echo "Transforming MXZ_MYZ"
+../xfield_transform
+cd ..
+cd MXY_MXX_M_MYY
+echo "Transforming MXY_MXX_M_MYY"
+../xfield_transform
+cd ..
diff --git a/SOLVER/submit.csh b/SOLVER/submit.csh
index 54c5b39..d64526b 100755
--- a/SOLVER/submit.csh
+++ b/SOLVER/submit.csh
@@ -283,29 +283,39 @@ endif
 # write a script that runs fieldtransform in all rundirs
 if ( $netcdf_requested == 'true') then
     if ( $simtype == 'moment' ) then
-        echo '#\!/bin/csh -f'           >  fieldtransform.csh
-        echo 'cd MZZ'              >> fieldtransform.csh
-        echo '../xfield_transform'   >> fieldtransform.csh
-        echo 'cd ..'                 >> fieldtransform.csh
-        echo 'cd MXX_P_MYY'        >> fieldtransform.csh
-        echo '../xfield_transform'   >> fieldtransform.csh
-        echo 'cd ..'                 >> fieldtransform.csh
-        echo 'cd MXZ_MYZ'          >> fieldtransform.csh
-        echo '../xfield_transform'   >> fieldtransform.csh
-        echo 'cd ..'                 >> fieldtransform.csh
-        echo 'cd MXY_MXX_M_MYY'    >> fieldtransform.csh
-        echo '../xfield_transform'   >> fieldtransform.csh
-        echo 'cd ..'                 >> fieldtransform.csh
-        chmod +x fieldtransform.csh
+        cp ../UTILS/fieldtransform_moment.sh fieldtransform.sh
+        #echo '#\!/bin/bash '              >  fieldtransform.sh
+        #echo 'set -e'                     >> fieldtransform.sh
+        #echo 'cd MZZ'                     >> fieldtransform.sh
+        #echo 'Transforming MZZ'           >> fieldtransform.sh
+        #echo '../xfield_transform'        >> fieldtransform.sh
+        #echo 'cd ..'                      >> fieldtransform.sh
+        #echo 'cd MXX_P_MYY'               >> fieldtransform.sh
+        #echo 'Transforming MXX_P_MYY'     >> fieldtransform.sh
+        #echo '../xfield_transform'        >> fieldtransform.sh
+        #echo 'cd ..'                      >> fieldtransform.sh
+        #echo 'cd MXZ_MYZ'                 >> fieldtransform.sh
+        #echo 'Transforming MXZ_MYZ'       >> fieldtransform.sh
+        #echo '../xfield_transform'        >> fieldtransform.sh
+        #echo 'cd ..'                      >> fieldtransform.sh
+        #echo 'cd MXY_MXX_M_MYY'           >> fieldtransform.sh
+        #echo 'Transforming MXY_MXX_M_MYY' >> fieldtransform.sh
+        #echo '../xfield_transform'        >> fieldtransform.sh
+        #echo 'cd ..'                      >> fieldtransform.sh
+        chmod +x fieldtransform.sh
     else if ( $simtype == 'force' ) then
-        echo '#bin/csh -f'           >  fieldtransform.csh
-        echo 'cd PX'               >> fieldtransform.csh
-        echo '../xfield_transform'   >> fieldtransform.csh
-        echo 'cd ..'                 >> fieldtransform.csh
-        echo 'cd PZ'               >> fieldtransform.csh
-        echo '../xfield_transform'   >> fieldtransform.csh
-        echo 'cd ..'                 >> fieldtransform.csh
-        chmod +x fieldtransform.csh
+        cp ../UTILS/fieldtransform_force.sh fieldtransform.sh
+        #echo '#\!/bin/bash '              >  fieldtransform.sh
+        #echo 'set -e'                     >> fieldtransform.sh
+        #echo 'cd PX'                      >> fieldtransform.sh
+        #echo 'Transforming PX'            >> fieldtransform.sh
+        #echo '../xfield_transform'        >> fieldtransform.sh
+        #echo 'cd ..'                      >> fieldtransform.sh
+        #echo 'cd PZ'                      >> fieldtransform.sh
+        #echo 'Transforming PZ'            >> fieldtransform.sh
+        #echo '../xfield_transform'        >> fieldtransform.sh
+        #echo 'cd ..'                      >> fieldtransform.sh
+        chmod +x fieldtransform.sh
     endif
 endif
 



More information about the CIG-COMMITS mailing list