1 |
mlosch |
1.5 |
C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_u3_adv_x.F,v 1.4 2002/01/08 21:43:23 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "GAD_OPTIONS.h" |
5 |
|
|
|
6 |
adcroft |
1.3 |
CBOP |
7 |
|
|
C !ROUTINE: GAD_U3_ADV_X |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
jmc |
1.1 |
SUBROUTINE GAD_U3_ADV_X( |
11 |
|
|
I bi,bj,k, |
12 |
|
|
I uTrans, |
13 |
|
|
I tracer, |
14 |
|
|
O uT, |
15 |
|
|
I myThid ) |
16 |
adcroft |
1.3 |
|
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 |
jmc |
1.4 |
C Near boundaries, mask all the gradients ==> still 3rd O. |
25 |
adcroft |
1.3 |
|
26 |
|
|
C !USES: =============================================================== |
27 |
jmc |
1.1 |
IMPLICIT NONE |
28 |
|
|
#include "SIZE.h" |
29 |
|
|
#include "GRID.h" |
30 |
|
|
#include "GAD.h" |
31 |
|
|
|
32 |
adcroft |
1.3 |
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 |
jmc |
1.1 |
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 |
adcroft |
1.3 |
INTEGER myThid |
42 |
|
|
|
43 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
44 |
|
|
C uT :: zonal advective flux |
45 |
jmc |
1.1 |
_RL uT (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
46 |
|
|
|
47 |
adcroft |
1.3 |
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 |
jmc |
1.1 |
INTEGER i,j |
52 |
|
|
_RL Rjm,Rj,Rjp,Rjjm,Rjjp |
53 |
adcroft |
1.3 |
CEOP |
54 |
jmc |
1.1 |
|
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 |
mlosch |
1.5 |
ENDDO |
60 |
|
|
DO j=1-Oly,sNy+Oly |
61 |
jmc |
1.1 |
DO i=1-Olx+2,sNx+Olx-1 |
62 |
jmc |
1.4 |
Rjp=(tracer(i+1,j)-tracer(i,j))*maskW(i+1,j,k,bi,bj) |
63 |
|
|
Rj =(tracer(i,j)-tracer(i-1,j))*maskW(i,j,k,bi,bj) |
64 |
|
|
Rjm=(tracer(i-1,j)-tracer(i-2,j))*maskW(i-1,j,k,bi,bj) |
65 |
|
|
Rjjp=Rjp-Rj |
66 |
|
|
Rjjm=Rj-Rjm |
67 |
jmc |
1.1 |
uT(i,j) = |
68 |
|
|
& uTrans(i,j)*( |
69 |
|
|
& Tracer(i,j)+Tracer(i-1,j)-oneSixth*( Rjjp+Rjjm ) |
70 |
|
|
& )*0.5 _d 0 |
71 |
|
|
& +ABS( uTrans(i,j) )*0.5 _d 0*oneSixth*( Rjjp-Rjjm ) |
72 |
|
|
ENDDO |
73 |
|
|
ENDDO |
74 |
|
|
|
75 |
|
|
RETURN |
76 |
|
|
END |