2 |
RM = rm -f |
RM = rm -f |
3 |
LOC = $(PWD) |
LOC = $(PWD) |
4 |
TAMC = tamc |
TAMC = tamc |
5 |
TAF = ~fastopt/bin/taf |
###TAMC = /data43/ralf/tamc/tamc |
6 |
|
TAF = taf |
7 |
|
###TAF = ~fastopt/taf-1.3.5/bin/taf |
8 |
DEST = . |
DEST = . |
9 |
SOURCE_CODE = ../bin |
SOURCE_CODE = ../bin |
10 |
ADJOINT_SCRIPT = ../adjoint |
ADJOINT_SCRIPT = ../adjoint |
11 |
BASE = .. |
BASE = .. |
|
ADTAMCFLAGS = -reverse -i4 -r4 -admark ad |
|
|
ADTAFFLAGS = -reverse -i4 -r4 -admark ad -warn_step -flow taf_flow.log |
|
|
TLTAMCFLAGS = -forward -i4 -r4 -ftlmark g_ |
|
|
TLTAFFLAGS = -forward -i4 -r4 -ftlmark g_ -warn_step -flow taf_flow.log |
|
12 |
PKG = $(BASE)/pkg |
PKG = $(BASE)/pkg |
13 |
|
# |
14 |
|
ADTAMCFLAGS = -reverse -admark ad -i4 -r4 |
15 |
|
ADTAFFLAGS = -reverse -admark ad -i4 -r4 \ |
16 |
|
-flow taf_flow.log -nonew_arg |
17 |
|
FTLTAMCFLAGS = -forward -ftlmark g_ -i4 -r4 |
18 |
|
FTLTAFFLAGS = -forward -ftlmark g_ -i4 -r4 \ |
19 |
|
-flow taf_flow.log -nonew_arg |
20 |
|
SVDTAMCFLAGS = -reverse -forward -pure -i4 -r4 |
21 |
|
SVDTAFFLAGS = -reverse -forward -pure -i4 -r4 \ |
22 |
|
-flow taf_flow.log -nonew_arg |
23 |
|
# |
24 |
|
# -warn_step -flow taf_flow.log |
25 |
|
|
26 |
DIFF_FLAGS = -toplevel the_main_loop \ |
DIFF_FLAGS = -toplevel the_main_loop \ |
27 |
-input ' xx_theta_dummy \ |
-input ' xx_theta_dummy \ |
36 |
xx_diffkr_dummy \ |
xx_diffkr_dummy \ |
37 |
xx_kapgm_dummy' \ |
xx_kapgm_dummy' \ |
38 |
-output 'fc' |
-output 'fc' |
39 |
|
# |
40 |
|
# -output 'objf_vector' |
41 |
|
# -output 'fc' |
42 |
|
|
43 |
ADTAMCFLAG = $(ADTAMCFLAGS) $(DIFF_FLAGS) |
ADTAMCFLAG = $(ADTAMCFLAGS) $(DIFF_FLAGS) |
44 |
ADTAFFLAG = $(ADTAFFLAGS) $(DIFF_FLAGS) |
ADTAFFLAG = $(ADTAFFLAGS) $(DIFF_FLAGS) |
45 |
|
|
46 |
TLTAMCFLAG = $(TLTAMCFLAGS) $(DIFF_FLAGS) |
FTLTAMCFLAG = $(FTLTAMCFLAGS) $(DIFF_FLAGS) |
47 |
TLTAFFLAG = $(TLTAFFLAGS) $(DIFF_FLAGS) |
FTLTAFFLAG = $(FTLTAFFLAGS) $(DIFF_FLAGS) |
48 |
|
|
49 |
|
SVDTAMCFLAG = $(SVDTAMCFLAGS) $(DIFF_FLAGS) |
50 |
|
SVDTAFFLAG = $(SVDTAFFLAGS) $(DIFF_FLAGS) |
51 |
|
|
52 |
# Source files for the MITgcmUV |
# Source files for the MITgcmUV |
53 |
SRC_MODEL = \ |
SRC_MODEL = \ |
76 |
$(PKG)/autodiff/open_copy_data_file.flow\ |
$(PKG)/autodiff/open_copy_data_file.flow\ |
77 |
$(PKG)/autodiff/timeave.flow \ |
$(PKG)/autodiff/timeave.flow \ |
78 |
\ |
\ |
79 |
|
$(SOURCE_CODE)/adams_bashforth2.f \ |
80 |
$(SOURCE_CODE)/calc_buoyancy.f \ |
$(SOURCE_CODE)/calc_buoyancy.f \ |
81 |
$(SOURCE_CODE)/calc_common_factors.f \ |
$(SOURCE_CODE)/calc_common_factors.f \ |
82 |
$(SOURCE_CODE)/calc_diffusivity.f \ |
$(SOURCE_CODE)/calc_diffusivity.f \ |
83 |
$(SOURCE_CODE)/calc_div_ghat.f \ |
$(SOURCE_CODE)/calc_div_ghat.f \ |
84 |
|
$(SOURCE_CODE)/calc_exact_eta.f \ |
85 |
$(SOURCE_CODE)/calc_grad_phi_surf.f \ |
$(SOURCE_CODE)/calc_grad_phi_surf.f \ |
86 |
$(SOURCE_CODE)/calc_gs.f \ |
$(SOURCE_CODE)/calc_gs.f \ |
87 |
$(SOURCE_CODE)/calc_gt.f \ |
$(SOURCE_CODE)/calc_gt.f \ |
93 |
$(SOURCE_CODE)/convect.f \ |
$(SOURCE_CODE)/convect.f \ |
94 |
$(SOURCE_CODE)/convective_adjustment.f \ |
$(SOURCE_CODE)/convective_adjustment.f \ |
95 |
$(SOURCE_CODE)/convective_adjustment_ini.f \ |
$(SOURCE_CODE)/convective_adjustment_ini.f \ |
96 |
|
$(SOURCE_CODE)/convective_weights.f \ |
97 |
|
$(SOURCE_CODE)/convectively_mixtracer.f \ |
98 |
$(SOURCE_CODE)/correction_step.f \ |
$(SOURCE_CODE)/correction_step.f \ |
99 |
$(SOURCE_CODE)/cycle_tracer.f \ |
$(SOURCE_CODE)/cycle_tracer.f \ |
100 |
$(SOURCE_CODE)/different_multiple.f \ |
$(SOURCE_CODE)/different_multiple.f \ |
107 |
$(SOURCE_CODE)/find_rho.f \ |
$(SOURCE_CODE)/find_rho.f \ |
108 |
$(SOURCE_CODE)/forward_step.f \ |
$(SOURCE_CODE)/forward_step.f \ |
109 |
$(SOURCE_CODE)/freeze.f \ |
$(SOURCE_CODE)/freeze.f \ |
110 |
|
\ |
111 |
$(SOURCE_CODE)/gad_advection.f \ |
$(SOURCE_CODE)/gad_advection.f \ |
112 |
$(SOURCE_CODE)/gad_biharm_x.f \ |
$(SOURCE_CODE)/gad_biharm_x.f \ |
113 |
$(SOURCE_CODE)/gad_biharm_y.f \ |
$(SOURCE_CODE)/gad_biharm_y.f \ |
136 |
$(SOURCE_CODE)/gad_u3_adv_r.f \ |
$(SOURCE_CODE)/gad_u3_adv_r.f \ |
137 |
$(SOURCE_CODE)/gad_u3_adv_x.f \ |
$(SOURCE_CODE)/gad_u3_adv_x.f \ |
138 |
$(SOURCE_CODE)/gad_u3_adv_y.f \ |
$(SOURCE_CODE)/gad_u3_adv_y.f \ |
139 |
|
\ |
140 |
$(SOURCE_CODE)/grad_sigma.f \ |
$(SOURCE_CODE)/grad_sigma.f \ |
141 |
$(SOURCE_CODE)/impldiff.f \ |
$(SOURCE_CODE)/impldiff.f \ |
142 |
|
$(SOURCE_CODE)/ini_autodiff.f \ |
143 |
$(SOURCE_CODE)/ini_cartesian_grid.f \ |
$(SOURCE_CODE)/ini_cartesian_grid.f \ |
144 |
$(SOURCE_CODE)/ini_cg2d.f \ |
$(SOURCE_CODE)/ini_cg2d.f \ |
145 |
$(SOURCE_CODE)/ini_communication_patterns.f \ |
$(SOURCE_CODE)/ini_communication_patterns.f \ |
154 |
$(SOURCE_CODE)/ini_mixing.f \ |
$(SOURCE_CODE)/ini_mixing.f \ |
155 |
$(SOURCE_CODE)/ini_p_ground.f \ |
$(SOURCE_CODE)/ini_p_ground.f \ |
156 |
$(SOURCE_CODE)/ini_pnh.f \ |
$(SOURCE_CODE)/ini_pnh.f \ |
|
$(SOURCE_CODE)/ini_procs.f \ |
|
157 |
$(SOURCE_CODE)/ini_psurf.f \ |
$(SOURCE_CODE)/ini_psurf.f \ |
158 |
$(SOURCE_CODE)/ini_salt.f \ |
$(SOURCE_CODE)/ini_salt.f \ |
159 |
$(SOURCE_CODE)/ini_spherical_polar_grid.f \ |
$(SOURCE_CODE)/ini_spherical_polar_grid.f \ |
165 |
$(SOURCE_CODE)/initialise_varia.f \ |
$(SOURCE_CODE)/initialise_varia.f \ |
166 |
$(SOURCE_CODE)/integrate_for_w.f \ |
$(SOURCE_CODE)/integrate_for_w.f \ |
167 |
$(SOURCE_CODE)/modeldata_example.f \ |
$(SOURCE_CODE)/modeldata_example.f \ |
168 |
|
\ |
169 |
$(SOURCE_CODE)/mom_fluxform.f \ |
$(SOURCE_CODE)/mom_fluxform.f \ |
170 |
$(SOURCE_CODE)/mom_hdissip.f \ |
$(SOURCE_CODE)/mom_hdissip.f \ |
171 |
$(SOURCE_CODE)/mom_vecinv.f \ |
$(SOURCE_CODE)/mom_vecinv.f \ |
178 |
$(SOURCE_CODE)/mom_u_adv_vu.f \ |
$(SOURCE_CODE)/mom_u_adv_vu.f \ |
179 |
$(SOURCE_CODE)/mom_u_adv_wu.f \ |
$(SOURCE_CODE)/mom_u_adv_wu.f \ |
180 |
$(SOURCE_CODE)/mom_u_bottomdrag.f \ |
$(SOURCE_CODE)/mom_u_bottomdrag.f \ |
181 |
|
$(SOURCE_CODE)/mom_u_coriolis.f \ |
182 |
$(SOURCE_CODE)/mom_u_del2u.f \ |
$(SOURCE_CODE)/mom_u_del2u.f \ |
183 |
$(SOURCE_CODE)/mom_u_metric_nh.f \ |
$(SOURCE_CODE)/mom_u_metric_nh.f \ |
184 |
$(SOURCE_CODE)/mom_u_metric_sphere.f \ |
$(SOURCE_CODE)/mom_u_metric_sphere.f \ |
190 |
$(SOURCE_CODE)/mom_v_adv_vv.f \ |
$(SOURCE_CODE)/mom_v_adv_vv.f \ |
191 |
$(SOURCE_CODE)/mom_v_adv_wv.f \ |
$(SOURCE_CODE)/mom_v_adv_wv.f \ |
192 |
$(SOURCE_CODE)/mom_v_bottomdrag.f \ |
$(SOURCE_CODE)/mom_v_bottomdrag.f \ |
193 |
|
$(SOURCE_CODE)/mom_v_coriolis.f \ |
194 |
$(SOURCE_CODE)/mom_v_del2v.f \ |
$(SOURCE_CODE)/mom_v_del2v.f \ |
195 |
$(SOURCE_CODE)/mom_v_metric_nh.f \ |
$(SOURCE_CODE)/mom_v_metric_nh.f \ |
196 |
$(SOURCE_CODE)/mom_v_metric_sphere.f \ |
$(SOURCE_CODE)/mom_v_metric_sphere.f \ |
211 |
$(SOURCE_CODE)/mom_vi_v_coriolis.f \ |
$(SOURCE_CODE)/mom_vi_v_coriolis.f \ |
212 |
$(SOURCE_CODE)/mom_vi_v_grad_ke.f \ |
$(SOURCE_CODE)/mom_vi_v_grad_ke.f \ |
213 |
$(SOURCE_CODE)/mom_vi_v_vertshear.f \ |
$(SOURCE_CODE)/mom_vi_v_vertshear.f \ |
214 |
|
\ |
215 |
$(SOURCE_CODE)/packages_init_variables.f \ |
$(SOURCE_CODE)/packages_init_variables.f \ |
216 |
$(SOURCE_CODE)/plot_field.f \ |
$(SOURCE_CODE)/plot_field.f \ |
217 |
$(SOURCE_CODE)/solve_for_pressure.f \ |
$(SOURCE_CODE)/solve_for_pressure.f \ |
235 |
\ |
\ |
236 |
$(SOURCE_CODE)/gmredi_calc_diff.f \ |
$(SOURCE_CODE)/gmredi_calc_diff.f \ |
237 |
$(SOURCE_CODE)/gmredi_calc_tensor.f \ |
$(SOURCE_CODE)/gmredi_calc_tensor.f \ |
238 |
|
$(SOURCE_CODE)/gmredi_calc_uvflow.f \ |
239 |
|
$(SOURCE_CODE)/gmredi_calc_wflow.f \ |
240 |
$(SOURCE_CODE)/gmredi_diags.f \ |
$(SOURCE_CODE)/gmredi_diags.f \ |
241 |
$(SOURCE_CODE)/gmredi_init.f \ |
$(SOURCE_CODE)/gmredi_init.f \ |
242 |
$(SOURCE_CODE)/gmredi_rtransport.f \ |
$(SOURCE_CODE)/gmredi_rtransport.f \ |
252 |
$(SOURCE_CODE)/cost_tile.f \ |
$(SOURCE_CODE)/cost_tile.f \ |
253 |
$(SOURCE_CODE)/cost_test.f \ |
$(SOURCE_CODE)/cost_test.f \ |
254 |
$(SOURCE_CODE)/cost_tracer.f \ |
$(SOURCE_CODE)/cost_tracer.f \ |
255 |
|
$(SOURCE_CODE)/cost_atlantic_heat.f \ |
256 |
|
$(SOURCE_CODE)/cost_vector.f \ |
257 |
|
\ |
258 |
|
$(SOURCE_CODE)/shap_filt_apply_ts.f \ |
259 |
|
$(SOURCE_CODE)/shap_filt_apply_uv.f \ |
260 |
|
$(SOURCE_CODE)/shap_filt_tracer_s1.f \ |
261 |
|
$(SOURCE_CODE)/shap_filt_tracer_s2.f \ |
262 |
|
$(SOURCE_CODE)/shap_filt_tracer_s2g.f \ |
263 |
|
$(SOURCE_CODE)/shap_filt_tracer_s4.f \ |
264 |
|
$(SOURCE_CODE)/shap_filt_uv_s1.f \ |
265 |
|
$(SOURCE_CODE)/shap_filt_uv_s2.f \ |
266 |
|
$(SOURCE_CODE)/shap_filt_uv_s2c.f \ |
267 |
|
$(SOURCE_CODE)/shap_filt_uv_s2g.f \ |
268 |
|
$(SOURCE_CODE)/shap_filt_uv_s4.f \ |
269 |
|
\ |
270 |
|
|
271 |
|
# $(SOURCE_CODE)/calc_ep_forcing.f \ |
272 |
|
# $(SOURCE_CODE)/cost_entropy.f \ |
273 |
|
# $(SOURCE_CODE)/ini_ep.f \ |
274 |
\ |
\ |
275 |
|
|
276 |
|
|
279 |
#-------------------------------------------------------- |
#-------------------------------------------------------- |
280 |
|
|
281 |
allcode: |
allcode: |
282 |
cd $(DEST) ; cat $(SRC_MODEL) >! tamc_code_ecco.f |
cd $(DEST) ; cat $(SRC_MODEL) >! tamc_code.f |
283 |
|
|
284 |
admodeltamc: |
admodeltamc: |
285 |
cd $(DEST) ; $(TAMC) $(ADTAMCFLAG) tamc_code_ecco.f \ |
cd $(DEST) ; $(TAMC) $(ADTAMCFLAG) tamc_code.f \ |
286 |
>! tamc_code_ecco_ad.prot |
>! tamc_code_ad.prot |
287 |
|
|
288 |
admodeltaf: |
admodeltaf: |
289 |
cd $(DEST) ; $(TAF) $(ADTAFFLAG) tamc_code_ecco.f |
cd $(DEST) ; $(TAF) $(ADTAFFLAG) tamc_code.f |
290 |
|
|
291 |
|
ftlmodeltamc: |
292 |
|
cd $(DEST) ; $(TAMC) $(FTLTAMCFLAG) tamc_code.f \ |
293 |
|
>! tamc_code_ftl.prot |
294 |
|
|
295 |
tlmodeltamc: |
ftlmodeltaf: |
296 |
cd $(DEST) ; $(TAMC) $(TLTAMCFLAG) tamc_code_ecco.f \ |
cd $(DEST) ; $(TAF) $(FTLTAFFLAG) tamc_code.f |
|
>! tamc_code_ecco_tl.prot |
|
297 |
|
|
298 |
tlmodeltaf: |
svdmodeltaf: |
299 |
cd $(DEST) ; $(TAF) $(TLTAFFLAG) tamc_code_ecco.f |
cd $(DEST) ; $(TAF) $(SVDTAFFLAG) tamc_code.f |
300 |
|
|
301 |
adchange: |
adchange: |
302 |
${ADJOINT_SCRIPT}/adjoint_ecco_sed.com \ |
${ADJOINT_SCRIPT}/adjoint_sed.com \ |
303 |
>! tamc_code_ecco_sed_ad.f ; \ |
>! tamc_code_sed_ad.f ; \ |
304 |
cp $(PKG)/autodiff/adjoint_model.F \ |
cp $(PKG)/autodiff/adjoint_model.F \ |
305 |
$(PKG)/autodiff/adjoint_model.F_old ; \ |
$(PKG)/autodiff/adjoint_model.F_old ; \ |
306 |
cat tamc_code_ecco_sed_ad.f >> $(PKG)/autodiff/adjoint_model.F |
cat tamc_code_sed_ad.f >> $(PKG)/autodiff/adjoint_model.F |
307 |
|
|
308 |
|
ftlchange: |
309 |
|
cp $(PKG)/autodiff/tangentlinear_model.F \ |
310 |
|
$(PKG)/autodiff/tangentlinear_model.F_old ; \ |
311 |
|
cat tamc_code_ftl.f >> $(PKG)/autodiff/tangentlinear_model.F |
312 |
|
|
313 |
adrestore: |
adrestore: |
314 |
cp $(PKG)/autodiff/adjoint_model.F_template \ |
cp $(PKG)/autodiff/adjoint_model.F_template \ |
315 |
$(PKG)/autodiff/adjoint_model.F |
$(PKG)/autodiff/adjoint_model.F |
316 |
|
|
317 |
tltamc: allcode tlmodeltamc |
ftlrestore: |
318 |
|
cp $(PKG)/autodiff/tangentlinear_model.F_template \ |
319 |
|
$(PKG)/autodiff/tangentlinear_model.F |
320 |
|
|
321 |
|
adtamc: adrestore ftlrestore allcode admodeltamc |
322 |
|
|
323 |
|
adtaf: adrestore ftlrestore allcode admodeltaf |
324 |
|
|
325 |
|
ftltamc: adrestore ftlrestore allcode ftlmodeltamc |
326 |
|
|
327 |
tltaf: allcode tlmodeltaf |
ftltaf: adrestore ftlrestore allcode ftlmodeltaf |
328 |
|
|
329 |
adtamc: allcode admodeltamc |
svdtaf: adrestore ftlrestore allcode svdmodeltaf |
330 |
|
|
|
adtaf: allcode admodeltaf |
|