1 |
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 |
C $Name: $ |
3 |
|
4 |
#include "GAD_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GAD_DIFF_X |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE GAD_DIFF_X( |
11 |
I bi,bj,k, |
12 |
I xA, diffKh, |
13 |
I tracer, |
14 |
O dfx, |
15 |
I myThid ) |
16 |
|
17 |
C !DESCRIPTION: |
18 |
C Calculates the area integrated zonal flux due to down-gradient diffusion |
19 |
C of a tracer: |
20 |
C \begin{equation*} |
21 |
C F^x_{diff} = - A^x \kappa_h \frac{1}{\Delta x_c} \delta_i \theta |
22 |
C \end{equation*} |
23 |
|
24 |
C !USES: =============================================================== |
25 |
IMPLICIT NONE |
26 |
#include "SIZE.h" |
27 |
#include "GRID.h" |
28 |
|
29 |
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 |
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 |
INTEGER myThid |
41 |
|
42 |
C !OUTPUT PARAMETERS: ================================================== |
43 |
C dfx :: zonal diffusive flux |
44 |
_RL dfx (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 |
|
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 |