1 |
heimbach |
1.1 |
#! /usr/bin/env bash |
2 |
|
|
|
3 |
jmc |
1.3 |
# $Header: /u/gcmpack/MITgcm/verification/lab_sea/input_ad/dorun.sh,v 1.2 2013/07/19 13:14:20 jmc Exp $ |
4 |
jmc |
1.2 |
# $Name: $ |
5 |
heimbach |
1.1 |
|
6 |
jmc |
1.3 |
# number of additional executions to perform is given by "add_DIVA_runs" |
7 |
|
|
# and corresponds to "nchklev_3" value in file "code_ad/tamc.h" |
8 |
|
|
add_DIVA_runs=4 |
9 |
heimbach |
1.1 |
|
10 |
jmc |
1.3 |
if test $# = 0 ; then |
11 |
|
|
rm -f costfunction*0000 costfinal divided.ctrl snapshot* |
12 |
|
|
#- not MPI run: |
13 |
|
|
echo "Run $add_DIVA_runs times + final run:" |
14 |
|
|
for ii in `seq 1 $add_DIVA_runs` ; do |
15 |
|
|
./mitgcmuv_ad > output_adm.txt.diva_${ii} |
16 |
|
|
echo " additional DIVA run # $ii : done" |
17 |
|
|
done |
18 |
|
|
./mitgcmuv_ad > output_adm.txt |
19 |
|
|
else |
20 |
|
|
if [ $1 -ge 1 ] ; then |
21 |
|
|
rm -f costfunction*0000 costfinal divided.ctrl snapshot* |
22 |
|
|
#- MPI run on $1 procs (note: may need to edit mpirun command): |
23 |
|
|
echo "Run $add_DIVA_runs times + final run (use 'mpirun -np $1' ):" |
24 |
|
|
for ii in `seq 1 $add_DIVA_runs` ; do |
25 |
|
|
mpirun -np $1 ./mitgcmuv_ad |
26 |
|
|
echo " additional DIVA run # $ii : done" |
27 |
|
|
mv -f STDOUT.0000 STDOUT.0000.diva_${ii} |
28 |
|
|
done |
29 |
|
|
mpirun -np $1 ./mitgcmuv_ad |
30 |
|
|
fi |
31 |
|
|
fi |