1 |
adcroft |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/generic_advdiff/gad_diff_x.F,v 1.2 2001/09/20 20:07:06 adcroft Exp $ |
2 |
adcroft |
1.2 |
C $Name: $ |
3 |
adcroft |
1.1 |
|
4 |
|
|
#include "GAD_OPTIONS.h" |
5 |
|
|
|
6 |
adcroft |
1.2 |
CBOP |
7 |
|
|
C !ROUTINE: GAD_DIFF_X |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
adcroft |
1.1 |
SUBROUTINE GAD_DIFF_X( |
11 |
|
|
I bi,bj,k, |
12 |
|
|
I xA, diffKh, |
13 |
|
|
I tracer, |
14 |
|
|
O dfx, |
15 |
|
|
I myThid ) |
16 |
adcroft |
1.2 |
|
17 |
|
|
C !DESCRIPTION: |
18 |
adcroft |
1.3 |
C Calculates the area integrated zonal flux due to down-gradient diffusion |
19 |
|
|
C of a tracer: |
20 |
adcroft |
1.2 |
C \begin{equation*} |
21 |
adcroft |
1.3 |
C F^x_{diff} = - A^x \kappa_h \frac{1}{\Delta x_c} \delta_i \theta |
22 |
adcroft |
1.2 |
C \end{equation*} |
23 |
|
|
|
24 |
|
|
C !USES: =============================================================== |
25 |
adcroft |
1.1 |
IMPLICIT NONE |
26 |
|
|
#include "SIZE.h" |
27 |
|
|
#include "GRID.h" |
28 |
|
|
|
29 |
adcroft |
1.2 |
C !INPUT PARAMETERS: =================================================== |
30 |
|
|
C bi,bj :: tile indices |
31 |
|
|
C k :: vertical level |
32 |
|
|
C xA :: area of face at U points |
33 |
|
|
C diffKh :: horizontal diffusivity |
34 |
|
|
C tracer :: tracer field |
35 |
|
|
C myThid :: thread number |
36 |
adcroft |
1.1 |
INTEGER bi,bj,k |
37 |
|
|
_RS xA (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
38 |
|
|
_RL diffKh |
39 |
|
|
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
40 |
adcroft |
1.2 |
INTEGER myThid |
41 |
|
|
|
42 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
43 |
|
|
C dfx :: zonal diffusive flux |
44 |
adcroft |
1.1 |
_RL dfx (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
45 |
|
|
|
46 |
adcroft |
1.2 |
C !LOCAL VARIABLES: ==================================================== |
47 |
|
|
C i,j :: loop indices |
48 |
adcroft |
1.1 |
INTEGER i,j |
49 |
adcroft |
1.2 |
CEOP |
50 |
adcroft |
1.1 |
|
51 |
|
|
DO j=1-Oly,sNy+Oly |
52 |
|
|
dfx(1-Olx,j)=0. |
53 |
|
|
DO i=1-Olx+1,sNx+Olx |
54 |
|
|
dfx(i,j) = -diffKh*xA(i,j) |
55 |
|
|
& *_recip_dxC(i,j,bi,bj) |
56 |
|
|
& *(Tracer(i,j)-Tracer(i-1,j)) |
57 |
|
|
& *CosFacU(j,bi,bj) |
58 |
|
|
ENDDO |
59 |
|
|
ENDDO |
60 |
|
|
|
61 |
|
|
RETURN |
62 |
|
|
END |