1 |
# This is a script in Bash. |
2 |
|
3 |
# This script collects input files necessary for the program |
4 |
# "etat0_lim" and runs "etat0_lim". Run this script in the directory |
5 |
# where you want "etat0_lim" to run. The "ln" command does not report |
6 |
# missing targets, so we check them first. |
7 |
|
8 |
# Specify directories: |
9 |
|
10 |
in_dir=~/Documents/Utilisation_LMDZ/Input_etat0_lim |
11 |
##in_dir=$workdir/LMDZE/Input_etat0_lim |
12 |
|
13 |
executable_dir=/home/guez/In_transit/LMDZE_work/Compil_prod_g95 |
14 |
##executable_dir=$workdir/LMDZE/Compil_prod |
15 |
|
16 |
res_dir=/home/guez/In_transit/LMDZE_work/Results_etat0_lim |
17 |
# (only for comparison with a previous run) |
18 |
|
19 |
read -p \ |
20 |
"Identifier for the set of parameters (\"*.def\" files and namelists)? " \ |
21 |
iel_id |
22 |
|
23 |
my_host=`hostname` |
24 |
|
25 |
if [[ $my_host = brodie ]] |
26 |
then |
27 |
# (The signal "ERR" does not exist with the old Bash version |
28 |
# 2.05.8 on Brodie.) |
29 |
set -xe |
30 |
else |
31 |
trap 'echo -e \\a; exit 1' ERR |
32 |
set -x |
33 |
fi |
34 |
|
35 |
if [[ $my_host = vierne ]] |
36 |
then |
37 |
# This is only useful if the program was compiled with G95: |
38 |
G95_FPU_UNDERFLOW=${G95_FPU_UNDERFLOW:+No} |
39 |
fi |
40 |
|
41 |
rm -f limit.nc start.nc startphy.nc coefoz_LMDZ.nc |
42 |
# (If these are symbolic links then the Fortran program might not be |
43 |
# able to replace them.) |
44 |
|
45 |
cd $in_dir |
46 |
test -f Albedo.nc |
47 |
test -f amipbc_sic_1x1.nc |
48 |
test -f amipbc_sst_1x1.nc |
49 |
test -f ECPHY.nc |
50 |
test -f ECDYN.nc |
51 |
test -f landiceref.nc |
52 |
test -f Relief.nc |
53 |
test -f Ozone/coefoz_v2_3.nc |
54 |
test -f Rugos.nc |
55 |
test -d $iel_id |
56 |
cd - |
57 |
|
58 |
ln -s -f $in_dir/Albedo.nc $in_dir/amipbc_*.nc $in_dir/ECPHY.nc $in_dir/ECDYN.nc $in_dir/landiceref.nc $in_dir/Relief.nc $in_dir/Rugos.nc $in_dir/Ozone/coefoz_v2_3.nc . |
59 |
|
60 |
rm -f *.def |
61 |
test -f $in_dir/$iel_id/run.def |
62 |
ln -s -f $in_dir/$iel_id/*.def . |
63 |
|
64 |
if [[ $my_host = brodie ]] |
65 |
then |
66 |
rsh brodie01 \ |
67 |
export F_PROGINF=YES \; \ |
68 |
cd $PWD \; \ |
69 |
$executable_dir/etat0_lim <$in_dir/$iel_id/etat0_lim_nml.txt \ |
70 |
>etat0_lim_out.txt 2>etat0_lim_err.txt |
71 |
elif [[ $my_host = zahir* ]] |
72 |
then |
73 |
hpmcount $executable_dir/etat0_lim <$in_dir/$iel_id/etat0_lim_nml.txt \ |
74 |
>etat0_lim_out.txt 2>etat0_lim_err.txt |
75 |
else |
76 |
time $executable_dir/etat0_lim <$in_dir/$iel_id/etat0_lim_nml.txt \ |
77 |
>etat0_lim_out.txt 2>etat0_lim_err.txt |
78 |
fi |
79 |
|
80 |
echo -e '\a' # beep |
81 |
set +x |
82 |
read -p "Previous run number for comparison [none] ? " |
83 |
if [[ -n $REPLY ]] |
84 |
then |
85 |
selective_diff.sh $res_dir/$REPLY . |
86 |
fi |