1 |
C $Header: /u/gcmpack/MITgcm/pkg/mom_fluxform/mom_u_adv_wu.F,v 1.7 2003/10/09 04:19:20 edhill Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "MOM_FLUXFORM_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: MOM_U_ADV_WU |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE MOM_U_ADV_WU( |
11 |
I bi,bj,k, |
12 |
I uFld,wFld,rTrans, |
13 |
O advectiveFluxWU, |
14 |
I myThid) |
15 |
|
16 |
C !DESCRIPTION: |
17 |
C Calculates the vertical advective flux of zonal momentum: |
18 |
C \begin{equation*} |
19 |
C F^r = \overline{W}^i \overline{u}^{k} |
20 |
C \end{equation*} |
21 |
|
22 |
C !USES: =============================================================== |
23 |
IMPLICIT NONE |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
|
29 |
C !INPUT PARAMETERS: =================================================== |
30 |
C bi,bj :: tile indices |
31 |
C k :: vertical level |
32 |
C uFld :: zonal velocity |
33 |
C wFld :: vertical velocity |
34 |
C rTrans :: vertical transport (above U point) |
35 |
C myThid :: thread number |
36 |
INTEGER bi,bj,k |
37 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
38 |
_RL wFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
39 |
_RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
40 |
INTEGER myThid |
41 |
|
42 |
C !OUTPUT PARAMETERS: ================================================== |
43 |
C advectiveFluxWU :: advective flux |
44 |
_RL advectiveFluxWU(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
45 |
|
46 |
C !LOCAL VARIABLES: ==================================================== |
47 |
C i,j :: loop indices |
48 |
INTEGER I,J |
49 |
CEOP |
50 |
_RL tmpFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
51 |
|
52 |
IF ( k.EQ.Nr+1 .AND. |
53 |
& useRealFreshWaterFlux .AND. usingPCoords ) THEN |
54 |
DO j=1-Oly+1,sNy+Oly |
55 |
DO i=1-Olx+1,sNx+Olx |
56 |
advectiveFluxWU(i,j) = rTrans(i,j)*uFld(i,j,k-1,bi,bj) |
57 |
ENDDO |
58 |
ENDDO |
59 |
|
60 |
ELSEIF ( k.GT.Nr .OR. (k.EQ.1.AND.rigidLid) ) THEN |
61 |
C Advective flux = 0 at k=Nr+1 ; = 0 at k=1 if rigid-lid |
62 |
|
63 |
DO j=1-Oly,sNy+Oly |
64 |
DO i=1-Olx,sNx+Olx |
65 |
advectiveFluxWU(i,j) = 0. |
66 |
ENDDO |
67 |
ENDDO |
68 |
|
69 |
ELSEIF (k.EQ.1) THEN |
70 |
C (linear) Free-surface correction at k=1 |
71 |
|
72 |
DO j=1-Oly+1,sNy+Oly |
73 |
DO i=1-Olx+1,sNx+Olx |
74 |
advectiveFluxWU(i,j) = rTrans(i,j)*uFld(i,j,k,bi,bj) |
75 |
ENDDO |
76 |
ENDDO |
77 |
|
78 |
ELSE |
79 |
|
80 |
C Vertical advection - interior ; assume uFld & wFld are masked |
81 |
DO j=1-Oly+1,sNy+Oly |
82 |
DO i=1-Olx+1,sNx+Olx |
83 |
advectiveFluxWU(i,j) = rTrans(i,j)* |
84 |
& 0.5 _d 0*( uFld(i,j,k,bi,bj)+uFld(i,j,k-1,bi,bj) ) |
85 |
ENDDO |
86 |
ENDDO |
87 |
|
88 |
IF ( select_rStar.EQ.0 .AND. .NOT.rigidLid ) THEN |
89 |
C (linear) Free-surface correction at k>1 |
90 |
DO j=1-Oly+1,sNy+Oly |
91 |
DO i=1-Olx+1,sNx+Olx |
92 |
advectiveFluxWU(i,j) = advectiveFluxWU(i,j) |
93 |
& +0.25*( |
94 |
& wFld(i, j ,k,bi,bj)*rA(i, j ,bi,bj)* |
95 |
& (maskC(i,j,k,bi,bj) - maskC(i,j,k-1,bi,bj)) |
96 |
& +wFld(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj)* |
97 |
& (maskC(i-1,j,k,bi,bj)-maskC(i-1,j,k-1,bi,bj)) |
98 |
& )*uFld(i,j,k,bi,bj) |
99 |
ENDDO |
100 |
ENDDO |
101 |
C- endif NOT rigidLid |
102 |
ENDIF |
103 |
|
104 |
ENDIF |
105 |
|
106 |
RETURN |
107 |
END |