/[MITgcm]/MITgcm/pkg/ecco/ecco_cost_init_varia.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/ecco_cost_init_varia.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Thu Mar 23 23:06:48 2006 UTC (18 years, 2 months ago) by heimbach
Branch: MAIN
Changes since 1.3: +20 -1 lines
Adding Gael Forget profile cost code.

1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/ecco_cost_init_varia.F,v 1.3 2006/02/15 20:01:51 heimbach Exp $
2
3 #include "AD_CONFIG.h"
4 #include "COST_CPPOPTIONS.h"
5
6 subroutine ecco_cost_init_varia( mythid )
7
8 c ==================================================================
9 c SUBROUTINE ecco_cost_init_varia
10 c ==================================================================
11 c
12 c o Initialise the variable cost function part.
13 c
14 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
15 c changed: Christian Eckert eckert@mit.edu 18-Apr-2000
16 c - Restructured the code in order to create a package
17 c for the MITgcmUV.
18 c heimbach@mit.edu 05-Nov-2003 Now ecco part of cost
19 c
20 c ==================================================================
21 c SUBROUTINE ecco_cost_init_varia
22 c ==================================================================
23
24 implicit none
25
26 c == global variables ==
27
28 #include "EEPARAMS.h"
29 #include "SIZE.h"
30 #include "GRID.h"
31
32 #include "ecco_cost.h"
33 #include "profiles.h"
34 #include "ctrl_dummy.h"
35
36 c == routine arguments ==
37
38 integer mythid
39
40 c == local variables ==
41
42 integer bi,bj
43 integer itlo,ithi
44 integer jtlo,jthi
45 integer imin, imax
46 integer jmin, jmax
47 integer i,j,k
48 integer num_file,num_var
49
50 logical exst
51
52 c == external functions ==
53
54 c == end of interface ==
55 jtlo = mybylo(mythid)
56 jthi = mybyhi(mythid)
57 itlo = mybxlo(mythid)
58 ithi = mybxhi(mythid)
59 jmin = 1-OLy
60 jmax = sny+OLy
61 imin = 1-OLx
62 imax = snx+OLy
63
64 c-- Initialise adjoint of monthly mean files calculated
65 c-- in cost_averagesfields (and their ad...).
66 call cost_averagesinit( mythid )
67 _BARRIER
68
69 #ifndef ALLOW_TANGENTLINEAR_RUN
70 cph(
71 cph The following init. shoud not be applied if in the middle
72 cph of a divided adjoint run
73 cph)
74 c inquire( file='costfinal', exist=exst )
75 c if ( .NOT. exst) then
76 c call ecco_cost_init_barfiles( mythid )
77 c endif
78 #endif
79
80 c-- Initialize the tiled cost function contributions.
81 do bj = jtlo,jthi
82 do bi = itlo,ithi
83 objf_hflux(bi,bj) = 0. _d 0
84 objf_hfluxm(bi,bj) = 0. _d 0
85 objf_hfluxmm(bi,bj) = 0. _d 0
86 objf_sflux(bi,bj) = 0. _d 0
87 objf_sfluxm(bi,bj) = 0. _d 0
88 objf_sfluxmm(bi,bj) = 0. _d 0
89 objf_tauu(bi,bj) = 0. _d 0
90 objf_tauum(bi,bj) = 0. _d 0
91 objf_tauv(bi,bj) = 0. _d 0
92 objf_tauvm(bi,bj) = 0. _d 0
93 objf_temp(bi,bj) = 0. _d 0
94 objf_salt(bi,bj) = 0. _d 0
95 objf_temp0(bi,bj) = 0. _d 0
96 objf_salt0(bi,bj) = 0. _d 0
97 objf_temp0smoo(bi,bj) = 0. _d 0
98 objf_salt0smoo(bi,bj) = 0. _d 0
99 objf_tmi(bi,bj) = 0. _d 0
100 objf_sst(bi,bj) = 0. _d 0
101 objf_sss(bi,bj) = 0. _d 0
102 objf_h(bi,bj) = 0. _d 0
103 objf_ctdt(bi,bj) = 0. _d 0
104 objf_ctds(bi,bj) = 0. _d 0
105 objf_ctdtclim(bi,bj) = 0. _d 0
106 objf_ctdsclim(bi,bj) = 0. _d 0
107 objf_xbt(bi,bj) = 0. _d 0
108 objf_argot(bi,bj) = 0. _d 0
109 objf_argos(bi,bj) = 0. _d 0
110 objf_drift(bi,bj) = 0. _d 0
111 objf_wdrift(bi,bj) = 0. _d 0
112 objf_sdrift(bi,bj) = 0. _d 0
113 objf_tdrift(bi,bj) = 0. _d 0
114 objf_scatx(bi,bj) = 0. _d 0
115 objf_scaty(bi,bj) = 0. _d 0
116 objf_scatxm(bi,bj) = 0. _d 0
117 objf_scatym(bi,bj) = 0. _d 0
118 objf_atemp(bi,bj) = 0. _d 0
119 objf_aqh(bi,bj) = 0. _d 0
120 objf_precip(bi,bj) = 0. _d 0
121 objf_swflux(bi,bj) = 0. _d 0
122 objf_swdown(bi,bj) = 0. _d 0
123 objf_uwind(bi,bj) = 0. _d 0
124 objf_vwind(bi,bj) = 0. _d 0
125 objf_obcsn(bi,bj) = 0. _d 0
126 objf_obcss(bi,bj) = 0. _d 0
127 objf_obcsw(bi,bj) = 0. _d 0
128 objf_obcse(bi,bj) = 0. _d 0
129 objf_curmtr(bi,bj) = 0. _d 0
130 objf_ageos(bi,bj) = 0. _d 0
131 objf_diffkr(bi,bj) = 0. _d 0
132 objf_kapgm(bi,bj) = 0. _d 0
133 objf_theta_ini_fin(bi,bj) = 0. _d 0
134 objf_salt_ini_fin(bi,bj) = 0. _d 0
135 do num_file=1,NFILESPROFMAX
136 do num_var=1,4
137 objf_profiles(num_file,num_var,bi,bj)= 0. _d 0
138 enddo
139 enddo
140 c
141 num_hflux(bi,bj) = 0. _d 0
142 num_hfluxm(bi,bj) = 0. _d 0
143 num_hfluxmm(bi,bj) = 0. _d 0
144 num_sflux(bi,bj) = 0. _d 0
145 num_sfluxm(bi,bj) = 0. _d 0
146 num_sfluxmm(bi,bj) = 0. _d 0
147 num_tauu(bi,bj) = 0. _d 0
148 num_tauum(bi,bj) = 0. _d 0
149 num_tauv(bi,bj) = 0. _d 0
150 num_tauvm(bi,bj) = 0. _d 0
151 num_temp(bi,bj) = 0. _d 0
152 num_salt(bi,bj) = 0. _d 0
153 num_temp0(bi,bj) = 0. _d 0
154 num_salt0(bi,bj) = 0. _d 0
155 num_tmi(bi,bj) = 0. _d 0
156 num_sst(bi,bj) = 0. _d 0
157 num_sss(bi,bj) = 0. _d 0
158 num_h(bi,bj) = 0. _d 0
159 num_ctdt(bi,bj) = 0. _d 0
160 num_ctds(bi,bj) = 0. _d 0
161 num_ctdtclim(bi,bj) = 0. _d 0
162 num_ctdsclim(bi,bj) = 0. _d 0
163 num_xbt(bi,bj) = 0. _d 0
164 num_argot(bi,bj) = 0. _d 0
165 num_argos(bi,bj) = 0. _d 0
166 num_drift(bi,bj) = 0. _d 0
167 num_wdrift(bi,bj) = 0. _d 0
168 num_sdrift(bi,bj) = 0. _d 0
169 num_tdrift(bi,bj) = 0. _d 0
170 num_scatx(bi,bj) = 0. _d 0
171 num_scaty(bi,bj) = 0. _d 0
172 num_scatxm(bi,bj) = 0. _d 0
173 num_scatym(bi,bj) = 0. _d 0
174 num_atemp(bi,bj) = 0. _d 0
175 num_aqh(bi,bj) = 0. _d 0
176 num_precip(bi,bj) = 0. _d 0
177 num_swflux(bi,bj) = 0. _d 0
178 num_swdown(bi,bj) = 0. _d 0
179 num_uwind(bi,bj) = 0. _d 0
180 num_vwind(bi,bj) = 0. _d 0
181 num_obcsn(bi,bj) = 0. _d 0
182 num_obcss(bi,bj) = 0. _d 0
183 num_obcsw(bi,bj) = 0. _d 0
184 num_obcse(bi,bj) = 0. _d 0
185 num_curmtr(bi,bj) = 0. _d 0
186 num_ageos(bi,bj) = 0. _d 0
187 num_diffkr(bi,bj) = 0. _d 0
188 num_kapgm(bi,bj) = 0. _d 0
189 num_theta_ini_fin(bi,bj) = 0. _d 0
190 num_salt_ini_fin(bi,bj) = 0. _d 0
191 do num_file=1,NFILESPROFMAX
192 do num_var=1,4
193 num_profiles(num_file,num_var,bi,bj) = 0. _d 0
194 enddo
195 enddo
196 enddo
197 enddo
198
199 k = 1
200 do bj = jtlo,jthi
201 do bi = itlo,ithi
202 do j = jmin,jmax
203 do i = imin,imax
204 #ifdef ALLOW_SSH_COST_CONTRIBUTION
205 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
206 tpmeanmask(i,j,bi,bj) = 0. _d 0
207 else
208 tpmeanmask(i,j,bi,bj) = 1. _d 0
209 endif
210 tpmean(i,j,bi,bj) = 0. _d 0
211 #endif
212 #ifdef ALLOW_SSH_TPANOM_COST_CONTRIBUTION
213 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
214 tpmask(i,j,bi,bj) = 0. _d 0
215 else
216 tpmask(i,j,bi,bj) = 1. _d 0
217 endif
218 tpobs(i,j,bi,bj) = 0. _d 0
219 #endif
220 #ifdef ALLOW_SSH_ERSANOM_COST_CONTRIBUTION
221 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
222 ersmask(i,j,bi,bj) = 0. _d 0
223 else
224 ersmask(i,j,bi,bj) = 1. _d 0
225 endif
226 ersobs(i,j,bi,bj) = 0. _d 0
227 #endif
228 #ifdef ALLOW_SSH_GFOANOM_COST_CONTRIBUTION
229 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
230 gfomask(i,j,bi,bj) = 0. _d 0
231 else
232 gfomask(i,j,bi,bj) = 1. _d 0
233 endif
234 gfoobs(i,j,bi,bj) = 0. _d 0
235 #endif
236 #ifdef ALLOW_TMI_SST_COST_CONTRIBUTION
237 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
238 tmimask(i,j,bi,bj) = 0. _d 0
239 else
240 tmimask(i,j,bi,bj) = 1. _d 0
241 endif
242 tmidat(i,j,bi,bj) = 0. _d 0
243 #endif
244 #ifdef ALLOW_SST_COST_CONTRIBUTION
245 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
246 sstmask(i,j,bi,bj) = 0. _d 0
247 else
248 sstmask(i,j,bi,bj) = 1. _d 0
249 endif
250 sstdat(i,j,bi,bj) = 0. _d 0
251 #endif
252 #ifdef ALLOW_SSS_COST_CONTRIBUTION
253 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
254 sssmask(i,j,bi,bj) = 0. _d 0
255 else
256 sssmask(i,j,bi,bj) = 1. _d 0
257 endif
258 sssdat(i,j,bi,bj) = 0. _d 0
259 #endif
260 enddo
261 enddo
262 enddo
263 enddo
264
265 c-- Initialise the "global" parts of the cost function.
266 _BEGIN_MASTER( mythid )
267 objf_obcsvol = 0. _d 0
268 objf_hmean = 0. _d 0
269 num_obcsvol = 0. _d 0
270 num_hmean = 0. _d 0
271 _END_MASTER( mythid )
272
273 do num_file=1,50
274 do num_var=1,10
275 profiles_dummy(num_file,num_var)=0. _d 0
276 enddo
277 enddo
278
279 _BARRIER
280
281 return
282 end
283

  ViewVC Help
Powered by ViewVC 1.1.22