1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_u3_adv_x.F,v 1.3 2001/09/26 19:05:21 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GAD_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GAD_U3_ADV_X |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE GAD_U3_ADV_X( |
11 |
I bi,bj,k, |
12 |
I uTrans, |
13 |
I tracer, |
14 |
O uT, |
15 |
I myThid ) |
16 |
|
17 |
C !DESCRIPTION: |
18 |
C Calculates the area integrated zonal flux due to advection of a tracer |
19 |
C using upwind biased third-order interpolation (or the $\kappa=1/3$ scheme): |
20 |
C \begin{equation*} |
21 |
C F^x_{adv} = U \overline{ \theta - \frac{1}{6} \delta_{ii} \theta }^i |
22 |
C + \frac{1}{12} |U| \delta_{iii} \theta |
23 |
C \end{equation*} |
24 |
C Near boundaries, mask all the gradients ==> still 3rd O. |
25 |
|
26 |
C !USES: =============================================================== |
27 |
IMPLICIT NONE |
28 |
#include "SIZE.h" |
29 |
#include "GRID.h" |
30 |
#include "GAD.h" |
31 |
|
32 |
C !INPUT PARAMETERS: =================================================== |
33 |
C bi,bj :: tile indices |
34 |
C k :: vertical level |
35 |
C uTrans :: zonal volume transport |
36 |
C tracer :: tracer field |
37 |
C myThid :: thread number |
38 |
INTEGER bi,bj,k |
39 |
_RL uTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
40 |
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
41 |
INTEGER myThid |
42 |
|
43 |
C !OUTPUT PARAMETERS: ================================================== |
44 |
C uT :: zonal advective flux |
45 |
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
46 |
|
47 |
C !LOCAL VARIABLES: ==================================================== |
48 |
C i,j :: loop indices |
49 |
C Rjm,Rj,Rjp :: differences at i-1,i,i+1 |
50 |
C Rjjm,Rjjp :: second differences at i-1,i |
51 |
INTEGER i,j |
52 |
_RL Rjm,Rj,Rjp,Rjjm,Rjjp |
53 |
CEOP |
54 |
|
55 |
DO j=1-Oly,sNy+Oly |
56 |
uT(1-Olx,j)=0. |
57 |
uT(2-Olx,j)=0. |
58 |
uT(sNx+Olx,j)=0. |
59 |
DO i=1-Olx+2,sNx+Olx-1 |
60 |
Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj) |
61 |
Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj) |
62 |
Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj) |
63 |
Rjjp=Rjp-Rj |
64 |
Rjjm=Rj-Rjm |
65 |
uT(i,j) = |
66 |
& uTrans(i,j)*( |
67 |
& Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm ) |
68 |
& )*0.5 _d 0 |
69 |
& +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm ) |
70 |
ENDDO |
71 |
ENDDO |
72 |
|
73 |
RETURN |
74 |
END |