/[MITgcm]/MITgcm/pkg/timeave/timeave_cumul_2v.F
ViewVC logotype

Contents of /MITgcm/pkg/timeave/timeave_cumul_2v.F

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


Revision 1.5 - (show annotations) (download)
Thu Oct 9 04:19:20 2003 UTC (20 years, 8 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint52d_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52l_post, checkpoint52k_post, checkpoint54, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint52b_pre, checkpoint54b_post, checkpoint51l_pre, checkpoint52m_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint52f_pre, checkpoint54a_pre, checkpoint53c_post, checkpoint54a_post, checkpoint51r_post, checkpoint51i_post, checkpoint53a_post, checkpoint52d_post, checkpoint53g_post, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint53f_post, checkpoint52j_post, branch-netcdf, checkpoint52n_post, checkpoint53b_pre, checkpoint51o_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint53d_pre, checkpoint54c_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.4: +2 -2 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 C $Header: /u/u3/gcmpack/MITgcm/pkg/timeave/timeave_cumul_2v.F,v 1.4.2.1 2003/10/02 18:30:08 adcroft Exp $
2 C $Name: $
3 #include "TIMEAVE_OPTIONS.h"
4
5 CStartofinterface
6 SUBROUTINE TIMEAVE_CUMUL_2V(
7 O fldtave,
8 I fld1, fld2, Ksize, dir, deltaT,
9 I bi, bj, myThid )
10 C /==========================================================*
11 C | SUBROUTINE TIMEAVE_CUMUL_2V
12 C | o Sum over time a product of two arrays depending on the
13 C | relative position of the 2 fields.
14 C | (tracer point, u, v, w ...)
15 C \==========================================================*
16 IMPLICIT NONE
17
18 C == Global variables ===
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "GRID.h"
22
23 C == Routine arguments ==
24 C myThid - Thread number for this instance of the routine.
25 C fldtave - time averaged Field
26 C fld1,fld2 - Input Field
27 C dir - type of grid for 2nd array relatively to the 1rst array
28 C 0: same grid ; 1: dX/2 shift ; 2: dY/2 shift ; 3: dr/2 shift
29 C (2 digits => also shift the 1rst array)
30 C Ksize - 3rd dimension of local arrays (Input and Output fields)
31 INTEGER Ksize, dir
32 _RL fld1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
33 _RL fld2(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
34 _RL fldtave(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Ksize,nSx,nSy)
35 _RL deltaT
36 INTEGER bi, bj, myThid
37
38 CEndofinterface
39
40 #ifdef ALLOW_TIMEAVE
41 C == Local variables ==
42 C i,j,k,bi,bj - Loop counters
43 INTEGER i, j, k
44
45 IF ( dir.eq.0 ) THEN
46 c- both fields at the same location :
47
48 C DO bj = myByLo(myThid), myByHi(myThid)
49 C DO bi = myBxLo(myThid), myBxHi(myThid)
50 DO k=1,Ksize
51 DO j=1,sNy
52 DO i=1,sNx
53 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
54 & + fld1(i,j,k,bi,bj)*fld2(i,j,k,bi,bj)*deltaT
55 ENDDO
56 ENDDO
57 ENDDO
58 C ENDDO
59 C ENDDO
60
61 ELSEIF ( dir.eq.1 ) THEN
62 c- 2nd field shifted by -dX/2 (e.g.: 1=T, 2=U) :
63
64 DO k=1,Ksize
65 DO j=1,sNy
66 DO i=1,sNx
67 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
68 & + .5 * ( fld1(i-1,j,k,bi,bj) + fld1(i,j,k,bi,bj) )
69 & * fld2(i,j,k,bi,bj)
70 & * deltaT
71 ENDDO
72 ENDDO
73 ENDDO
74
75 ELSEIF ( dir.eq.2 ) THEN
76 c- 2nd field shifted by -dY/2 (e.g.: 1=T, 2=V) :
77
78 DO k=1,Ksize
79 DO j=1,sNy
80 DO i=1,sNx
81 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
82 & + .5 * ( fld1(i,j-1,k,bi,bj) + fld1(i,j,k,bi,bj) )
83 & * fld2(i,j,k,bi,bj)
84 & * deltaT
85 ENDDO
86 ENDDO
87 ENDDO
88
89 ELSEIF ( dir.eq.3 ) THEN
90 c- 2nd field shifted by -dR/2 (e.g.: 1=T, 2=W) :
91
92 DO k=2,Ksize
93 DO j=1,sNy
94 DO i=1,sNx
95 fldtave(i,j,k,bi,bj)= fldtave(i,j,k,bi,bj)
96 & + .5 * ( fld1(i,j,k-1,bi,bj) + fld1(i,j,k,bi,bj) )
97 & * fld2(i,j,k,bi,bj)
98 & * deltaT
99 ENDDO
100 ENDDO
101 ENDDO
102
103 ELSEIF ( dir.eq.12 ) THEN
104 c- 1rst & 2nd fields shifted by -dY/2 & -dX/2
105 c (e.g.: 1=U, 2=V, product at the corner) :
106
107 DO k=1,Ksize
108 DO j=1,sNy
109 DO i=1,sNx
110 fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
111 & + .25 _d 0*( fld1(i,j-1,k,bi,bj) + fld1(i,j,k,bi,bj) )
112 & *( fld2(i-1,j,k,bi,bj) + fld2(i,j,k,bi,bj) )
113 & * deltaT
114 ENDDO
115 ENDDO
116 ENDDO
117
118 ELSEIF ( dir.eq.13 ) THEN
119 c- 1rst & 2nd fields shifted by -dR/2 & -dX/2 (e.g.: 1=U, 2=W):
120
121 DO k=2,Ksize
122 DO j=1,sNy
123 DO i=1,sNx
124 fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
125 & + .25 _d 0*( fld1(i,j,k-1,bi,bj) + fld1(i,j,k,bi,bj) )
126 & *( fld2(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj)
127 & +fld2( i ,j,k,bi,bj)*rA( i ,j,bi,bj)
128 & )*recip_rAw(i,j,bi,bj)
129 & * deltaT
130 ENDDO
131 ENDDO
132 ENDDO
133
134 ELSEIF ( dir.eq.23 ) THEN
135 c- 1rst & 2nd fields shifted by -dR/2 & -dY/2 (e.g.: 1=V, 2=W):
136
137 DO k=2,Ksize
138 DO j=1,sNy
139 DO i=1,sNx
140 fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
141 & + .25 _d 0*( fld1(i,j,k-1,bi,bj) + fld1(i,j,k,bi,bj) )
142 & *( fld2(i,j-1,k,bi,bj)*rA(i,j-1,bi,bj)
143 & +fld2(i, j ,k,bi,bj)*rA(i, j ,bi,bj)
144 & )*recip_rAs(i,j,bi,bj)
145 & * deltaT
146 ENDDO
147 ENDDO
148 ENDDO
149
150 ELSEIF ( dir.eq.-13 ) THEN
151 c- gradient of the 1rst field * 2nd fields, shifted by -dR/2 & -dX/2 resp.
152 c- (e.g.: used for advective form of vertical advection: w.du/dr)
153
154 DO k=2,Ksize
155 DO j=1,sNy
156 DO i=1,sNx
157 fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
158 & + .5 _d 0*( fld1(i,j,k-1,bi,bj) - fld1(i,j,k,bi,bj) )
159 & *( fld2(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj)
160 & +fld2( i ,j,k,bi,bj)*rA( i ,j,bi,bj)
161 & )*recip_rAw(i,j,bi,bj)
162 & * deltaT
163 ENDDO
164 ENDDO
165 ENDDO
166
167 ELSEIF ( dir.eq.-23 ) THEN
168 c- gradient of the 1rst field * 2nd fields, shifted by -dR/2 & -dY/2 resp.
169 c- (e.g.: used for advective form of vertical advection: w.dv/dr)
170
171 DO k=2,Ksize
172 DO j=1,sNy
173 DO i=1,sNx
174 fldtave(i,j,k,bi,bj) = fldtave(i,j,k,bi,bj)
175 & + .5 _d 0*( fld1(i,j,k-1,bi,bj) - fld1(i,j,k,bi,bj) )
176 & *( fld2(i,j-1,k,bi,bj)*rA(i,j-1,bi,bj)
177 & +fld2(i, j ,k,bi,bj)*rA(i, j ,bi,bj)
178 & )*recip_rAs(i,j,bi,bj)
179 & * deltaT
180 ENDDO
181 ENDDO
182 ENDDO
183
184 ENDIF
185
186 #endif /* ALLOW_TIMEAVE */
187
188 RETURN
189 END

  ViewVC Help
Powered by ViewVC 1.1.22