1 |
heimbach |
1.2 |
# Example: Subtropical North Atlantic and Labrador Sea Areas |
2 |
|
|
# ========================================================== |
3 |
|
|
# - forward/adjoint run |
4 |
|
|
# - optimization cost function |
5 |
|
|
# - The input data is real*8 |
6 |
dimitri |
1.7 |
# - The tests below assume that a "taf" executable is available |
7 |
|
|
# (http://www.fastopt.de/) |
8 |
heimbach |
1.2 |
|
9 |
|
|
>>>>>>>>>>>>>>>>>>>> DO THESE THINGS FIRST <<<<<<<<<<<<<<<<<<<< |
10 |
heimbach |
1.5 |
cd verification/natl_box_adjoint |
11 |
|
|
gunzip results*/output*.gz |
12 |
|
|
mkdir exe |
13 |
dimitri |
1.7 |
cd input |
14 |
|
|
wget -nd -r -A"PH*" http://channel.mit.edu/datasets/MITgcm_input_files/MITgcm/verification/natl_box_adjoint/input |
15 |
|
|
cd ../input_seaice |
16 |
|
|
wget -nd -r -A"*labsea*" http://channel.mit.edu/datasets/MITgcm_input_files/MITgcm/verification/natl_box_adjoint/input_seaice |
17 |
|
|
wget -nd -r -A"pickup*" http://channel.mit.edu/datasets/MITgcm_input_files/MITgcm/verification/natl_box_adjoint/input_seaice |
18 |
heimbach |
1.2 |
>>>>>>>>>>>>>>>>>>>> DO THESE THINGS FIRST <<<<<<<<<<<<<<<<<<<< |
19 |
|
|
|
20 |
|
|
#################### |
21 |
|
|
# Experiment no. 1 # |
22 |
|
|
#################### |
23 |
|
|
# Use air-sea fluxes as controls (standard case): |
24 |
|
|
# perform gradient checks for first four elements of the |
25 |
|
|
# heat flux part of the control vector (grdchkvarindex = 3). |
26 |
|
|
# - with GMREDI, KPP, and shortwave heating |
27 |
|
|
# - 4 timesteps |
28 |
|
|
|
29 |
|
|
# Compile code in build/: |
30 |
|
|
cd ../build |
31 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code |
32 |
heimbach |
1.2 |
make depend |
33 |
|
|
make adall |
34 |
|
|
|
35 |
|
|
# To run: |
36 |
|
|
cd ../exe |
37 |
|
|
cp ../input/* . |
38 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
39 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
40 |
|
|
grep grad-res output.txt |
41 |
|
|
# A reference output is in: |
42 |
|
|
grep grad-res ../results/output.txt_adm |
43 |
|
|
|
44 |
|
|
|
45 |
|
|
#################### |
46 |
|
|
# Experiment no. 2 # |
47 |
|
|
#################### |
48 |
|
|
# Use bulk formulae and atmospheric state controls |
49 |
|
|
# (only differences to experiment 1 are in |
50 |
|
|
# ECCO_CPPOPTIONS.h and in data.grdchk): |
51 |
|
|
# perform gradient checks for first four elements of the |
52 |
|
|
# air temperture part of the control vector (grdchkvarindex = 7). |
53 |
|
|
|
54 |
|
|
# Compile code in build/: |
55 |
|
|
cd ../build |
56 |
|
|
rm -f *.o *.f *.p rii_files *.flow |
57 |
|
|
rm -f *.F *.h *.c Makefile* *.template genmake_* |
58 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code_bulk |
59 |
heimbach |
1.2 |
make depend |
60 |
|
|
make adall |
61 |
|
|
|
62 |
|
|
# To run: |
63 |
|
|
cd ../exe |
64 |
|
|
cp ../input_bulk/* . |
65 |
heimbach |
1.6 |
cp ../input_bulk/data.grdchk_precip data.grdchk |
66 |
heimbach |
1.2 |
cp ../input/PH_*.data . |
67 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
68 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
69 |
|
|
grep grad-res output.txt |
70 |
|
|
# A reference output is in: |
71 |
|
|
grep grad-res ../results_bulk/output.txt_adm |
72 |
|
|
|
73 |
|
|
|
74 |
|
|
#################### |
75 |
|
|
# Experiment no. 4 # |
76 |
|
|
#################### |
77 |
|
|
# Same as exp. 2, but with ALLOW_SEAICE defined and useseaice = .true. |
78 |
|
|
|
79 |
|
|
# Compile code in build/: |
80 |
|
|
cd ../build |
81 |
|
|
rm -f *.o *.f *.p rii_files *.flow |
82 |
|
|
rm -f *.F *.h *.c Makefile* *.template genmake_* |
83 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code_seaice |
84 |
heimbach |
1.2 |
cp ../code_seaice/SEAICE_OPTIONS.h.FLUXES SEAICE_OPTIONS.h |
85 |
|
|
make depend |
86 |
|
|
make adall |
87 |
|
|
|
88 |
|
|
# To run: |
89 |
|
|
cd ../exe |
90 |
|
|
cp ../input_bulk/* . |
91 |
heimbach |
1.6 |
cp ../input_bulk/data.grdchk_precip data.grdchk |
92 |
heimbach |
1.2 |
cp ../input_seaice/data.seaice.cgrid data.seaice |
93 |
|
|
cp ../input_seaice/data.pkg . |
94 |
|
|
cp ../input/PH_*.data . |
95 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
96 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
97 |
|
|
grep grad-res output.txt |
98 |
|
|
# A reference output is in: |
99 |
heimbach |
1.4 |
grep grad-res ../results_seaice/output_exp4.txt_adm |
100 |
heimbach |
1.2 |
|
101 |
|
|
|
102 |
|
|
#################### |
103 |
|
|
# Experiment no. 5 # |
104 |
|
|
#################### |
105 |
|
|
# Same as exp. 4, but using sea-ice bulk formulae. |
106 |
|
|
# This experiment tests pkg/seaice bulk formulae over open water. |
107 |
|
|
# No sea-ice is formed anywhere in the domain. |
108 |
|
|
|
109 |
|
|
# Compile code in build/: |
110 |
|
|
cd ../build |
111 |
|
|
rm -f *.o *.f *.p rii_files *.flow |
112 |
|
|
rm -f *.F *.h *.c Makefile* *.template genmake_* |
113 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code_seaice |
114 |
heimbach |
1.2 |
make depend |
115 |
|
|
make adall |
116 |
|
|
|
117 |
|
|
# To run: |
118 |
|
|
cd ../exe |
119 |
|
|
cp ../input_bulk/* . |
120 |
heimbach |
1.6 |
cp ../input_bulk/data.grdchk_precip data.grdchk |
121 |
heimbach |
1.2 |
cp ../input_seaice/data.seaice.cgrid data.seaice |
122 |
|
|
cp ../input_seaice/data.pkg . |
123 |
|
|
cp ../input/PH_*.data . |
124 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
125 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
126 |
|
|
grep grad-res output.txt |
127 |
|
|
# A reference output is in: |
128 |
|
|
grep grad-res ../results_seaice/output_exp5.txt_adm |
129 |
|
|
|
130 |
|
|
|
131 |
|
|
#################### |
132 |
|
|
# Experiment no. 6 # |
133 |
|
|
#################### |
134 |
|
|
# Same as experiment 5, but in the Labrador Sea rather than in |
135 |
|
|
# the North Atlantic subduction region. The cost function is |
136 |
|
|
# total ice volume over the 4-hour test period. |
137 |
|
|
# |
138 |
|
|
# The cost function data files are not used. They contain: |
139 |
|
|
# labsea_TP_fields : filled with -9999 |
140 |
|
|
# labsea_TP_mean : hour 100 ssh (cm) of lab_sea experiment |
141 |
|
|
# labsea_ERS_fields : filled with -9999 |
142 |
|
|
# labsea_SST_fields : 14 * Levitus annual mean SST |
143 |
|
|
# labsea_Lev.ptmp : 14 * Levitus annual mean temperature |
144 |
|
|
# labsea_Lev.salt : 14 * Levitus annual mean salinity |
145 |
|
|
# labsea_ssh.err : filled with -9999 |
146 |
|
|
# labsea_geoid.err : constant 0.2 with -9999 landmask |
147 |
|
|
# labsea_totflux.err : 100 with -9999 landmask |
148 |
|
|
# labsea_pme.err : 4e-8 with -9999 landmask |
149 |
|
|
# labsea_ustress.err : 3 with -9999 landmask |
150 |
|
|
# labsea_vstress.err : 3 with -9999 landmask |
151 |
|
|
|
152 |
|
|
# To run: |
153 |
|
|
cd ../exe |
154 |
|
|
cp ../input_seaice/* . |
155 |
|
|
cp ../input_bulk/data.grdchk . |
156 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
157 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
158 |
|
|
grep grad-res output.txt |
159 |
|
|
# A reference output is in: |
160 |
|
|
grep grad-res ../results_seaice/output_exp6.txt_adm |
161 |
|
|
|
162 |
heimbach |
1.8 |
#################### |
163 |
|
|
# Experiment no. 6a # |
164 |
|
|
#################### |
165 |
|
|
# Same as experiment 6, but cost function is now misfit between |
166 |
|
|
# daily mean seaice model AREA (fractional ice coverage) and |
167 |
|
|
# Scanning Microwave Radiometer (SMR) observations; |
168 |
|
|
# fileneme: labsea_daily92to03_20x16_ICECONC |
169 |
|
|
# Gradient check needs to run long enough (e.g. 240 timesteps) |
170 |
|
|
# for sufficiently large gradients to build. |
171 |
|
|
# |
172 |
|
|
# To run: |
173 |
|
|
cd ../exe |
174 |
|
|
cp ../input_seaice/* . |
175 |
|
|
cp ../input_seaice/data.240 data |
176 |
|
|
cp ../input_seaice/data.seaice.cost_smrarea data.seaice |
177 |
|
|
cp ../input_bulk/data.grdchk . |
178 |
|
|
../build/mitgcmuv_ad >&! output.txt |
179 |
|
|
# To verify the results of the gradient check, type: |
180 |
|
|
grep grad-res output.txt |
181 |
|
|
# A reference output is in: |
182 |
|
|
grep grad-res ../results_seaice/output_exp6a.txt_adm |
183 |
|
|
|
184 |
heimbach |
1.2 |
|
185 |
|
|
#################### |
186 |
|
|
# Experiment no. 7 # |
187 |
|
|
#################### |
188 |
|
|
# Same as experiment 6, but finite difference gradient check for |
189 |
|
|
# air temperature is computed and compared for the complete domain. |
190 |
|
|
# |
191 |
|
|
# Notes: |
192 |
|
|
# variables xx_* contain control vector perturbation |
193 |
|
|
# variables adxx_* contain cost function gradient relative to control |
194 |
|
|
|
195 |
|
|
# To run: |
196 |
|
|
cd ../exe |
197 |
|
|
cp ../input_seaice/* . |
198 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
199 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
200 |
|
|
grep grad-res output.txt > grad-res.txt |
201 |
dimitri |
1.7 |
cd ../results_seaice |
202 |
heimbach |
1.2 |
# plot with matlab: |
203 |
|
|
matlab |
204 |
|
|
lookat_exp8 |
205 |
|
|
|
206 |
|
|
|
207 |
|
|
#################### |
208 |
|
|
# Experiment no. 8 # |
209 |
|
|
#################### |
210 |
|
|
# Same as experiment 7, but starting from a checkpoint file. |
211 |
|
|
|
212 |
|
|
# To run: |
213 |
dimitri |
1.7 |
cd ../exe |
214 |
|
|
cp ../input_seaice/* . |
215 |
heimbach |
1.2 |
cp data.001 data |
216 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
217 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
218 |
dimitri |
1.7 |
grep grad-res output.txt > grad-res.txt |
219 |
|
|
cd ../results_seaice |
220 |
heimbach |
1.2 |
matlab |
221 |
|
|
lookat_exp8 |
222 |
|
|
|
223 |
|
|
|
224 |
|
|
#################### |
225 |
|
|
# Experiment no. 9 # |
226 |
|
|
#################### |
227 |
|
|
# Same as experiment 8, but starting from time step 180. |
228 |
|
|
# This includes a location (12,8) which experiences a phase |
229 |
|
|
# transition from no-ice to sea-ice, and which therefore has |
230 |
|
|
# a very large and inaccurate gradient. |
231 |
|
|
|
232 |
|
|
# To run: |
233 |
dimitri |
1.7 |
cd ../exe |
234 |
|
|
cp ../input_seaice/* . |
235 |
heimbach |
1.2 |
cp data.180 data |
236 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
237 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
238 |
dimitri |
1.7 |
grep grad-res output.txt > grad-res.txt |
239 |
|
|
cd ../results_seaice |
240 |
heimbach |
1.2 |
matlab |
241 |
|
|
lookat_exp8 |
242 |
|
|
|
243 |
|
|
|
244 |
|
|
##################### |
245 |
|
|
# Experiment no. 10 # |
246 |
|
|
##################### |
247 |
|
|
# Set up a 100-day sensitivity experiment. |
248 |
|
|
# Things start falling apart, see below. |
249 |
|
|
# Longer integrations periods cause NANs in adjoint gradient. |
250 |
|
|
# Note: cost_ssh is hardwired for 1-day ssh records |
251 |
|
|
# "topexperiod" in data.cost is never used. |
252 |
|
|
|
253 |
|
|
# Compile code in build/: |
254 |
|
|
cd ../build |
255 |
|
|
rm -f *.o *.f *.p rii_files *.flow |
256 |
|
|
rm -f *.F *.h *.c Makefile* *.template genmake_* |
257 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code_seaice |
258 |
heimbach |
1.2 |
make depend |
259 |
|
|
make adall |
260 |
|
|
make ftlall |
261 |
|
|
|
262 |
|
|
# To run: |
263 |
|
|
# PH: I modified data to run 24 timesteps only |
264 |
|
|
cd ../exe |
265 |
|
|
cp ../input_seaice/* . |
266 |
|
|
cp data.24 data |
267 |
|
|
cp ../input_bulk/data.grdchk . |
268 |
|
|
# run the ADM |
269 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt_adm |
270 |
heimbach |
1.2 |
# run the TLM |
271 |
dimitri |
1.7 |
../build/mitgcmuv_ftl >&! output.txt_tlm |
272 |
heimbach |
1.2 |
|
273 |
|
|
# For 100 days, adjoint gradient is NAN |
274 |
|
|
|
275 |
|
|
# Following table compares finite difference gradient for various choices |
276 |
|
|
# of grdchk_eps. |
277 |
|
|
1.d-12 -.177327175E+20 0.140230277E+20 -.254542273E+20 0.138603531E+19 |
278 |
|
|
1.d-8 0.174714613E+16 -.527867903E+15 0.403581037E+15 0.377322748E+12 |
279 |
|
|
1.d-4 0.999954825E+11 0.156018218E+12 -.474931072E+11 -.357260091E+11 |
280 |
|
|
1.d-2 0.634576350E+09 -.185440863E+10 -.599212833E+09 -.334417056E+10 |
281 |
|
|
|
282 |
|
|
# Following table compares adjoint and finite difference gradient for |
283 |
|
|
# various choices of nTimeSteps |
284 |
|
|
# with nTimeSteps=4 |
285 |
|
|
adj grad 0.103151639E+00 0.308058453E+00 -.732758366E+04 -.161844794E+06 |
286 |
|
|
1.d-4 0.305175781E+00 0.305175781E+00 -.732757568E+04 -.161844788E+06 |
287 |
|
|
# with nTimeSteps=24 |
288 |
|
|
adj grad 0.137444822E+04 0.365984818E+04 0.256198267E+05 -.204077640E+06 |
289 |
|
|
1.d-4 0.137313843E+04 0.365982056E+04 0.256221008E+05 -.204077454E+06 |
290 |
|
|
# with nTimeSteps=240 |
291 |
|
|
adj grad 0.443328852E+39 -.133652133E+38 -.905448973E+38 -.598093614E+40 |
292 |
|
|
1.d-4 -.209616183E+10 0.257127391E+10 -.917457365E+10 0.104622205E+10 |
293 |
|
|
# with nTimeSteps=480 |
294 |
|
|
adj grad -.217869560E+39 0.656820132E+37 0.444973903E+38 0.293927165E+40 |
295 |
|
|
1.d-4 -.848343350E+09 0.186724144E+10 -.768266406E+10 0.188919420E+10 |
296 |
|
|
# with nTimeSteps=960 |
297 |
|
|
adj grad -.125255788E+49 0.377613667E+47 0.255820763E+48 0.168982206E+50 |
298 |
|
|
1.d-4 0.683065531E+10 -.241320782E+11 -.359080729E+11 0.222805821E+11 |
299 |
|
|
# with nTimeSteps=1920 |
300 |
|
|
adj grad 0.993422132E+94 -.299490969E+93 -.202895220E+94 -.134022280E+96 |
301 |
|
|
1.d-4 0.677603652E+12 0.115923780E+12 -.383606246E+12 -.393716060E+12 |
302 |
|
|
# with nTimeSteps=2400 |
303 |
|
|
adj grad 0.204800998+114 -.617421814+112 -.418282846+113 -.276296408+115 |
304 |
|
|
1.d-4 0.796041873E+12 0.280172355E+12 -.429971310E+12 -.655627972E+12 |
305 |
|
|
# with nTimeSteps=3600 |
306 |
|
|
adj grad 0.123800977+143 -.373227788+141 -.252849475+142 -.167019524+144 |
307 |
|
|
1.d-4 0.154270431E+12 0.246315840E+12 0.392679620E+12 0.816557457E+11 |
308 |
|
|
|
309 |
|
|
# With cost_ice_flag = 2 |
310 |
|
|
# adj grad 0.500216760+194 -.353450868+194 -.799381224+195 -.173412383+194 |
311 |
|
|
# 1.d-04 -.327859949E+08 -.300222927E+10 0.252204364E+09 -.658448165E+10 |
312 |
|
|
# 1.d-03 -.572185323E+08 0.614938314E+08 -.850914638E+09 0.248982808E+08 |
313 |
|
|
# 1.d-02 -.624721639E+07 -.147537212E+08 -.114497432E+09 -.358163526E+08 |
314 |
|
|
# 1.d-01 0.603974309E+07 -.684786020E+07 -.149337451E+09 -.601790080E+07 |
315 |
|
|
# 1.d-00 -.497381448E+06 -.404972657E+05 -.142684281E+09 -.501277195E+08 |
316 |
|
|
|
317 |
|
|
# 100 day experiment with cost_ice_flag = 3, but in North Atlantic |
318 |
|
|
# domain, i.e., with no sea-ice is OK |
319 |
|
|
adj grad 0.234593317E+17 0.166950683E+17 0.238665515E+17 0.249850733E+17 |
320 |
|
|
1.d-4 0.234313954E+17 0.166674930E+17 0.238322031E+17 0.249217155E+17 |
321 |
|
|
|
322 |
|
|
# with same order of magnitude results as those from pkg/exf bulk formulae |
323 |
|
|
adj grad 0.279968788E+17 0.226979382E+17 0.269224396E+17 0.323359773E+17 |
324 |
|
|
1.d-4 0.279944626E+17 0.226935335E+17 0.269274317E+17 0.323399293E+17 |
325 |
|
|
|
326 |
|
|
# 10 day experiment with cost_ice_flag = 3 is OK |
327 |
|
|
adj grad 0.353941629E+17 0.955451129E+16 -.265793314E+17 0.232229067E+16 |
328 |
|
|
1.d-4 0.353943893E+17 0.955563114E+16 -.265195776E+17 0.232137949E+16 |
329 |
|
|
1-fd/adj -.639540199E-05 -.117207086E-03 0.224813073E-02 0.392362727E-03 |
330 |
|
|
|
331 |
|
|
# 100 day experiment with cost_ice_flag = 3 fails |
332 |
|
|
adj grad 0.134326162+285 0.434825818+285 0.353667347+285 -.121707013+286 |
333 |
|
|
1.d-4 -.248910431E+20 -.581887317E+20 0.530805948E+18 0.554441614E+20 |
334 |
|
|
|
335 |
|
|
# 100 day experiment with cost_ice_flag = 4 fails |
336 |
|
|
adj grad 0.942881479+279 0.305219181+280 0.248251262+280 -.854303341+280 |
337 |
|
|
1.d-4 0.550158678E+19 -.107685572E+20 -.139042495E+20 0.445855968E+20 |
338 |
|
|
|
339 |
|
|
# 100 day experiment with cost_ice_flag = 5 fails |
340 |
|
|
adj grad 0.149606733+285 0.484290396+285 0.393899563+285 -.135552065+286 |
341 |
|
|
1.d-4 -.300535490E+20 -.689378119E+20 0.300954675E+19 0.767231924E+20 |
342 |
|
|
|
343 |
|
|
|
344 |
|
|
# With cost_ice_flag = 6, i.e., a quadratic cost function |
345 |
|
|
# 1.d-04 -.525101466E+01 -.328685504E+03 0.267928050E+02 -.563072857E+03 |
346 |
|
|
# 1.d-03 -.313705632E+01 0.463320361E+01 -.458088751E+02 0.571140277E+00 |
347 |
|
|
# 1.d-02 -.232806373E+00 -.104311448E+01 0.173597838E+02 -.394705606E+01 |
348 |
|
|
# 1.d-01 0.515424287E+00 -.578962143E+00 0.108556846E+02 -.563596055E+00 |
349 |
|
|
# 1.d-00 -.480177391E-01 -.327366136E-02 0.107190195E+02 -.498391127E+01 |
350 |
|
|
# adj grad NAN NAN NAN NAN |
351 |
|
|
|
352 |
|
|
# 100 day experiments with all albedos set to a constant 0.4, with |
353 |
|
|
# IMAX_TICE=50, and with HSNOW=0 also fail with NANs |
354 |
|
|
|
355 |
|
|
# 100-day with undef ALLOW_GMREDI |
356 |
|
|
adj grad 0.846385475+258 0.198955589+259 0.729012228+259 0.320320183+256 |
357 |
|
|
1.d-4 -.577220699E+12 -.987464011E+12 -.342421713E+12 -.553564700E+12 |
358 |
|
|
|
359 |
|
|
# Adjoint gradient is OK for 100 days is KPP and GM |
360 |
|
|
# are undefined in CPP_OPTIONS file: |
361 |
|
|
adj grad 0.717330426E+06 0.106802371E+07 0.443223909E+06 -.581863641E+08 |
362 |
|
|
1.d-4 0.717581787E+06 0.106213684E+07 0.441527100E+06 -.581863293E+08 |
363 |
|
|
# Above experiment fails with NANs when extended to 375 days |
364 |
|
|
# but it works OK is SEAICE_initialHEFF = 0.0 instead of 1.0 |
365 |
|
|
adj grad -.256772533E+05 -.782710992E+05 -.273621212E+05 -.133527839E+09 |
366 |
|
|
1.d-4 -.256640625E+05 -.779858398E+05 -.272338867E+05 -.133528066E+09 |
367 |
|
|
# 10-yr experiment with above parameters fails with NANs |
368 |
|
|
|
369 |
|
|
# 100-day with yneg=0 in growth.F |
370 |
|
|
adj grad -.246704815E+07 -.171229406E+09 -.113862028E+08 -.156706660E+08 |
371 |
|
|
1.d-4 -.246699463E+07 -.171229277E+09 -.113861792E+08 -.156706763E+08 |
372 |
|
|
# 375-day with yneg=0 in growth.F |
373 |
|
|
(in progress) |
374 |
|
|
|
375 |
|
|
|
376 |
|
|
##################### |
377 |
|
|
# Experiment no. 11 # |
378 |
|
|
##################### |
379 |
|
|
>>>>>>>>>> PH: THIS ONE NOT YET UPDATED <<<<<<<<<< |
380 |
|
|
# Same as experiment 8, but using 2-CPU MPI configuration. |
381 |
|
|
|
382 |
|
|
# Compile code in bin/: |
383 |
|
|
cd ../bin |
384 |
|
|
rm -rf *.o *.f *.p rii_files |
385 |
|
|
rm -rf *.F *.h *.c Makefile* |
386 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/*.h . |
387 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/.genmakerc . |
388 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/SIZE.h.MPI SIZE.h |
389 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/CPP_EEOPTIONS.h.MPI CPP_EEOPTIONS.h |
390 |
|
|
# Configure and compile the code: |
391 |
|
|
../tools/genmake -mpi -makefile |
392 |
|
|
# ==> on alhena use: |
393 |
|
|
# ../tools/genmake -platform=o2k -mpi -makefile |
394 |
|
|
make depend |
395 |
|
|
# Generate the adjoint code: |
396 |
|
|
cd ../adjoint |
397 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/makefile . |
398 |
|
|
make adtaf |
399 |
|
|
make adchange |
400 |
|
|
rm -f makefile |
401 |
|
|
# Go back and compile the code: |
402 |
|
|
cd ../bin |
403 |
|
|
make |
404 |
|
|
# To run: |
405 |
|
|
cd ../exe |
406 |
|
|
cp ../verification/natl_box_adjoint/input_seaice/* . |
407 |
|
|
cp data.001 data |
408 |
|
|
cp ../verification/natl_box_adjoint/input_bulk/data.grdchk . |
409 |
|
|
mpirun -np 2 mitgcmuv |
410 |
|
|
# To verify the results of the gradient check, type: |
411 |
|
|
grep "ph-grd 3" STDOUT.0000 |
412 |
|
|
# To plot adjoint sensitivy fields |
413 |
|
|
cd ../verification/natl_box_adjoint/results_seaice |
414 |
|
|
matlab |
415 |
|
|
lookat_exp10 |
416 |
|
|
|
417 |
|
|
|
418 |
|
|
##################### |
419 |
|
|
# Experiment no. 12 # |
420 |
|
|
##################### |
421 |
|
|
# Same as experiment 6, but including LSR dynamic solver. |
422 |
|
|
|
423 |
|
|
# Compile code in build/: |
424 |
|
|
cd ../build |
425 |
|
|
rm -f *.o *.f *.p rii_files *.flow |
426 |
|
|
rm -f *.F *.h *.c Makefile* *.template genmake_* |
427 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code_seaice |
428 |
heimbach |
1.2 |
cp ../code_seaice/SEAICE_OPTIONS.h.DYN SEAICE_OPTIONS.h |
429 |
|
|
make depend |
430 |
|
|
make adall |
431 |
|
|
make ftlall |
432 |
|
|
|
433 |
|
|
# To run: |
434 |
|
|
cd ../exe |
435 |
|
|
cp ../input_seaice/* . |
436 |
|
|
cp data.seaice.lsr data.seaice |
437 |
|
|
cp ../input_bulk/data.grdchk . |
438 |
|
|
# run the ADM |
439 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt_adm |
440 |
heimbach |
1.2 |
# run the TLM |
441 |
dimitri |
1.7 |
../build/mitgcmuv_ftl >&! output.txt_tlm |
442 |
heimbach |
1.2 |
|
443 |
|
|
# To verify the results of the gradient check, type: |
444 |
|
|
grep grad-res output.txt_adm |
445 |
|
|
# A reference output is in: |
446 |
|
|
grep grad-res ../results_seaice/output_exp12.txt_adm |
447 |
|
|
|
448 |
|
|
|
449 |
|
|
##################### |
450 |
|
|
# Experiment no. 13 # |
451 |
|
|
##################### |
452 |
|
|
# Same as experiment 12, but finite difference gradient check for |
453 |
|
|
# air temperature is computed and compared for the complete domain. |
454 |
|
|
|
455 |
|
|
# To run: |
456 |
|
|
cd ../exe |
457 |
|
|
cp ../input_seaice/* . |
458 |
|
|
cp data.seaice.lsr data.seaice |
459 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt_adm |
460 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
461 |
|
|
grep grad-res output.txt_adm > grad-res.txt |
462 |
|
|
cd ../results_seaice |
463 |
|
|
matlab |
464 |
|
|
lookat_exp8 |
465 |
|
|
|
466 |
|
|
|
467 |
|
|
##################### |
468 |
|
|
# Experiment no. 14 # |
469 |
|
|
##################### |
470 |
|
|
>>>>>>>>>> PH: THIS ONE NOT YET UPDATED <<<<<<<<<< |
471 |
|
|
# Same as in 12 but for a 100-day sensitivity experiment. |
472 |
|
|
|
473 |
|
|
# Compile code in bin/: |
474 |
|
|
cd ../bin |
475 |
|
|
rm -rf *.o *.f *.p rii_files |
476 |
|
|
rm -rf *.F *.h *.c Makefile* |
477 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/*.h . |
478 |
|
|
rm -f tamc.h |
479 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/.genmakerc . |
480 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/SEAICE_OPTIONS.h.MULTILEVEL SEAICE_OPTIONS.h |
481 |
|
|
# Configure and compile the code: |
482 |
|
|
../tools/genmake -makefile |
483 |
|
|
make depend |
484 |
|
|
# Generate the adjoint code: |
485 |
|
|
cd ../adjoint |
486 |
|
|
cp ../verification/natl_box_adjoint/code_seaice/makefile . |
487 |
|
|
make adtaf |
488 |
|
|
make adchange |
489 |
|
|
rm -f makefile |
490 |
|
|
# Go back and compile the code: |
491 |
|
|
cd ../bin |
492 |
|
|
make |
493 |
|
|
# To run: |
494 |
|
|
cd ../exe |
495 |
|
|
cp ../verification/natl_box_adjoint/input_seaice/* . |
496 |
|
|
cp data.100day data |
497 |
|
|
cp ../verification/natl_box_adjoint/input_bulk/data.grdchk . |
498 |
|
|
cp data.seaice.lsr data.seaice |
499 |
dimitri |
1.7 |
../build/mitgcmuv >&! output.txt |
500 |
heimbach |
1.2 |
# To verify the results of the gradient check, type: |
501 |
|
|
grep "ph-grd 3" output.txt |
502 |
|
|
|
503 |
|
|
# For 100-day experiment, with cost_ice_flag = 1, the adjoint gradient |
504 |
|
|
# blows up, as in Exp. 10 |
505 |
|
|
# 1.d-04 0.251994583E+11 -.899637862E+10 0.372048919E+10 -.344972301E+10 |
506 |
|
|
# adj grad -.160660304+210 -.378763253+210 -.239235971+211 -.386444881+209 |
507 |
|
|
|
508 |
|
|
# With cost_ice_flag = 2, i.e., mean sea-ice area |
509 |
|
|
# 1.d-04 -.152618243E+11 0.605974121E+06 -.155375485E+11 -.153368205E+11 |
510 |
|
|
# adj grad 0.000000000E+00 0.000000000E+00 -.124076923E+09 0.000000000E+00 |
511 |
|
|
|
512 |
|
|
# With cost_ice_flag = 6, i.e., a quadratic cost function |
513 |
|
|
# 1.d-12 -.106128607E+12 0.106330784E+12 -.106446555E+12 -.106237252E+12 |
514 |
|
|
# 1.d-08 0.106450924E+08 0.103670536E+05 0.349155947E+05 0.335081902E+05 |
515 |
|
|
# 1.d-04 -.106143365E+04 0.206965778E+00 -.105672737E+04 -.106326894E+04 |
516 |
|
|
# 1.d-02 -.120891636E-02 0.106325012E+02 0.841459268E+01 -.107119297E+02 |
517 |
|
|
# 1.d-01 -.102221209E-02 -.124805738E-02 0.821489714E+01 -.331974254E-02 |
518 |
|
|
# 1.d-00 0.113825328E-03 -.105881751E+00 0.104550010E+02 -.106209116E+00 |
519 |
|
|
# adj grad 0.000000000E+00 0.000000000E+00 0.887775373E+01 0.000000000E+00 |
520 |
|
|
|
521 |
|
|
|
522 |
|
|
##################### |
523 |
|
|
# Experiment no. 15 # |
524 |
|
|
##################### |
525 |
|
|
# Same as experiment 6, but with SEAICE_MULTILEVEL. |
526 |
|
|
|
527 |
|
|
# Compile code in build/: |
528 |
|
|
rm -f *.o *.f *.p rii_files *.flow |
529 |
|
|
rm -f *.F *.h *.c Makefile* *.template genmake_* |
530 |
heimbach |
1.4 |
../../../tools/genmake2 -ieee -mods=../code_seaice |
531 |
heimbach |
1.2 |
cp ../code_seaice/SEAICE_OPTIONS.h.MULTILEVEL SEAICE_OPTIONS.h |
532 |
|
|
make depend |
533 |
|
|
make adall |
534 |
|
|
|
535 |
|
|
# To run: |
536 |
|
|
cd ../exe |
537 |
|
|
cp ../input_seaice/* . |
538 |
|
|
cp ../input_bulk/data.grdchk . |
539 |
dimitri |
1.7 |
../build/mitgcmuv_ad >&! output.txt |
540 |
heimbach |
1.2 |
|
541 |
|
|
# To verify the results of the gradient check, type: |
542 |
|
|
grep grad-res output.txt |
543 |
|
|
# The reference output is in: |
544 |
|
|
grep grad-res ../results_seaice/output_exp15.txt_adm |
545 |
|
|
|
546 |
|
|
# This test suggests that SEAICE_MULTILEVEL decreases the accuracy of |
547 |
|
|
# the adjoint model, perhaps because the adjoint model is not handling |
548 |
|
|
# multiple recomputations in budget properly. |
549 |
|
|
|
550 |
|
|
|
551 |
|
|
##################### |
552 |
|
|
# Experiment no. 20 # |
553 |
|
|
##################### |
554 |
|
|
# Same as experiment 10, but using divided adjoint. |