/[MITgcm]/MITgcm/pkg/autodiff/autodiff_store.F
ViewVC logotype

Annotation of /MITgcm/pkg/autodiff/autodiff_store.F

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


Revision 1.1 - (hide annotations) (download)
Fri Jun 1 23:30:16 2007 UTC (17 years, 1 month ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint59d, checkpoint59c
Re-organized adjoint checkpointing according to Matt Mazloff
(but with modifs/completions/cleanups)
Storing is now bundled into large arrays to optimized I/O
(and second step in cleanup of the_main_loop)

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

  ViewVC Help
Powered by ViewVC 1.1.22