1 |
C $Header: /u/gcmpack/MITgcm/pkg/autodiff/autodiff_restore.F,v 1.13 2010/08/09 16:05:22 gforget Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
#ifdef ALLOW_OBCS |
7 |
# include "OBCS_OPTIONS.h" |
8 |
#endif |
9 |
#ifdef ALLOW_SEAICE |
10 |
# include "SEAICE_OPTIONS.h" |
11 |
#endif |
12 |
|
13 |
subroutine autodiff_restore( mythid ) |
14 |
|
15 |
c ================================================================== |
16 |
c SUBROUTINE autodiff_restore |
17 |
c ================================================================== |
18 |
c |
19 |
c packing for checkpoint storage |
20 |
c |
21 |
c started: Matt Mazloff mmazloff@mit.edu 03-May-2007 |
22 |
c |
23 |
c ================================================================== |
24 |
c SUBROUTINE autodiff_restore |
25 |
c ================================================================== |
26 |
|
27 |
implicit none |
28 |
|
29 |
c == global variables == |
30 |
|
31 |
#include "SIZE.h" |
32 |
#include "EEPARAMS.h" |
33 |
#include "PARAMS.h" |
34 |
c************************************** |
35 |
c These includes are needed for |
36 |
c AD-checkpointing. |
37 |
c They provide the fields to be stored. |
38 |
|
39 |
# include "GRID.h" |
40 |
# include "DYNVARS.h" |
41 |
# include "FFIELDS.h" |
42 |
# include "SURFACE.h" |
43 |
# include "AUTODIFF.h" |
44 |
|
45 |
# ifdef ALLOW_OBCS |
46 |
# include "OBCS.h" |
47 |
# endif |
48 |
# ifdef ALLOW_EXF |
49 |
# include "EXF_FIELDS.h" |
50 |
# ifdef ALLOW_BULKFORMULAE |
51 |
# include "EXF_CONSTANTS.h" |
52 |
# endif |
53 |
# endif /* ALLOW_EXF */ |
54 |
# ifdef ALLOW_SEAICE |
55 |
# include "SEAICE.h" |
56 |
# endif |
57 |
|
58 |
# include "ctrl.h" |
59 |
|
60 |
c == routine arguments == |
61 |
c note: under the multi-threaded model myiter and |
62 |
c mytime are local variables passed around as routine |
63 |
c arguments. Although this is fiddly it saves the need to |
64 |
c impose additional synchronisation points when they are |
65 |
c updated. |
66 |
c mythid - thread number for this instance of the routine. |
67 |
integer mythid |
68 |
|
69 |
#ifdef ALLOW_AUTODIFF_TAMC |
70 |
c == local variables == |
71 |
|
72 |
integer bi,bj |
73 |
integer I,J,K |
74 |
|
75 |
c-- == end of interface == |
76 |
|
77 |
#ifdef ALLOW_DEBUG |
78 |
IF ( debugLevel .GE. debLevB ) |
79 |
& CALL DEBUG_ENTER('AUTODIFF_RESTORE',myThid) |
80 |
#endif |
81 |
|
82 |
C-- Over all tiles |
83 |
DO bj = myByLo(myThid), myByHi(myThid) |
84 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
85 |
|
86 |
#ifndef AUTODIFF_USE_OLDSTORE_2D |
87 |
C- 2D arrays |
88 |
DO J=1-Oly,sNy+Oly |
89 |
DO I=1-Olx,sNx+Olx |
90 |
etan(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,1) |
91 |
surfaceforcingTice(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,2) |
92 |
taux0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,3) |
93 |
taux1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,4) |
94 |
tauy0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,5) |
95 |
tauy1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,6) |
96 |
qnet0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,7) |
97 |
qnet1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,8) |
98 |
empmr0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,9) |
99 |
empmr1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,10) |
100 |
sst0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,11) |
101 |
sst1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,12) |
102 |
sss0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,13) |
103 |
sss1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,14) |
104 |
saltflux0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,15) |
105 |
saltflux1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,16) |
106 |
#ifdef SHORTWAVE_HEATING |
107 |
qsw0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,17) |
108 |
qsw1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,18) |
109 |
#endif |
110 |
#ifdef ATMOSPHERIC_LOADING |
111 |
pload0(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,19) |
112 |
pload1(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,20) |
113 |
#endif |
114 |
#ifdef EXACT_CONSERV |
115 |
etaH(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,21) |
116 |
dEtaHdt(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,22) |
117 |
PmEpR(I,J,bi,bj) = StoreDynVars2D(I,J,bi,bj,23) |
118 |
#endif |
119 |
ENDDO |
120 |
ENDDO |
121 |
#endif /* AUTODIFF_USE_OLDSTORE_2D */ |
122 |
|
123 |
#ifndef AUTODIFF_USE_OLDSTORE_3D |
124 |
C- 3D arrays |
125 |
DO K=1,Nr |
126 |
DO J=1-Oly,sNy+Oly |
127 |
DO I=1-Olx,sNx+Olx |
128 |
gs(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,1) |
129 |
gt(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,2) |
130 |
#ifdef ALLOW_ADAMSBASHFORTH_3 |
131 |
gtnm(I,J,K,bi,bj,1) = StoreDynVars3D(I,J,K,bi,bj,3) |
132 |
gsnm(I,J,K,bi,bj,1) = StoreDynVars3D(I,J,K,bi,bj,4) |
133 |
gunm(I,J,K,bi,bj,1) = StoreDynVars3D(I,J,K,bi,bj,5) |
134 |
gvnm(I,J,K,bi,bj,1) = StoreDynVars3D(I,J,K,bi,bj,6) |
135 |
#else |
136 |
gtnm1(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,3) |
137 |
gsnm1(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,4) |
138 |
gunm1(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,5) |
139 |
gvnm1(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,6) |
140 |
#endif |
141 |
theta(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,7) |
142 |
salt(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,8) |
143 |
uvel(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,9) |
144 |
vvel(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,10) |
145 |
wvel(I,J,K,bi,bj) = StoreDynVars3D(I,J,K,bi,bj,11) |
146 |
totphihyd(I,J,K,bi,bj)= StoreDynVars3D(I,J,K,bi,bj,12) |
147 |
#ifdef ALLOW_ADAMSBASHFORTH_3 |
148 |
gtnm(I,J,K,bi,bj,2) = StoreDynVars3D(I,J,K,bi,bj,13) |
149 |
gsnm(I,J,K,bi,bj,2) = StoreDynVars3D(I,J,K,bi,bj,14) |
150 |
gunm(I,J,K,bi,bj,2) = StoreDynVars3D(I,J,K,bi,bj,15) |
151 |
gvnm(I,J,K,bi,bj,2) = StoreDynVars3D(I,J,K,bi,bj,16) |
152 |
#endif |
153 |
ENDDO |
154 |
ENDDO |
155 |
ENDDO |
156 |
#endif /* AUTODIFF_USE_OLDSTORE_3D */ |
157 |
|
158 |
ENDDO |
159 |
ENDDO |
160 |
|
161 |
#ifdef ALLOW_EXF |
162 |
|
163 |
C-- Over all tiles |
164 |
DO bj = myByLo(myThid), myByHi(myThid) |
165 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
166 |
C- 2D arrays |
167 |
DO J=1-Oly,sNy+Oly |
168 |
DO I=1-Olx,sNx+Olx |
169 |
hflux0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,1) |
170 |
hflux1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,2) |
171 |
sflux0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,3) |
172 |
sflux1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,4) |
173 |
ustress0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,5) |
174 |
ustress1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,6) |
175 |
vstress0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,7) |
176 |
vstress1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,8) |
177 |
wspeed0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,9) |
178 |
wspeed1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,10) |
179 |
# ifdef SHORTWAVE_HEATING |
180 |
swflux0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,11) |
181 |
swflux1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,12) |
182 |
# endif |
183 |
# ifdef ALLOW_RUNOFF |
184 |
runoff0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,13) |
185 |
runoff1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,14) |
186 |
# endif |
187 |
# ifdef ATMOSPHERIC_LOADING |
188 |
apressure0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,15) |
189 |
apressure1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,16) |
190 |
siceload(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,17) |
191 |
# endif |
192 |
# ifdef ALLOW_CLIMSSS_RELAXATION |
193 |
climsss0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,18) |
194 |
climsss1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,19) |
195 |
# endif |
196 |
# ifdef ALLOW_CLIMSST_RELAXATION |
197 |
climsst0(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,20) |
198 |
climsst1(I,J,bi,bj) = StoreEXF1(I,J,bi,bj,21) |
199 |
# endif |
200 |
enddo |
201 |
enddo |
202 |
enddo |
203 |
enddo |
204 |
|
205 |
# if (defined (ALLOW_ATM_TEMP) || defined (ALLOW_ATM_WIND)) |
206 |
C-- Over all tiles |
207 |
DO bj = myByLo(myThid), myByHi(myThid) |
208 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
209 |
C- 2D arrays |
210 |
DO J=1-Oly,sNy+Oly |
211 |
DO I=1-Olx,sNx+Olx |
212 |
# ifdef ALLOW_ATM_TEMP |
213 |
aqh0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,1) |
214 |
aqh1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,2) |
215 |
atemp0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,3) |
216 |
atemp1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,4) |
217 |
precip0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,5) |
218 |
precip1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,6) |
219 |
lwflux0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,7) |
220 |
lwflux1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,8) |
221 |
# ifdef EXF_READ_EVAP |
222 |
evap0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,9) |
223 |
evap1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,10) |
224 |
# else |
225 |
evap(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,9) |
226 |
# endif /* EXF_READ_EVAP */ |
227 |
# ifdef ALLOW_DOWNWARD_RADIATION |
228 |
swdown0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,11) |
229 |
swdown1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,12) |
230 |
lwdown0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,13) |
231 |
lwdown1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,14) |
232 |
# endif |
233 |
# endif /* ALLOW_ATM_TEMP */ |
234 |
# ifdef ALLOW_ATM_WIND |
235 |
uwind0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,15) |
236 |
uwind1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,16) |
237 |
vwind0(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,17) |
238 |
vwind1(I,J,bi,bj) = StoreEXF2(I,J,bi,bj,18) |
239 |
# endif /* ALLOW_ATM_WIND */ |
240 |
enddo |
241 |
enddo |
242 |
enddo |
243 |
enddo |
244 |
# endif /* ALLOW_ATM_TEMP */ |
245 |
|
246 |
C-- Over all tiles |
247 |
DO bj = myByLo(myThid), myByHi(myThid) |
248 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
249 |
C- 2D arrays |
250 |
DO J=1-Oly,sNy+Oly |
251 |
DO I=1-Olx,sNx+Olx |
252 |
# ifdef ALLOW_UWIND_CONTROL |
253 |
xx_uwind0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,1) |
254 |
xx_uwind1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,2) |
255 |
# endif |
256 |
# ifdef ALLOW_VWIND_CONTROL |
257 |
xx_vwind0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,3) |
258 |
xx_vwind1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,4) |
259 |
# endif |
260 |
# ifdef ALLOW_ATEMP_CONTROL |
261 |
xx_atemp0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,5) |
262 |
xx_atemp1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,6) |
263 |
# endif |
264 |
# ifdef ALLOW_AQH_CONTROL |
265 |
xx_aqh0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,7) |
266 |
xx_aqh1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,8) |
267 |
# endif |
268 |
# ifdef ALLOW_PRECIP_CONTROL |
269 |
xx_precip0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,9) |
270 |
xx_precip1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,10) |
271 |
# endif |
272 |
# ifdef ALLOW_SWFLUX_CONTROL |
273 |
xx_swflux0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,11) |
274 |
xx_swflux1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,12) |
275 |
# endif |
276 |
# ifdef ALLOW_SWDOWN_CONTROL |
277 |
xx_swdown0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,13) |
278 |
xx_swdown1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,14) |
279 |
# endif |
280 |
# ifdef ALLOW_LWDOWN_CONTROL |
281 |
xx_lwdown0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,15) |
282 |
xx_lwdown1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,16) |
283 |
# endif |
284 |
# ifdef ALLOW_APRESSURE_CONTROL |
285 |
xx_apressure0(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,17) |
286 |
xx_apressure1(I,J,bi,bj) = StoreCTRLS1(I,J,bi,bj,18) |
287 |
# endif |
288 |
enddo |
289 |
enddo |
290 |
enddo |
291 |
enddo |
292 |
#endif /* ALLOW_EXF */ |
293 |
|
294 |
#ifdef ALLOW_OBCS |
295 |
# ifdef ALLOW_OBCS_NORTH |
296 |
C-- Over all tiles |
297 |
DO bj = myByLo(myThid), myByHi(myThid) |
298 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
299 |
C- 2D arrays |
300 |
DO K=1,Nr |
301 |
DO I=1-Olx,sNx+Olx |
302 |
OBNt(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,1) |
303 |
OBNs(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,2) |
304 |
OBNu0(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,3) |
305 |
OBNv0(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,4) |
306 |
OBNt0(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,5) |
307 |
OBNs0(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,6) |
308 |
OBNu1(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,7) |
309 |
OBNv1(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,8) |
310 |
OBNt1(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,9) |
311 |
OBNs1(I,K,bi,bj) = StoreOBCSN(I,K,bi,bj,10) |
312 |
# ifdef ALLOW_OBCSN_CONTROL |
313 |
xx_obcsn0(I,K,bi,bj,1) = StoreOBCSN(I,K,bi,bj,11) |
314 |
xx_obcsn0(I,K,bi,bj,2) = StoreOBCSN(I,K,bi,bj,12) |
315 |
xx_obcsn0(I,K,bi,bj,3) = StoreOBCSN(I,K,bi,bj,13) |
316 |
xx_obcsn0(I,K,bi,bj,4) = StoreOBCSN(I,K,bi,bj,14) |
317 |
xx_obcsn1(I,K,bi,bj,1) = StoreOBCSN(I,K,bi,bj,15) |
318 |
xx_obcsn1(I,K,bi,bj,2) = StoreOBCSN(I,K,bi,bj,16) |
319 |
xx_obcsn1(I,K,bi,bj,3) = StoreOBCSN(I,K,bi,bj,17) |
320 |
xx_obcsn1(I,K,bi,bj,4) = StoreOBCSN(I,K,bi,bj,18) |
321 |
# endif |
322 |
enddo |
323 |
enddo |
324 |
enddo |
325 |
enddo |
326 |
# endif /* ALLOW_OBCS_NORTH */ |
327 |
|
328 |
# ifdef ALLOW_OBCS_SOUTH |
329 |
C-- Over all tiles |
330 |
DO bj = myByLo(myThid), myByHi(myThid) |
331 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
332 |
C- 2D arrays |
333 |
DO K=1,Nr |
334 |
DO I=1-Olx,sNx+Olx |
335 |
OBSt(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,1) |
336 |
OBSs(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,2) |
337 |
OBSu0(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,3) |
338 |
OBSv0(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,4) |
339 |
OBSt0(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,5) |
340 |
OBSs0(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,6) |
341 |
OBSu1(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,7) |
342 |
OBSv1(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,8) |
343 |
OBSt1(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,9) |
344 |
OBSs1(I,K,bi,bj) = StoreOBCSS(I,K,bi,bj,10) |
345 |
# ifdef ALLOW_OBCSS_CONTROL |
346 |
xx_obcss0(I,K,bi,bj,1) = StoreOBCSS(I,K,bi,bj,11) |
347 |
xx_obcss0(I,K,bi,bj,2) = StoreOBCSS(I,K,bi,bj,12) |
348 |
xx_obcss0(I,K,bi,bj,3) = StoreOBCSS(I,K,bi,bj,13) |
349 |
xx_obcss0(I,K,bi,bj,4) = StoreOBCSS(I,K,bi,bj,14) |
350 |
xx_obcss1(I,K,bi,bj,1) = StoreOBCSS(I,K,bi,bj,15) |
351 |
xx_obcss1(I,K,bi,bj,2) = StoreOBCSS(I,K,bi,bj,16) |
352 |
xx_obcss1(I,K,bi,bj,3) = StoreOBCSS(I,K,bi,bj,17) |
353 |
xx_obcss1(I,K,bi,bj,4) = StoreOBCSS(I,K,bi,bj,18) |
354 |
# endif |
355 |
enddo |
356 |
enddo |
357 |
enddo |
358 |
enddo |
359 |
# endif /* ALLOW_OBCS_SOUTH */ |
360 |
|
361 |
# ifdef ALLOW_OBCS_EAST |
362 |
C-- Over all tiles |
363 |
DO bj = myByLo(myThid), myByHi(myThid) |
364 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
365 |
C- 2D arrays |
366 |
DO K=1,Nr |
367 |
DO J=1-Oly,sNy+Oly |
368 |
OBEt(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,1) |
369 |
OBEs(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,2) |
370 |
OBEu0(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,3) |
371 |
OBEv0(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,4) |
372 |
OBEt0(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,5) |
373 |
OBEs0(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,6) |
374 |
OBEu1(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,7) |
375 |
OBEv1(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,8) |
376 |
OBEt1(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,9) |
377 |
OBEs1(J,K,bi,bj) = StoreOBCSE(J,K,bi,bj,10) |
378 |
# ifdef ALLOW_OBCSE_CONTROL |
379 |
xx_obcse0(J,K,bi,bj,1) = StoreOBCSE(J,K,bi,bj,11) |
380 |
xx_obcse0(J,K,bi,bj,2) = StoreOBCSE(J,K,bi,bj,12) |
381 |
xx_obcse0(J,K,bi,bj,3) = StoreOBCSE(J,K,bi,bj,13) |
382 |
xx_obcse0(J,K,bi,bj,4) = StoreOBCSE(J,K,bi,bj,14) |
383 |
xx_obcse1(J,K,bi,bj,1) = StoreOBCSE(J,K,bi,bj,15) |
384 |
xx_obcse1(J,K,bi,bj,2) = StoreOBCSE(J,K,bi,bj,16) |
385 |
xx_obcse1(J,K,bi,bj,3) = StoreOBCSE(J,K,bi,bj,17) |
386 |
xx_obcse1(J,K,bi,bj,4) = StoreOBCSE(J,K,bi,bj,18) |
387 |
# endif |
388 |
enddo |
389 |
enddo |
390 |
enddo |
391 |
enddo |
392 |
# endif /* ALLOW_OBCS_EAST */ |
393 |
|
394 |
# ifdef ALLOW_OBCS_WEST |
395 |
C-- Over all tiles |
396 |
DO bj = myByLo(myThid), myByHi(myThid) |
397 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
398 |
C- 2D arrays |
399 |
DO K=1,Nr |
400 |
DO J=1-Oly,sNy+Oly |
401 |
OBWt(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,1) |
402 |
OBWs(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,2) |
403 |
OBWu0(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,3) |
404 |
OBWv0(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,4) |
405 |
OBWt0(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,5) |
406 |
OBWs0(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,6) |
407 |
OBWu1(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,7) |
408 |
OBWv1(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,8) |
409 |
OBWt1(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,9) |
410 |
OBWs1(J,K,bi,bj) = StoreOBCSW(J,K,bi,bj,10) |
411 |
# ifdef ALLOW_OBCSW_CONTROL |
412 |
xx_obcsw0(J,K,bi,bj,1) = StoreOBCSW(J,K,bi,bj,11) |
413 |
xx_obcsw0(J,K,bi,bj,2) = StoreOBCSW(J,K,bi,bj,12) |
414 |
xx_obcsw0(J,K,bi,bj,3) = StoreOBCSW(J,K,bi,bj,13) |
415 |
xx_obcsw0(J,K,bi,bj,4) = StoreOBCSW(J,K,bi,bj,14) |
416 |
xx_obcsw1(J,K,bi,bj,1) = StoreOBCSW(J,K,bi,bj,15) |
417 |
xx_obcsw1(J,K,bi,bj,2) = StoreOBCSW(J,K,bi,bj,16) |
418 |
xx_obcsw1(J,K,bi,bj,3) = StoreOBCSW(J,K,bi,bj,17) |
419 |
xx_obcsw1(J,K,bi,bj,4) = StoreOBCSW(J,K,bi,bj,18) |
420 |
# endif |
421 |
enddo |
422 |
enddo |
423 |
enddo |
424 |
enddo |
425 |
# endif /* ALLOW_OBCS_WEST */ |
426 |
#endif /* ALLOW_OBCS */ |
427 |
|
428 |
#ifdef ALLOW_SEAICE |
429 |
C-- Over all tiles |
430 |
DO bj = myByLo(myThid), myByHi(myThid) |
431 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
432 |
C- 2D arrays |
433 |
DO J=1-Oly,sNy+Oly |
434 |
DO I=1-Olx,sNx+Olx |
435 |
AREA(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,1) |
436 |
HEFF(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,2) |
437 |
HSNOW(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,3) |
438 |
TICE(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,4) |
439 |
RUNOFF(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,5) |
440 |
# ifdef SEAICE_CGRID |
441 |
stressDivergenceX(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,14) |
442 |
stressDivergenceY(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,15) |
443 |
# endif |
444 |
# ifdef SEAICE_MULTICATEGORY |
445 |
cph moved to seaice_ad_check_lev because of extra dim. MULTDIM |
446 |
cph TICES(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,6) |
447 |
# endif |
448 |
# ifdef SEAICE_ALLOW_DYNAMICS |
449 |
UICE(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,7) |
450 |
VICE(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,8) |
451 |
ZETA(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,9) |
452 |
ETA(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,10) |
453 |
# ifdef SEAICE_CGRID |
454 |
dwatn(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,11) |
455 |
seaicemasku(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,12) |
456 |
seaicemaskv(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,13) |
457 |
# endif /* SEAICE_CGRID */ |
458 |
# ifdef SEAICE_ALLOW_EVP |
459 |
seaice_sigma1(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,16) |
460 |
seaice_sigma2(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,17) |
461 |
seaice_sigma12(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,18) |
462 |
# endif /* SEAICE_ALLOW_EVP */ |
463 |
# endif /* SEAICE_ALLOW_DYNAMICS */ |
464 |
# ifdef SEAICE_SALINITY |
465 |
HSALT(I,J,bi,bj) = StoreSEAICE(I,J,bi,bj,19) |
466 |
# endif |
467 |
enddo |
468 |
enddo |
469 |
enddo |
470 |
enddo |
471 |
#endif /* ALLOW_SEAICE */ |
472 |
|
473 |
#ifdef ALLOW_DEBUG |
474 |
IF ( debugLevel .GE. debLevB ) |
475 |
& CALL DEBUG_LEAVE('AUTODIFF_RESTORE',myThid) |
476 |
#endif |
477 |
|
478 |
#endif /* ALLOW_AUTODIFF_TAMC */ |
479 |
c************************************** |
480 |
|
481 |
return |
482 |
end |
483 |
|