1 |
heimbach |
1.1.2.1 |
#!/bin/csh |
2 |
|
|
# script for running line search routine |
3 |
|
|
# * set line search parameters |
4 |
|
|
# * link control and gradient vector |
5 |
|
|
# * generate runtime parameter files |
6 |
|
|
# * run line search |
7 |
|
|
# heimbach@mit.edu 27-May-2003 |
8 |
|
|
|
9 |
|
|
# set parameters for namelist ECCO_OPTIM |
10 |
|
|
set optimcycle = 0 |
11 |
|
|
set numiter = 1 |
12 |
|
|
set nfunc = 3 |
13 |
|
|
set fmin = 300. |
14 |
|
|
set iprint = 10 |
15 |
|
|
set nupdate = 4 |
16 |
|
|
|
17 |
|
|
# set parameters for namelist ECCO_PARMS |
18 |
|
|
set expId = MIT_CE_000 |
19 |
|
|
|
20 |
|
|
# set parameters for namelist CTRL_NML and CTRL_PACKNAMES |
21 |
|
|
set ctrlname = ecco_ctrl |
22 |
|
|
set costname = ecco_cost |
23 |
|
|
|
24 |
|
|
# set system parameters |
25 |
|
|
set mitgcmdir = /cluster/scratch/month01/heimbach/ecco-branch/exe |
26 |
|
|
set optimdir = /cluster/scratch/month01/heimbach/ecco-branch/optim/exe |
27 |
|
|
|
28 |
|
|
# IDEALLY, NO MORE EDITING BEYOND THIS LINE. |
29 |
|
|
# --------------------------------------------------------------------- |
30 |
|
|
|
31 |
|
|
# do some stuff |
32 |
|
|
# |
33 |
|
|
if ( $optimcycle < 10 ) then |
34 |
|
|
set optsuffix = 000${optimcycle} |
35 |
|
|
else if ( $optimcycle < 100 ) then |
36 |
|
|
set optsuffix = 00${optimcycle} |
37 |
|
|
else if ( $optimcycle < 1000 ) then |
38 |
|
|
set optsuffix = 0${optimcycle} |
39 |
|
|
else |
40 |
|
|
set optsuffix = ${optimcycle} |
41 |
|
|
endif |
42 |
|
|
|
43 |
|
|
# go to wrkdir and proceed: |
44 |
|
|
# |
45 |
|
|
cd $optimdir |
46 |
|
|
rm -f data.* |
47 |
|
|
if ( $optimcycle == 0 ) then |
48 |
|
|
rm -f OPWARM? PH_?.dat *.opt0001 fort.94 |
49 |
|
|
endif |
50 |
|
|
|
51 |
|
|
cat >! data.optim << EOF |
52 |
|
|
# ******************************** |
53 |
|
|
# Off-line optimization parameters |
54 |
|
|
# ******************************** |
55 |
|
|
&ECCO_OPTIM |
56 |
|
|
optimcycle = $optimcycle, |
57 |
|
|
numiter = $numiter, |
58 |
|
|
nfunc = $nfunc, |
59 |
|
|
fmin = $fmin, |
60 |
|
|
iprint = $iprint, |
61 |
|
|
nupdate = $nupdate, |
62 |
|
|
& |
63 |
|
|
EOF |
64 |
|
|
|
65 |
|
|
cat >! data.ecco << EOF |
66 |
|
|
# *************** |
67 |
|
|
# ECCO parameters |
68 |
|
|
# *************** |
69 |
|
|
&ECCO_PARMS |
70 |
|
|
expId = '${expId}', |
71 |
|
|
& |
72 |
|
|
EOF |
73 |
|
|
|
74 |
|
|
cat >! data.ctrl << EOF |
75 |
|
|
# ********************* |
76 |
|
|
# ECCO controlvariables |
77 |
|
|
# ********************* |
78 |
|
|
&CTRL_NML |
79 |
|
|
& |
80 |
|
|
# ********************* |
81 |
|
|
# names for ctrl_pack/unpack |
82 |
|
|
# ********************* |
83 |
|
|
&CTRL_PACKNAMES |
84 |
|
|
ctrlname = '${ctrlname}', |
85 |
|
|
costname = '${costname}', |
86 |
|
|
& |
87 |
|
|
EOF |
88 |
|
|
|
89 |
|
|
ln -s ${mitgcmdir}/${ctrlname}_${expId}.opt${optsuffix} . |
90 |
|
|
ln -s ${mitgcmdir}/${costname}_${expId}.opt${optsuffix} . |
91 |
|
|
|
92 |
|
|
./optim.x >&! output_${optsuffix}.txt |
93 |
|
|
|
94 |
|
|
exit |
95 |
|
|
|