/[MITgcm]/MITgcm/pkg/gmredi/gmredi_xtransport.F
ViewVC logotype

Contents of /MITgcm/pkg/gmredi/gmredi_xtransport.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download)
Wed Mar 6 01:56:27 2002 UTC (22 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint44h_pre
Changes since 1.5: +2 -2 lines
o GM Advective form:
 Tracers are advected using the residual transport (= Eulerian + GM-bolus).
 parameter GM_AdvSeparate=T return to previous form (i.e. compute separately
  Eulerian and Bolus advection fluxes)

1 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_xtransport.F,v 1.5 2001/12/16 18:54:49 jmc Exp $
2 C $Name: $
3
4 #include "GMREDI_OPTIONS.h"
5
6 subroutine GMREDI_XTRANSPORT(
7 I iMin,iMax,jMin,jMax,bi,bj,K,
8 I xA,Tracer,
9 U df,
10 I myThid)
11 C /==========================================================\
12 C | o SUBROUTINE GMREDI_XTRANSPORT |
13 C | Add horizontal x transport terms from GM/Redi |
14 C | parameterization. |
15 C |==========================================================|
16 C \==========================================================/
17 IMPLICIT NONE
18
19 C == GLobal variables ==
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23 #include "GRID.h"
24 #include "GMREDI.h"
25
26 C == Routine arguments ==
27 C iMin,iMax,jMin, - Range of points for which calculation
28 C jMax,bi,bj,k results will be set.
29 C xA - Area of X face
30 C Tracer - 3D Tracer field
31 C df - Diffusive flux component work array.
32 INTEGER iMin,iMax,jMin,jMax,bi,bj,k
33 _RS xA(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
34 _RL Tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
35 _RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
36 INTEGER myThid
37
38 #ifdef ALLOW_GMREDI
39
40 C == Local variables ==
41 C I, J - Loop counters
42 INTEGER I, J
43 INTEGER km1,kp1
44 _RL uTrans, maskp1, dTdz
45
46 IF (useGMRedi) THEN
47
48 C-- Area integrated zonal flux
49 DO j=jMin,jMax
50 DO i=iMin,iMax
51 df(i,j) = df(i,j)
52 & -xA(i,j)
53 #ifdef GM_NON_UNITY_DIAGONAL
54 & *Kux(i,j,k,bi,bj)
55 #else
56 & *(GM_isopycK
57 #ifdef GM_VISBECK_VARIABLE_K
58 & +0.5*(VisbeckK(i,j,bi,bj)+VisbeckK(i-1,j,bi,bj))
59 #endif
60 & )
61 #endif /* GM_NON_UNITY_DIAGONAL */
62 & *_recip_dxC(i,j,bi,bj)
63 & *(Tracer(i,j,k,bi,bj)-Tracer(i-1,j,k,bi,bj))
64 ENDDO
65 ENDDO
66
67 #ifdef GM_EXTRA_DIAGONAL
68 IF (GM_ExtraDiag) THEN
69 km1 = MAX(k-1,1)
70 kp1 = MIN(k+1,Nr)
71
72 DO j=jMin,jMax
73 DO i=iMin,iMax
74
75 C- Vertical gradients interpolated to U points
76 dTdz = 0.5*(
77 & +0.5*recip_drC(k)*
78 & ( maskC(i-1,j,k,bi,bj)*
79 & (Tracer(i-1,j,km1,bi,bj)-Tracer(i-1,j,k,bi,bj))
80 & +maskC( i ,j,k,bi,bj)*
81 & (Tracer( i ,j,km1,bi,bj)-Tracer( i ,j,k,bi,bj))
82 & )
83 & +0.5*recip_drC(kp1)*
84 & ( maskC(i-1,j,kp1,bi,bj)*
85 & (Tracer(i-1,j,k,bi,bj)-Tracer(i-1,j,kp1,bi,bj))
86 & +maskC( i ,j,kp1,bi,bj)*
87 & (Tracer( i ,j,k,bi,bj)-Tracer( i ,j,kp1,bi,bj))
88 & ) )
89
90 C- Off-diagonal components of horizontal flux
91 df(i,j) = df(i,j) - xA(i,j)*Kuz(i,j,k,bi,bj)*dTdz
92
93 ENDDO
94 ENDDO
95 ENDIF
96 #endif /* GM_EXTRA_DIAGONAL */
97
98 #ifdef GM_BOLUS_ADVEC
99 IF (GM_AdvForm .AND. GM_AdvSeparate) THEN
100 kp1 = MIN(k+1,Nr)
101 maskp1 = 1.
102 IF (k.GE.Nr) maskp1 = 0.
103 DO j=jMin,jMax
104 DO i=iMin,iMax
105 uTrans = dyG(i,j,bi,bj)*( GM_PsiX(i,j,kp1,bi,bj)*maskp1
106 & -GM_PsiX(i,j,k,bi,bj) )
107 & *maskW(i,j,k,bi,bj)
108 df(i,j) = df(i,j)
109 & +uTrans*0.5*(Tracer(i,j,k,bi,bj)+Tracer(i-1,j,k,bi,bj))
110 ENDDO
111 ENDDO
112 ENDIF
113 #endif /* GM_BOLUS_ADVEC */
114
115 ENDIF
116 #endif /* ALLOW_GMREDI */
117
118 RETURN
119 END

  ViewVC Help
Powered by ViewVC 1.1.22