1 |
SHELL = /bin/tcsh |
2 |
RM = rm -f |
3 |
LOC = $(PWD) |
4 |
TAMC = tamc |
5 |
DEST = . |
6 |
SOURCE_CODE = ../bin |
7 |
ADJOINT_SCRIPT = ../adjoint |
8 |
BASE = .. |
9 |
TAMCFLAGS = -adjoint -i4 -r4 |
10 |
PKG = $(BASE)/pkg |
11 |
|
12 |
DIFF_FLAGS = -module the_main_loop \ |
13 |
-input ' xx_theta_dummy \ |
14 |
xx_salt_dummy \ |
15 |
xx_hflux_dummy \ |
16 |
xx_sflux_dummy \ |
17 |
xx_tauu_dummy \ |
18 |
xx_tauv_dummy \ |
19 |
xx_sss_dummy \ |
20 |
xx_sst_dummy' \ |
21 |
-output 'fc' |
22 |
|
23 |
TAMCFLAG = $(TAMCFLAGS) $(DIFF_FLAGS) -l list_uv -admark ad |
24 |
|
25 |
|
26 |
# Source files for the MITgcmUV |
27 |
SRC_MODEL = $(PKG)/autodiff/read_write.flow \ |
28 |
$(PKG)/autodiff/read_write_fld.flow \ |
29 |
$(PKG)/autodiff/read_write_rec.flow \ |
30 |
$(PKG)/autodiff/cg2d.flow \ |
31 |
$(PKG)/autodiff/initialisation.flow \ |
32 |
$(PKG)/autodiff/diags.flow \ |
33 |
$(PKG)/autodiff/dummy_in_stepping.flow \ |
34 |
$(PKG)/autodiff/external_fields_load.flow \ |
35 |
$(PKG)/autodiff/eesupp.flow \ |
36 |
$(PKG)/autodiff/active_file.flow \ |
37 |
$(PKG)/autodiff/write_state.flow \ |
38 |
$(PKG)/autodiff/write_time_averages.flow\ |
39 |
$(PKG)/autodiff/exch_ad.flow \ |
40 |
$(PKG)/autodiff/global_sum_ad.flow \ |
41 |
$(PKG)/autodiff/global_max_ad.flow \ |
42 |
$(PKG)/autodiff/mdsio.flow \ |
43 |
$(PKG)/autodiff/checkpoint.flow \ |
44 |
$(PKG)/autodiff/print_message.flow \ |
45 |
$(PKG)/autodiff/open_copy_data_file.flow\ |
46 |
$(PKG)/autodiff/timeave.flow \ |
47 |
\ |
48 |
$(SOURCE_CODE)/grad_sigma.f \ |
49 |
$(SOURCE_CODE)/calc_buoyancy.f \ |
50 |
$(SOURCE_CODE)/calc_common_factors.f \ |
51 |
$(SOURCE_CODE)/calc_diffusivity.f \ |
52 |
$(SOURCE_CODE)/calc_div_ghat.f \ |
53 |
$(SOURCE_CODE)/calc_grad_phi_surf.f \ |
54 |
$(SOURCE_CODE)/calc_gs.f \ |
55 |
$(SOURCE_CODE)/calc_gt.f \ |
56 |
$(SOURCE_CODE)/calc_ivdc.f \ |
57 |
$(SOURCE_CODE)/calc_mom_rhs.f \ |
58 |
$(SOURCE_CODE)/calc_phi_hyd.f \ |
59 |
$(SOURCE_CODE)/comm_stats.f \ |
60 |
$(SOURCE_CODE)/convect.f \ |
61 |
$(SOURCE_CODE)/convective_adjustment.f \ |
62 |
$(SOURCE_CODE)/convective_adjustment_ini.f \ |
63 |
$(SOURCE_CODE)/correction_step.f \ |
64 |
$(SOURCE_CODE)/cycle_tracer.f \ |
65 |
$(SOURCE_CODE)/different_multiple.f \ |
66 |
$(SOURCE_CODE)/do_fields_blocking_exchanges.f \ |
67 |
$(SOURCE_CODE)/do_the_model_io.f \ |
68 |
$(SOURCE_CODE)/dynamics.f \ |
69 |
$(SOURCE_CODE)/external_forcing.f \ |
70 |
$(SOURCE_CODE)/external_forcing_surf.f \ |
71 |
$(SOURCE_CODE)/find_alpha.f \ |
72 |
$(SOURCE_CODE)/find_rho.f \ |
73 |
$(SOURCE_CODE)/freeze.f \ |
74 |
$(SOURCE_CODE)/get_offline_fields.f \ |
75 |
$(SOURCE_CODE)/impldiff.f \ |
76 |
$(SOURCE_CODE)/ini_cartesian_grid.f \ |
77 |
$(SOURCE_CODE)/ini_cg2d.f \ |
78 |
$(SOURCE_CODE)/ini_communication_patterns.f \ |
79 |
$(SOURCE_CODE)/ini_cori.f \ |
80 |
$(SOURCE_CODE)/ini_depths.f \ |
81 |
$(SOURCE_CODE)/ini_fields.f \ |
82 |
$(SOURCE_CODE)/ini_forcing.f \ |
83 |
$(SOURCE_CODE)/ini_grid.f \ |
84 |
$(SOURCE_CODE)/ini_masks_etc.f \ |
85 |
$(SOURCE_CODE)/ini_procs.f \ |
86 |
$(SOURCE_CODE)/ini_psurf.f \ |
87 |
$(SOURCE_CODE)/ini_salt.f \ |
88 |
$(SOURCE_CODE)/ini_spherical_polar_grid.f \ |
89 |
$(SOURCE_CODE)/ini_theta.f \ |
90 |
$(SOURCE_CODE)/ini_uvel.f \ |
91 |
$(SOURCE_CODE)/ini_vertical_grid.f \ |
92 |
$(SOURCE_CODE)/ini_vvel.f \ |
93 |
$(SOURCE_CODE)/ini_wvel.f \ |
94 |
$(SOURCE_CODE)/initialise_varia.f \ |
95 |
$(SOURCE_CODE)/integrate_for_w.f \ |
96 |
$(SOURCE_CODE)/modeldata_example.f \ |
97 |
$(SOURCE_CODE)/nml_filter.f \ |
98 |
$(SOURCE_CODE)/packages_init_variables.f \ |
99 |
$(SOURCE_CODE)/plot_field.f \ |
100 |
$(SOURCE_CODE)/solve_for_pressure.f \ |
101 |
$(SOURCE_CODE)/state_summary.f \ |
102 |
$(SOURCE_CODE)/timestep.f \ |
103 |
$(SOURCE_CODE)/the_correction_step.f \ |
104 |
$(SOURCE_CODE)/the_main_loop.f \ |
105 |
$(SOURCE_CODE)/timestep_tracer.f \ |
106 |
$(SOURCE_CODE)/swfrac.f \ |
107 |
\ |
108 |
$(SOURCE_CODE)/kpp_calc.f \ |
109 |
$(SOURCE_CODE)/kpp_calc_diff.f \ |
110 |
$(SOURCE_CODE)/kpp_do_diags.f \ |
111 |
$(SOURCE_CODE)/kpp_init.f \ |
112 |
$(SOURCE_CODE)/kpp_open_diags.f \ |
113 |
$(SOURCE_CODE)/kpp_routines.f \ |
114 |
$(SOURCE_CODE)/kpp_transport_s.f \ |
115 |
$(SOURCE_CODE)/kpp_transport_t.f \ |
116 |
\ |
117 |
$(SOURCE_CODE)/gmredi_calc_diff.f \ |
118 |
$(SOURCE_CODE)/gmredi_calc_tensor.f \ |
119 |
$(SOURCE_CODE)/gmredi_diags.f \ |
120 |
$(SOURCE_CODE)/gmredi_init.f \ |
121 |
$(SOURCE_CODE)/gmredi_rtransport.f \ |
122 |
$(SOURCE_CODE)/gmredi_slope_limit.f \ |
123 |
$(SOURCE_CODE)/gmredi_xtransport.f \ |
124 |
$(SOURCE_CODE)/gmredi_ytransport.f \ |
125 |
\ |
126 |
$(SOURCE_CODE)/ctrl_map_ini.f \ |
127 |
$(SOURCE_CODE)/ctrl_map_forcing.f \ |
128 |
\ |
129 |
$(SOURCE_CODE)/cost_final.f \ |
130 |
$(SOURCE_CODE)/cost_init.f \ |
131 |
$(SOURCE_CODE)/cost_test.f \ |
132 |
\ |
133 |
|
134 |
|
135 |
#-------------------------------------------------------- |
136 |
# rules |
137 |
#-------------------------------------------------------- |
138 |
|
139 |
adcode: |
140 |
cd $(DEST) ; cat $(SRC_MODEL) >! tamc_code_ecco.f |
141 |
admodel: |
142 |
cd $(DEST) ; $(TAMC) $(TAMCFLAG) tamc_code_ecco.f \ |
143 |
>! tamc_code_ecco_ad.prot |
144 |
|
145 |
adchange: |
146 |
${ADJOINT_SCRIPT}/adjoint_ecco_sed.com \ |
147 |
>! tamc_code_ecco_sed_ad.f ; \ |
148 |
cp $(PKG)/autodiff/adjoint_model.F \ |
149 |
$(PKG)/autodiff/adjoint_model.F_old ; \ |
150 |
cat tamc_code_ecco_sed_ad.f >> $(PKG)/autodiff/adjoint_model.F |
151 |
adrestore: |
152 |
cp $(PKG)/autodiff/adjoint_model.F_template \ |
153 |
$(PKG)/autodiff/adjoint_model.F |
154 |
adall: adcode admodel |