| 1 |
#!/bin/csh -f |
| 2 |
|
| 3 |
# Initialize file locations |
| 4 |
set loc = /phys/users/jorissen/feff85 #top of FEFF installation |
| 5 |
set bin = $loc/bin #executables |
| 6 |
set src = $loc/src #source files |
| 7 |
|
| 8 |
set dir = `pwd` |
| 9 |
|
| 10 |
# Initialize script control variables |
| 11 |
set all |
| 12 |
set refresh |
| 13 |
|
| 14 |
# Initialize compilation settings |
| 15 |
set compiler = ifc |
| 16 |
set options = "-O3 -mp1 -w -prec_div -pc80 -quiet" |
| 17 |
|
| 18 |
# Execution starts. |
| 19 |
cd $src |
| 20 |
|
| 21 |
# Process input options and execute instructions. |
| 22 |
alias sb 'shift; breaksw' |
| 23 |
while($#argv) |
| 24 |
switch ($1) |
| 25 |
case -h: # display help message |
| 26 |
goto help |
| 27 |
case -p: #change path |
| 28 |
set loc = $2 ; shift |
| 29 |
set bin = $loc/bin #executables |
| 30 |
set src = $loc/bin #source files |
| 31 |
cd $loc |
| 32 |
sb |
| 33 |
case -b: # change location of executables |
| 34 |
set bin = $2 ; shift ; sb |
| 35 |
case -s: # change location of source files |
| 36 |
set src = $2 ; shift ; sb |
| 37 |
case -n: |
| 38 |
if ($?refresh) unset refresh ; sb |
| 39 |
case -r: |
| 40 |
set refresh ; sb |
| 41 |
case -a: |
| 42 |
set all ; sb |
| 43 |
case -c: # change compiler |
| 44 |
set compiler = $2 ; shift ; sb |
| 45 |
case -o: # change compilation options |
| 46 |
set options = $2 ; shift ; sb |
| 47 |
case -lib: # compile libraries |
| 48 |
if ($?all) unset all |
| 49 |
cd PAR ; make src ; cd .. |
| 50 |
cd ATOM ; make src ; cd .. |
| 51 |
cd COMMON ; make src ; cd .. |
| 52 |
cd DEBYE ; make src ; cd .. |
| 53 |
cd EXCH ; make src ; cd .. |
| 54 |
cd MATH ; make src ; cd .. |
| 55 |
cd FOVRG ; make src ; cd .. |
| 56 |
cd TDLDA ; make src ; cd .. |
| 57 |
sb |
| 58 |
case 0: |
| 59 |
if ($?all) unset all |
| 60 |
if ($?refresh) then |
| 61 |
cd RDINP ; make src ; cd .. |
| 62 |
endif |
| 63 |
$compiler $options rdinp_tot.f -o $bin/rdinp |
| 64 |
echo "module 0 compiled - RDINP" |
| 65 |
sb |
| 66 |
case 1: |
| 67 |
if ($?all) unset all |
| 68 |
if ($?refresh) then |
| 69 |
cd POT ; make src ; cd .. |
| 70 |
endif |
| 71 |
$compiler $options pot_tot.f -o $bin/ffmod1 |
| 72 |
echo "module 1 done - POT" |
| 73 |
sb |
| 74 |
case 2: |
| 75 |
if ($?all) unset all |
| 76 |
if ($?refresh) then |
| 77 |
cd XSPH ; make src ; cd .. |
| 78 |
endif |
| 79 |
$compiler $options xsph_tot.f -o $bin/ffmod2 |
| 80 |
echo "module 2 done - XSPH" |
| 81 |
sb |
| 82 |
case 3: |
| 83 |
if ($?all) unset all |
| 84 |
if ($?refresh) then |
| 85 |
cd FMS ; make src ; cd .. |
| 86 |
endif |
| 87 |
$compiler $options -FI fms_tot.f -o $bin/ffmod3 |
| 88 |
echo "module 3 done - FMS" |
| 89 |
sb |
| 90 |
case 4: |
| 91 |
if ($?all) unset all |
| 92 |
if ($?refresh) then |
| 93 |
cd PATH ; make src ; cd .. |
| 94 |
endif |
| 95 |
$compiler $options path_tot.f -o $bin/ffmod4 |
| 96 |
echo "module 4 done - PATH" |
| 97 |
sb |
| 98 |
case 5: |
| 99 |
if ($?all) unset all |
| 100 |
if ($?refresh) then |
| 101 |
cd GENFMT ; make src ; cd .. |
| 102 |
endif |
| 103 |
$compiler $options genfmt_tot.f -o $bin/ffmod5 |
| 104 |
echo "module 5 done - GENFMT" |
| 105 |
sb |
| 106 |
case 6: |
| 107 |
if ($?all) unset all |
| 108 |
if ($?refresh) then |
| 109 |
cd FF2X ; make src ; cd .. |
| 110 |
endif |
| 111 |
$compiler $options ff2x_tot.f -o $bin/ffmod6 |
| 112 |
echo "module 6 done - FF2X" |
| 113 |
sb |
| 114 |
case 7: |
| 115 |
if ($?all) unset all |
| 116 |
if ($?refresh) then |
| 117 |
cd LDOS ; make src ; cd .. |
| 118 |
endif |
| 119 |
$compiler $options ldos_tot.f -o $bin/ldos |
| 120 |
echo "module 7 done - DOS" |
| 121 |
sb |
| 122 |
case 8: |
| 123 |
if ($?all) unset all |
| 124 |
if ($?refresh) then |
| 125 |
cd EELS ; make src ; cd .. |
| 126 |
endif |
| 127 |
$compiler $options -132 eels_tot.f -o $bin/ffmod8 |
| 128 |
echo "module 8 done - EELS" |
| 129 |
sb |
| 130 |
case 9: |
| 131 |
if ($?all) unset all |
| 132 |
if ($?refresh) then |
| 133 |
cd SO2CONV ; make src ; cd .. |
| 134 |
endif |
| 135 |
$compiler $options -132 so2_tot.f $EMS/src/ems.a -o $bin/so2conv |
| 136 |
echo "module 9 done - SO2CONV" |
| 137 |
sb |
| 138 |
case 99: |
| 139 |
if ($?all) unset all |
| 140 |
if ($?refresh) then |
| 141 |
cd MDFF ; make src ; cd .. |
| 142 |
endif |
| 143 |
$compiler $options -132 mdff_tot.f $EMS/src/ems.a -o $bin/ffmod99 |
| 144 |
echo "module 99 done - MDFF" |
| 145 |
sb |
| 146 |
default: |
| 147 |
echo "ignoring unknown switch :" $1 |
| 148 |
sb |
| 149 |
endsw |
| 150 |
end |
| 151 |
|
| 152 |
if ($?all) then |
| 153 |
if ($?refresh) then |
| 154 |
cd PAR ; make src ; cd .. |
| 155 |
cd ATOM ; make src ; cd .. |
| 156 |
cd COMMON ; make src ; cd .. |
| 157 |
cd DEBYE ; make src ; cd .. |
| 158 |
cd EXCH ; make src ; cd .. |
| 159 |
cd MATH ; make src ; cd .. |
| 160 |
cd FOVRG ; make src ; cd .. |
| 161 |
cd TDLDA ; make src ; cd .. |
| 162 |
make src |
| 163 |
endif |
| 164 |
$compiler $options rdinp_tot.f -o $bin/rdinp |
| 165 |
$compiler $options pot_tot.f -o $bin/ffmod1 |
| 166 |
$compiler $options ldos_tot.f -o $bin/ldos |
| 167 |
$compiler $options xsph_tot.f -o $bin/ffmod2 |
| 168 |
$compiler $options -FI fms_tot.f -o $bin/ffmod3 |
| 169 |
$compiler $options path_tot.f -o $bin/ffmod4 |
| 170 |
$compiler $options genfmt_tot.f -o $bin/ffmod5 |
| 171 |
$compiler $options ff2x_tot.f -o $bin/ffmod6 |
| 172 |
$compiler $options -132 eels_tot.f -o $bin/ffmod8 |
| 173 |
$compiler $options so2_tot.f -o $bin/so2conv |
| 174 |
$compiler $options -132 mdff_tot.f $EMS/src/ems.a -o $bin/ffmod99 |
| 175 |
echo "modules 0 to 8 done - FEFF" |
| 176 |
endif |
| 177 |
|
| 178 |
|
| 179 |
exit 0 |
| 180 |
|
| 181 |
|
| 182 |
help: |
| 183 |
echo "Not ready yet - read the code :-)." |
| 184 |
|
| 185 |
exit 0 |
| 186 |
|