1 |
jmc |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/cheapaml/gad_diff_2d_y.F,v 1.1 2008/08/05 21:49:31 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "GAD_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: GAD_DIFF_Y |
8 |
|
|
|
9 |
|
|
C !INTERFACE: ========================================================== |
10 |
jmc |
1.2 |
SUBROUTINE GAD_DIFF_2d_Y( |
11 |
jmc |
1.1 |
I bi,bj, |
12 |
|
|
I 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 |
|
|
#include "EEPARAMS.h" |
29 |
|
|
|
30 |
|
|
C !INPUT PARAMETERS: =================================================== |
31 |
|
|
C bi,bj :: tile indices |
32 |
|
|
C diffKh :: horizontal diffusivity |
33 |
|
|
C tracer :: tracer field |
34 |
|
|
C myThid :: thread number |
35 |
|
|
INTEGER bi,bj,k,jG |
36 |
|
|
_RL diffKh |
37 |
|
|
_RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
38 |
|
|
INTEGER myThid |
39 |
|
|
|
40 |
|
|
C !OUTPUT PARAMETERS: ================================================== |
41 |
|
|
C dfx :: meridional diffusive flux |
42 |
|
|
_RL dfy (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
43 |
|
|
|
44 |
|
|
C !LOCAL VARIABLES: ==================================================== |
45 |
|
|
C i,j :: loop indices |
46 |
|
|
INTEGER i,j |
47 |
|
|
CEOP |
48 |
|
|
|
49 |
|
|
DO i=1-Olx,sNx+Olx |
50 |
|
|
dfy(i,1-Oly)=0. |
51 |
|
|
ENDDO |
52 |
|
|
DO j=1-Oly+1,sNy+Oly |
53 |
|
|
DO i=1-Olx,sNx+Olx |
54 |
|
|
dfy(i,j) = -diffKh |
55 |
|
|
& *_recip_dyC(i,j,bi,bj) |
56 |
|
|
& *(Tracer(i,j)-Tracer(i,j-1)) |
57 |
|
|
#ifdef ISOTROPIC_COS_SCALING |
58 |
|
|
& *CosFacV(j,bi,bj) |
59 |
|
|
#endif |
60 |
|
|
jG = myYGlobalLo-1+(bj-1)*sNy+j |
61 |
jmc |
1.2 |
if(jG.eq.ny.or.jG.eq.1)dfy(i,j)=0.d0 |
62 |
jmc |
1.1 |
ENDDO |
63 |
|
|
ENDDO |
64 |
|
|
|
65 |
|
|
RETURN |
66 |
|
|
END |