/[MITgcm]/MITgcm/model/src/integrate_for_w.F
ViewVC logotype

Contents of /MITgcm/model/src/integrate_for_w.F

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


Revision 1.16 - (show annotations) (download)
Mon May 23 00:39:20 2011 UTC (13 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62z, checkpoint62y, checkpoint63g, checkpoint64, checkpoint65, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, HEAD
Changes since 1.15: +10 -4 lines
Error occurred while calculating annotation data.
use new local variable rStarDhDt (instead of common block variable rStarDhCDt)
to pass as argument to S/R INTEGRATE_FOR_W.

1 C $Header: /u/gcmpack/MITgcm/model/src/integrate_for_w.F,v 1.15 2010/09/11 21:27:13 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INTEGRATE_FOR_W
8 C !INTERFACE:
9 SUBROUTINE INTEGRATE_FOR_W(
10 I bi, bj, k, uFld, vFld, mFld, rStarDhDt,
11 O wFld,
12 I myThid )
13
14 C !DESCRIPTION: \bv
15 C *==========================================================*
16 C | SUBROUTINE INTEGRATE_FOR_W
17 C | o Integrate for vertical velocity.
18 C *==========================================================*
19 C \ev
20
21 C !USES:
22 IMPLICIT NONE
23 C == GLobal variables ==
24 #include "SIZE.h"
25 #include "EEPARAMS.h"
26 #include "PARAMS.h"
27 #include "GRID.h"
28 #include "SURFACE.h"
29
30 C !INPUT/OUTPUT PARAMETERS:
31 C == Routine arguments ==
32 C uFld, vFld :: Zonal and meridional flow
33 C mFld :: added mass
34 C rStarDhDt :: relative time derivative of column thickness = d.eta/dt / H
35 C wFld :: Vertical flow
36 INTEGER bi,bj,k
37 _RL uFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
38 _RL vFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
39 #ifdef ALLOW_ADDFLUID
40 _RL mFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
41 #else
42 _RL mFld (1)
43 #endif
44 #if (defined NONLIN_FRSURF) && !(defined DISABLE_RSTAR_CODE)
45 _RL rStarDhDt(1-Olx:sNx+Olx,1-Oly:sNy+Oly)
46 #else
47 _RL rStarDhDt(1)
48 #endif
49 _RL wFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
50 INTEGER myThid
51
52 C !LOCAL VARIABLES:
53 C == Local variables ==
54 C uTrans, vTrans :: Temps. for volume transports
55 C conv2d :: horizontal transport convergence [m^3/s]
56 INTEGER i,j
57 _RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
58 _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
59 _RL conv2d(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60 CEOP
61
62 C-- Calculate velocity field "volume transports" through
63 C tracer cell faces (anelastic: scaled as a mass transport).
64 DO j=1,sNy+1
65 DO i=1,sNx+1
66 uTrans(i,j) = uFld(i,j,k,bi,bj)
67 & *_dyG(i,j,bi,bj)*deepFacC(k)*rhoFacC(k)
68 & *drF(k)*_hFacW(i,j,k,bi,bj)
69 vTrans(i,j) = vFld(i,j,k,bi,bj)
70 & *_dxG(i,j,bi,bj)*deepFacC(k)*rhoFacC(k)
71 & *drF(k)*_hFacS(i,j,k,bi,bj)
72 ENDDO
73 ENDDO
74 DO j=1,sNy
75 DO i=1,sNx
76 conv2d(i,j) = -( uTrans(i+1,j)-uTrans(i,j)
77 & +vTrans(i,j+1)-vTrans(i,j) )
78 ENDDO
79 ENDDO
80 #ifdef ALLOW_ADDFLUID
81 IF ( selectAddFluid.GE.1 ) THEN
82 DO j=1,sNy
83 DO i=1,sNx
84 conv2d(i,j) = conv2d(i,j)
85 & + mFld(i,j,k,bi,bj)*mass2rUnit
86 ENDDO
87 ENDDO
88 ENDIF
89 #endif /* ALLOW_ADDFLUID */
90
91 C-- Calculate vertical "volume transport" through face k
92 C between tracer cell k-1 & k
93 IF (rigidLid) THEN
94 C- o Rigid-Lid case: zero at lower and upper boundaries
95 IF (k.EQ.1) THEN
96 DO j=1,sNy
97 DO i=1,sNx
98 wFld(i,j,k,bi,bj) = 0.
99 ENDDO
100 ENDDO
101 ELSEIF (k.EQ.Nr) THEN
102 DO j=1,sNy
103 DO i=1,sNx
104 wFld(i,j,k,bi,bj) =
105 & conv2d(i,j)*recip_rA(i,j,bi,bj)
106 & *maskC(i,j,k,bi,bj)*maskC(i,j,k-1,bi,bj)
107 & *recip_deepFac2F(k)*recip_rhoFacF(k)
108 ENDDO
109 ENDDO
110 ELSE
111 DO j=1,sNy
112 DO i=1,sNx
113 wFld(i,j,k,bi,bj) =
114 & ( wFld(i,j,k+1,bi,bj)*deepFac2F(k+1)*rhoFacF(k+1)
115 & +conv2d(i,j)*recip_rA(i,j,bi,bj)
116 & )*maskC(i,j,k,bi,bj)*maskC(i,j,k-1,bi,bj)
117 & *recip_deepFac2F(k)*recip_rhoFacF(k)
118 ENDDO
119 ENDDO
120 ENDIF
121 #ifdef NONLIN_FRSURF
122 # ifndef DISABLE_RSTAR_CODE
123 ELSEIF ( select_rStar.NE.0 ) THEN
124 C- o rStar case: zero under-ground and at r_lower boundary
125 C can be non-zero at surface (useRealFreshWaterFlux).
126 IF (k.EQ.Nr) THEN
127 DO j=1,sNy
128 DO i=1,sNx
129 wFld(i,j,k,bi,bj) =
130 & ( conv2d(i,j)*recip_rA(i,j,bi,bj)
131 & -rStarDhDt(i,j)*drF(k)*h0FacC(i,j,k,bi,bj)
132 & )*maskC(i,j,k,bi,bj)
133 & *recip_deepFac2F(k)*recip_rhoFacF(k)
134 ENDDO
135 ENDDO
136 ELSE
137 DO j=1,sNy
138 DO i=1,sNx
139 wFld(i,j,k,bi,bj) =
140 & ( wFld(i,j,k+1,bi,bj)*deepFac2F(k+1)*rhoFacF(k+1)
141 & +conv2d(i,j)*recip_rA(i,j,bi,bj)
142 & -rStarDhDt(i,j)*drF(k)*h0FacC(i,j,k,bi,bj)
143 & )*maskC(i,j,k,bi,bj)
144 & *recip_deepFac2F(k)*recip_rhoFacF(k)
145 ENDDO
146 ENDDO
147 ENDIF
148 # endif /* DISABLE_RSTAR_CODE */
149 # ifndef DISABLE_SIGMA_CODE
150 ELSEIF ( selectSigmaCoord.NE.0 ) THEN
151 C- o Hybrid Sigma coordinate:
152 IF (k.EQ.Nr) THEN
153 DO j=1,sNy
154 DO i=1,sNx
155 wFld(i,j,k,bi,bj) =
156 & ( conv2d(i,j)*recip_rA(i,j,bi,bj)
157 & -dEtaHdt(i,j,bi,bj)*dBHybSigF(k)
158 & )*maskC(i,j,k,bi,bj)
159 ENDDO
160 ENDDO
161 ELSE
162 DO j=1,sNy
163 DO i=1,sNx
164 wFld(i,j,k,bi,bj) =
165 & ( wFld(i,j,k+1,bi,bj)
166 & +conv2d(i,j)*recip_rA(i,j,bi,bj)
167 & -dEtaHdt(i,j,bi,bj)*dBHybSigF(k)
168 & )*maskC(i,j,k,bi,bj)
169 ENDDO
170 ENDDO
171 ENDIF
172 # endif /* DISABLE_SIGMA_CODE */
173 #endif /* NONLIN_FRSURF */
174 ELSE
175 C- o Free Surface case (r-Coordinate):
176 C non zero at surface ; zero under-ground and at r_lower boundary
177 IF (k.EQ.Nr) THEN
178 DO j=1,sNy
179 DO i=1,sNx
180 wFld(i,j,k,bi,bj) =
181 & conv2d(i,j)*recip_rA(i,j,bi,bj)
182 & *maskC(i,j,k,bi,bj)
183 & *recip_deepFac2F(k)*recip_rhoFacF(k)
184 ENDDO
185 ENDDO
186 ELSE
187 DO j=1,sNy
188 DO i=1,sNx
189 wFld(i,j,k,bi,bj) =
190 & ( wFld(i,j,k+1,bi,bj)*deepFac2F(k+1)*rhoFacF(k+1)
191 & +conv2d(i,j)*recip_rA(i,j,bi,bj)
192 & )*maskC(i,j,k,bi,bj)
193 & *recip_deepFac2F(k)*recip_rhoFacF(k)
194 ENDDO
195 ENDDO
196 ENDIF
197 C- endif - rigid-lid / Free-Surf.
198 ENDIF
199
200 RETURN
201 END

  ViewVC Help
Powered by ViewVC 1.1.22