1 |
C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/gad_diff_y.F,v 1.3 2001/09/21 13:11:43 adcroft Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "GAD_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: GAD_DIFF_Y |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE GAD_DIFF_Y( |
11 |
I bi,bj,k, |
12 |
I yA, diffKh, |
13 |
I tracer, |
14 |
O dfy, |
15 |
I myThid ) |
16 |
|
17 |
C !DESCRIPTION: |
18 |
C Calculates the area integrated meridional flux due to down-gradient |
19 |
C diffusion of a tracer: |
20 |
C \begin{equation*} |
21 |
C F^y_{diff} = - A^y \kappa_h \frac{1}{\Delta y_c} \delta_j \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 yA :: area of face at V points |
33 |
C diffKh :: horizontal diffusivity |
34 |
C tracer :: tracer field |
35 |
C myThid :: thread number |
36 |
INTEGER bi,bj,k |
37 |
_RS yA (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 :: meridional diffusive flux |
44 |
_RL dfy (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 i=1-Olx,sNx+Olx |
52 |
dfy(i,1-Oly)=0. |
53 |
ENDDO |
54 |
DO j=1-Oly+1,sNy+Oly |
55 |
DO i=1-Olx,sNx+Olx |
56 |
dfy(i,j) = -diffKh*yA(i,j) |
57 |
& *_recip_dyC(i,j,bi,bj)*recip_deepFacC(k) |
58 |
& *(tracer(i,j)-tracer(i,j-1)) |
59 |
#ifdef ISOTROPIC_COS_SCALING |
60 |
& *cosFacV(j,bi,bj) |
61 |
#endif |
62 |
ENDDO |
63 |
ENDDO |
64 |
|
65 |
RETURN |
66 |
END |