1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/mom_fluxform/mom_u_adv_wu.F,v 1.2 2001/05/29 14:01:38 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_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, |
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 rTrans :: vertical transport |
33 |
C uFld :: zonal flow |
34 |
C myThid :: thread number |
35 |
INTEGER bi,bj,k |
36 |
_RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
37 |
_RL wFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
38 |
INTEGER myThid |
39 |
|
40 |
C !OUTPUT PARAMETERS: ================================================== |
41 |
C advectiveFluxWU :: advective flux |
42 |
_RL advectiveFluxWU(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
43 |
|
44 |
C !LOCAL VARIABLES: ==================================================== |
45 |
C i,j :: loop indices |
46 |
INTEGER I,J |
47 |
CEOP |
48 |
|
49 |
IF ( k.GT.Nr .OR. |
50 |
& (k.EQ.1.AND.rigidLid) ) THEN |
51 |
C Advective flux = 0 at k=Nr+1 ; = 0 at k=1 if rigid-lid |
52 |
|
53 |
DO j=1-Oly,sNy+Oly |
54 |
DO i=1-Olx,sNx+Olx |
55 |
advectiveFluxWU(i,j) = 0. |
56 |
ENDDO |
57 |
ENDDO |
58 |
|
59 |
ELSEIF (k.EQ.1) THEN |
60 |
C (linear) Free-surface correction at k=1 |
61 |
|
62 |
DO j=1-Oly,sNy+Oly |
63 |
DO i=1-Olx+1,sNx+Olx |
64 |
advectiveFluxWU(i,j) = |
65 |
& 0.5*( |
66 |
& wFld( i ,j,k,bi,bj)*rA( i ,j,bi,bj) |
67 |
& +wFld(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj) |
68 |
& )*uFld(i,j,k,bi,bj) |
69 |
ENDDO |
70 |
ENDDO |
71 |
|
72 |
ELSE |
73 |
|
74 |
C Vertical advection - interior ; assume uFld & wFld are masked |
75 |
DO j=1-Oly,sNy+Oly |
76 |
DO i=1-Olx+1,sNx+Olx |
77 |
advectiveFluxWU(i,j) = |
78 |
& 0.25*( |
79 |
& wFld( i ,j,k,bi,bj)*rA( i ,j,bi,bj) |
80 |
& +wFld(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj) |
81 |
& )*( uFld(i,j,k,bi,bj)+uFld(i,j,k-1,bi,bj) ) |
82 |
ENDDO |
83 |
ENDDO |
84 |
|
85 |
IF (.NOT. rigidLid) THEN |
86 |
C (linear) Free-surface correction at k>1 |
87 |
DO j=1-Oly,sNy+Oly |
88 |
DO i=1-Olx+1,sNx+Olx |
89 |
advectiveFluxWU(i,j) = advectiveFluxWU(i,j) |
90 |
& +0.25*( |
91 |
& wFld(i, j ,k,bi,bj)*rA(i, j ,bi,bj)* |
92 |
& (maskC(i,j,k,bi,bj) - maskC(i,j,k-1,bi,bj)) |
93 |
& +wFld(i-1,j,k,bi,bj)*rA(i-1,j,bi,bj)* |
94 |
& (maskC(i-1,j,k,bi,bj)-maskC(i-1,j,k-1,bi,bj)) |
95 |
& )*uFld(i,j,k,bi,bj) |
96 |
ENDDO |
97 |
ENDDO |
98 |
C- endif NOT rigidLid |
99 |
ENDIF |
100 |
|
101 |
ENDIF |
102 |
|
103 |
RETURN |
104 |
END |