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

Annotation of /MITgcm/pkg/gmredi/gmredi_rtransport.F

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


Revision 1.4 - (hide annotations) (download)
Sun Feb 4 14:38:49 2001 UTC (23 years, 4 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint40pre3, checkpoint40pre1, checkpoint40pre7, checkpoint40pre6, checkpoint40pre8, checkpoint38, checkpoint40pre2, checkpoint40pre4, pre38tag1, c37_adj, pre38-close, checkpoint39, checkpoint37, checkpoint36, checkpoint35, checkpoint40pre5
Branch point for: pre38
Changes since 1.3: +2 -1 lines
Made sure each .F and .h file had
the CVS keywords Header and Name at its start.
Most had header but very few currently have Name, so
lots of changes!

1 cnh 1.4 C $Header: /u/gcmpack/models/MITgcmUV/pkg/gmredi/gmredi_rtransport.F,v 1.3 2001/01/29 20:07:39 heimbach Exp $
2     C $Name: $
3 adcroft 1.1
4     #include "GMREDI_OPTIONS.h"
5    
6     subroutine GMREDI_RTRANSPORT(
7     I iMin,iMax,jMin,jMax,bi,bj,K,
8     I maskUp,Tracer,
9     U df,
10     I myThid)
11     C /==========================================================\
12     C | o SUBROUTINE GMREDI_RTRANSPORT |
13     C | Add vertical 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 maskUp(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     _RL dTdx,dTdy
44    
45     C Surface flux is zero
46 heimbach 1.2 IF (useGMRedi .AND. K.GT.1) THEN
47 adcroft 1.1
48     DO j=jMin,jMax
49     DO i=iMin,iMax
50    
51     C- Horizontal gradients interpolated to W points
52     dTdx = 0.5*(
53     & +0.5*(_maskW(i+1,j,k,bi,bj)
54     & *_recip_dxC(i+1,j,bi,bj)*
55     & (Tracer(i+1,j,k,bi,bj)-Tracer(i,j,k,bi,bj))
56     & +_maskW(i,j,k,bi,bj)
57     & *_recip_dxC(i,j,bi,bj)*
58     & (Tracer(i,j,k,bi,bj)-Tracer(i-1,j,k,bi,bj)))
59     & +0.5*(_maskW(i+1,j,k-1,bi,bj)
60     & *_recip_dxC(i+1,j,bi,bj)*
61     & (Tracer(i+1,j,k-1,bi,bj)-Tracer(i,j,k-1,bi,bj))
62     & +_maskW(i,j,k-1,bi,bj)
63     & *_recip_dxC(i,j,bi,bj)*
64     & (Tracer(i,j,k-1,bi,bj)-Tracer(i-1,j,k-1,bi,bj)))
65     & )
66    
67     dTdy = 0.5*(
68     & +0.5*(_maskS(i,j,k,bi,bj)
69     & *_recip_dyC(i,j,bi,bj)*
70     & (Tracer(i,j,k,bi,bj)-Tracer(i,j-1,k,bi,bj))
71     & +_maskS(i,j+1,k,bi,bj)
72     & *_recip_dyC(i,j+1,bi,bj)*
73     & (Tracer(i,j+1,k,bi,bj)-Tracer(i,j,k,bi,bj)))
74     & +0.5*(_maskS(i,j,k-1,bi,bj)
75     & *_recip_dyC(i,j,bi,bj)*
76     & (Tracer(i,j,k-1,bi,bj)-Tracer(i,j-1,k-1,bi,bj))
77     & +_maskS(i,j+1,k-1,bi,bj)
78     & *_recip_dyC(i,j+1,bi,bj)*
79     & (Tracer(i,j+1,k-1,bi,bj)-Tracer(i,j,k-1,bi,bj)))
80     & )
81    
82     C- Off-diagonal components of vertical flux
83     df(i,j) = df(i,j)
84     & - _rA(i,j,bi,bj)
85     & *(GM_background_K
86     #ifdef GM_VISBECK_VARIABLE_K
87 heimbach 1.3 & +VisbeckK(i,j,bi,bj)
88 adcroft 1.1 #endif
89 heimbach 1.3 & )*( Kwx(i,j,k,bi,bj)*dTdx +Kwy(i,j,k,bi,bj)*dTdy )
90 adcroft 1.1
91     ENDDO
92     ENDDO
93    
94     c IF (.NOT.implicitDiffusion) THEN
95     c
96     c This vertical diffusion term is currently implemented
97     c by adding the VisbeckK*Kwz diffusivity to KappaRT/S
98     c See calc_diffusivity.F and calc_gt.F (calc_gs.F)
99     c
100     c DO j=jMin,jMax
101     c DO i=iMin,iMax
102     c df(i,j) = df(i,j) - _rA(i,j,bi,bj)
103 heimbach 1.3 c & *maskUp(i,j)*VisbeckK(i,j,bi,bj)*Kwz(i,j,k,bi,bj)
104 adcroft 1.1 c & *recip_drC(k)*rkfac
105     c & *(Tracer(i,j,k-1,bi,bj)-Tracer(i,j,k,bi,bj))
106     c ENDDO
107     c ENDDO
108     c ENDIF
109    
110     ENDIF
111     #endif /* ALLOW_GMREDI */
112    
113     RETURN
114     END

  ViewVC Help
Powered by ViewVC 1.1.22