1 |
SHELL = /bin/tcsh |
2 |
RM = rm -f |
3 |
LOC = $(PWD) |
4 |
TAMC = /data43/tamc/tamc |
5 |
DEST = . |
6 |
SOURCE_CODE = ../bin |
7 |
BASE = .. |
8 |
AMCFLAGS = -e -adjoint |
9 |
|
10 |
|
11 |
DIFF_FLAGS = -module objfunc \ |
12 |
-input 'xx_theta xx_salt \ |
13 |
xx_hfl xx_sfl xx_tauu xx_tauv ' \ |
14 |
-output 'fc' |
15 |
|
16 |
AMCFLAG = $(AMCFLAGS) $(DIFF_FLAGS) -l list_uv -admark ad |
17 |
|
18 |
|
19 |
# Source files for the MITgcmUV |
20 |
SRC_MODEL = $(BASE)/packages/autodiff/read_write.flow \ |
21 |
$(BASE)/packages/autodiff/read_write_fld.flow \ |
22 |
$(BASE)/packages/autodiff/read_write_rec.flow \ |
23 |
$(BASE)/packages/autodiff/cg2d.flow \ |
24 |
$(BASE)/packages/autodiff/initialisation.flow \ |
25 |
$(BASE)/packages/autodiff/diags.flow \ |
26 |
$(BASE)/packages/autodiff/eesupp.flow \ |
27 |
$(BASE)/packages/autodiff/active_file.flow \ |
28 |
$(BASE)/packages/autodiff/write_state.flow \ |
29 |
$(BASE)/packages/autodiff/exch_ad.flow \ |
30 |
$(BASE)/packages/autodiff/global_sum_ad.flow \ |
31 |
$(BASE)/packages/autodiff/mdsio.flow \ |
32 |
\ |
33 |
$(SOURCE_CODE)/exch_ad.f \ |
34 |
$(SOURCE_CODE)/global_sum_ad.f \ |
35 |
$(SOURCE_CODE)/active_file_ad.f \ |
36 |
\ |
37 |
$(SOURCE_CODE)/calc_buoyancy.f \ |
38 |
$(SOURCE_CODE)/calc_common_factors.f \ |
39 |
$(SOURCE_CODE)/calc_diffusivity.f \ |
40 |
$(SOURCE_CODE)/calc_div_ghat.f \ |
41 |
$(SOURCE_CODE)/calc_grad_eta_surf.f \ |
42 |
$(SOURCE_CODE)/calc_gs.f \ |
43 |
$(SOURCE_CODE)/calc_gt.f \ |
44 |
$(SOURCE_CODE)/calc_isoslopes.f \ |
45 |
$(SOURCE_CODE)/calc_mom_rhs.f \ |
46 |
$(SOURCE_CODE)/calc_phi_hyd.f \ |
47 |
$(SOURCE_CODE)/comm_stats.f \ |
48 |
$(SOURCE_CODE)/config_summary.f \ |
49 |
$(SOURCE_CODE)/convect.f \ |
50 |
$(SOURCE_CODE)/correction_step.f \ |
51 |
$(SOURCE_CODE)/different_multiple.f \ |
52 |
$(SOURCE_CODE)/do_gterm_blocking_exchanges.f \ |
53 |
$(SOURCE_CODE)/do_the_model_io.f \ |
54 |
$(SOURCE_CODE)/dynamics.f \ |
55 |
$(SOURCE_CODE)/external_forcing.f \ |
56 |
$(SOURCE_CODE)/find_rho.f \ |
57 |
$(SOURCE_CODE)/freeze.f \ |
58 |
$(SOURCE_CODE)/get_offline_fields.f \ |
59 |
$(SOURCE_CODE)/impldiff.f \ |
60 |
$(SOURCE_CODE)/ini_cartesian_grid.f \ |
61 |
$(SOURCE_CODE)/ini_cg2d.f \ |
62 |
$(SOURCE_CODE)/ini_communication_patterns.f \ |
63 |
$(SOURCE_CODE)/ini_cori.f \ |
64 |
$(SOURCE_CODE)/ini_depths.f \ |
65 |
$(SOURCE_CODE)/ini_fields.f \ |
66 |
$(SOURCE_CODE)/ini_forcing.f \ |
67 |
$(SOURCE_CODE)/ini_grid.f \ |
68 |
$(SOURCE_CODE)/ini_masks_etc.f \ |
69 |
$(SOURCE_CODE)/ini_predictor.f \ |
70 |
$(SOURCE_CODE)/ini_procs.f \ |
71 |
$(SOURCE_CODE)/ini_salt.f \ |
72 |
$(SOURCE_CODE)/ini_spherical_polar_grid.f \ |
73 |
$(SOURCE_CODE)/ini_theta.f \ |
74 |
$(SOURCE_CODE)/ini_threading_environment.f \ |
75 |
$(SOURCE_CODE)/ini_uvel.f \ |
76 |
$(SOURCE_CODE)/ini_vertical_grid.f \ |
77 |
$(SOURCE_CODE)/ini_vvel.f \ |
78 |
$(SOURCE_CODE)/initialise_varia.f \ |
79 |
$(SOURCE_CODE)/load_external_fields.f \ |
80 |
$(SOURCE_CODE)/modeldata_example.f \ |
81 |
$(SOURCE_CODE)/plot_field.f \ |
82 |
$(SOURCE_CODE)/solve_for_pressure.f \ |
83 |
$(SOURCE_CODE)/state_summary.f \ |
84 |
$(SOURCE_CODE)/timeaver_1fld_xyz.f \ |
85 |
$(SOURCE_CODE)/timeaver_2fld_xyz.f \ |
86 |
$(SOURCE_CODE)/timeaver_final_xy.f \ |
87 |
$(SOURCE_CODE)/timeaver_final_xyz.f \ |
88 |
$(SOURCE_CODE)/timeaver_ini_xy.f \ |
89 |
$(SOURCE_CODE)/timeaver_ini_xyz.f \ |
90 |
$(SOURCE_CODE)/timeaver_inter_xy.f \ |
91 |
$(SOURCE_CODE)/timeaver_inter_xyz.f \ |
92 |
$(SOURCE_CODE)/timestep.f \ |
93 |
\ |
94 |
$(SOURCE_CODE)/cost_averagesfields.f \ |
95 |
$(SOURCE_CODE)/cost_averagesfinal.f \ |
96 |
$(SOURCE_CODE)/cost_averagesflags.f \ |
97 |
$(SOURCE_CODE)/cost_averagesinit.f \ |
98 |
$(SOURCE_CODE)/cost_final.f \ |
99 |
$(SOURCE_CODE)/cost_forcing.f \ |
100 |
$(SOURCE_CODE)/cost_geoid.f \ |
101 |
$(SOURCE_CODE)/cost_heatflux.f \ |
102 |
$(SOURCE_CODE)/cost_hyd.f \ |
103 |
$(SOURCE_CODE)/cost_initvaria.f \ |
104 |
$(SOURCE_CODE)/cost_merstress.f \ |
105 |
$(SOURCE_CODE)/cost_readers.f \ |
106 |
$(SOURCE_CODE)/cost_readsstfields.f \ |
107 |
$(SOURCE_CODE)/cost_readtopex.f \ |
108 |
$(SOURCE_CODE)/cost_readtopexmean.f \ |
109 |
$(SOURCE_CODE)/cost_salt.f \ |
110 |
$(SOURCE_CODE)/cost_saltflux.f \ |
111 |
$(SOURCE_CODE)/cost_ssh.f \ |
112 |
$(SOURCE_CODE)/cost_theta.f \ |
113 |
$(SOURCE_CODE)/cost_zonstress.f \ |
114 |
\ |
115 |
$(SOURCE_CODE)/ctrl_getheatflux.f \ |
116 |
$(SOURCE_CODE)/ctrl_getmerstress.f \ |
117 |
$(SOURCE_CODE)/ctrl_getrec.f \ |
118 |
$(SOURCE_CODE)/ctrl_getsaltflux.f \ |
119 |
$(SOURCE_CODE)/ctrl_getzonstress.f \ |
120 |
$(SOURCE_CODE)/ctrl_map.f \ |
121 |
$(SOURCE_CODE)/ctrl_state2xxall.f \ |
122 |
$(SOURCE_CODE)/ctrl_state2xxhfl.f \ |
123 |
$(SOURCE_CODE)/ctrl_state2xxsalt.f \ |
124 |
$(SOURCE_CODE)/ctrl_state2xxsfl.f \ |
125 |
$(SOURCE_CODE)/ctrl_state2xxtauu.f \ |
126 |
$(SOURCE_CODE)/ctrl_state2xxtauv.f \ |
127 |
$(SOURCE_CODE)/ctrl_state2xxtheta.f \ |
128 |
$(SOURCE_CODE)/ctrl_xx2stateall.f \ |
129 |
$(SOURCE_CODE)/ctrl_xx2statehfl.f \ |
130 |
$(SOURCE_CODE)/ctrl_xx2statesalt.f \ |
131 |
$(SOURCE_CODE)/ctrl_xx2statesfl.f \ |
132 |
$(SOURCE_CODE)/ctrl_xx2statetauu.f \ |
133 |
$(SOURCE_CODE)/ctrl_xx2statetauv.f \ |
134 |
$(SOURCE_CODE)/ctrl_xx2statetheta.f \ |
135 |
\ |
136 |
$(SOURCE_CODE)/ecco_main.f \ |
137 |
\ |
138 |
$(SOURCE_CODE)/ymds_daily.f \ |
139 |
$(SOURCE_CODE)/ymds_integrate.f \ |
140 |
$(SOURCE_CODE)/ymds_monthly.f \ |
141 |
$(SOURCE_CODE)/ymds_postdaily.f \ |
142 |
$(SOURCE_CODE)/ymds_postmonthly.f \ |
143 |
$(SOURCE_CODE)/ymds_poststep.f \ |
144 |
$(SOURCE_CODE)/ymds_postyearly.f \ |
145 |
$(SOURCE_CODE)/ymds_predaily.f \ |
146 |
$(SOURCE_CODE)/ymds_premonthly.f \ |
147 |
$(SOURCE_CODE)/ymds_prestep.f \ |
148 |
$(SOURCE_CODE)/ymds_preyearly.f \ |
149 |
$(SOURCE_CODE)/ymds_step.f \ |
150 |
$(SOURCE_CODE)/ymds_yearly.f \ |
151 |
\ |
152 |
$(SOURCE_CODE)/exf_bulkcdn.f \ |
153 |
$(SOURCE_CODE)/exf_bulkqsat.f \ |
154 |
$(SOURCE_CODE)/exf_bulkrhn.f \ |
155 |
$(SOURCE_CODE)/exf_getffields.f \ |
156 |
$(SOURCE_CODE)/exf_getffieldsrec.f \ |
157 |
$(SOURCE_CODE)/exf_getforcing.f \ |
158 |
$(SOURCE_CODE)/exf_getsaltclim.f \ |
159 |
$(SOURCE_CODE)/exf_getsaltclimlambda.f \ |
160 |
$(SOURCE_CODE)/exf_getsaltclimrec.f \ |
161 |
$(SOURCE_CODE)/exf_getsssclim.f \ |
162 |
$(SOURCE_CODE)/exf_getsssclimlambda.f \ |
163 |
$(SOURCE_CODE)/exf_getsssclimrec.f \ |
164 |
$(SOURCE_CODE)/exf_getsstclim.f \ |
165 |
$(SOURCE_CODE)/exf_getsstclimlambda.f \ |
166 |
$(SOURCE_CODE)/exf_getsstclimrec.f \ |
167 |
$(SOURCE_CODE)/exf_getsurfacefluxes.f \ |
168 |
$(SOURCE_CODE)/exf_gettempclim.f \ |
169 |
$(SOURCE_CODE)/exf_gettempclimlambda.f \ |
170 |
$(SOURCE_CODE)/exf_gettempclimrec.f \ |
171 |
$(SOURCE_CODE)/exf_mapfields.f \ |
172 |
$(SOURCE_CODE)/exf_readatmprecip.f \ |
173 |
$(SOURCE_CODE)/exf_readatmqh.f \ |
174 |
$(SOURCE_CODE)/exf_readatmtemp.f \ |
175 |
$(SOURCE_CODE)/exf_readheatflux.f \ |
176 |
$(SOURCE_CODE)/exf_readlwflux.f \ |
177 |
$(SOURCE_CODE)/exf_readmerstress.f \ |
178 |
$(SOURCE_CODE)/exf_readmerwind.f \ |
179 |
$(SOURCE_CODE)/exf_readsaltclim.f \ |
180 |
$(SOURCE_CODE)/exf_readsaltflux.f \ |
181 |
$(SOURCE_CODE)/exf_readsssclim.f \ |
182 |
$(SOURCE_CODE)/exf_readsstclim.f \ |
183 |
$(SOURCE_CODE)/exf_readswflux.f \ |
184 |
$(SOURCE_CODE)/exf_readtempclim.f \ |
185 |
$(SOURCE_CODE)/exf_readzonstress.f \ |
186 |
$(SOURCE_CODE)/exf_readzonwind.f \ |
187 |
$(SOURCE_CODE)/exf_relaxsalt.f \ |
188 |
$(SOURCE_CODE)/exf_relaxsss.f \ |
189 |
$(SOURCE_CODE)/exf_relaxsst.f \ |
190 |
$(SOURCE_CODE)/exf_relaxtheta.f \ |
191 |
$(SOURCE_CODE)/exf_swapffields.f \ |
192 |
\ |
193 |
$(SOURCE_CODE)/cal_addtime.f \ |
194 |
$(SOURCE_CODE)/cal_checkdate.f \ |
195 |
$(SOURCE_CODE)/cal_compdates.f \ |
196 |
$(SOURCE_CODE)/cal_convdate.f \ |
197 |
$(SOURCE_CODE)/cal_copydate.f \ |
198 |
$(SOURCE_CODE)/cal_daysformonth.f \ |
199 |
$(SOURCE_CODE)/cal_dayspermonth.f \ |
200 |
$(SOURCE_CODE)/cal_fulldate.f \ |
201 |
$(SOURCE_CODE)/cal_getdate.f \ |
202 |
$(SOURCE_CODE)/cal_getmonthsrec.f \ |
203 |
$(SOURCE_CODE)/cal_intdays.f \ |
204 |
$(SOURCE_CODE)/cal_intmonths.f \ |
205 |
$(SOURCE_CODE)/cal_intsteps.f \ |
206 |
$(SOURCE_CODE)/cal_intyears.f \ |
207 |
$(SOURCE_CODE)/cal_isleap.f \ |
208 |
$(SOURCE_CODE)/cal_monthsforyear.f \ |
209 |
$(SOURCE_CODE)/cal_monthsperyear.f \ |
210 |
$(SOURCE_CODE)/cal_nstepday.f \ |
211 |
$(SOURCE_CODE)/cal_numints.f \ |
212 |
$(SOURCE_CODE)/cal_printdate.f \ |
213 |
$(SOURCE_CODE)/cal_printerror.f \ |
214 |
$(SOURCE_CODE)/cal_stepsforday.f \ |
215 |
$(SOURCE_CODE)/cal_stepsperday.f \ |
216 |
$(SOURCE_CODE)/cal_subdates.f \ |
217 |
$(SOURCE_CODE)/cal_timeinterval.f \ |
218 |
$(SOURCE_CODE)/cal_timepassed.f \ |
219 |
$(SOURCE_CODE)/cal_timestamp.f \ |
220 |
$(SOURCE_CODE)/cal_toseconds.f \ |
221 |
$(SOURCE_CODE)/cal_weekday.f \ |
222 |
\ |
223 |
$(SOURCE_CODE)/sphere.f |
224 |
|
225 |
|
226 |
|
227 |
#-------------------------------------------------------- |
228 |
# rules |
229 |
#-------------------------------------------------------- |
230 |
|
231 |
adcode: |
232 |
cd $(DEST) ; cat $(SRC_MODEL) >! tamc_code_ecco.f |
233 |
admodel: |
234 |
cd $(DEST) ; $(TAMC) $(TAMCFLAG) tamc_code_ecco.f > tamc_ecco.prot & |
235 |
adchange: |
236 |
adjoint_ecco_sed.com >! tamc_code_ecco_sed_ad.f ; \ |
237 |
cp ../model/src/adjoint_model.F \ |
238 |
../model/src/adjoint_model_template.F ; \ |
239 |
cat tamc_code_ecco_sed_ad.f >> ../model/src/adjoint_model.F |
240 |
adrestore: |
241 |
mv ../model/src/adjoint_model_template.F \ |
242 |
../model/src/adjoint_model.F |
243 |
adall: adcode admodel |