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

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

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


Revision 1.11 - (show annotations) (download)
Fri Jan 10 00:48:39 2003 UTC (21 years, 5 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint47i_post, checkpoint47g_post, checkpoint47h_post
Changes since 1.10: +9 -10 lines
Here they are, before they get changed/lost/stolen.
Mostly modif.'s to fix numerical sensitivities.
Gradient checks OK for
- GM_taper_scheme:
  * clipping
  * ac02
  * linear
  * glw91
  * dm95
  * ldd97
- GMREDI_OPTIONS:
  * GM_VISBECK_VARIABLE_K
  * GM_NON_UNITY_DIAGONAL
  * GM_EXTRA_DIAGONAL
  * GM_BOLUS_ADVEC
in conjunction with data.gmredi parameters to be checked in
in a few minutes under verification/carbon/code/

1 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_rtransport.F,v 1.10 2002/11/15 02:57:47 heimbach Exp $
2 C $Name: checkpoint47 $
3
4 #include "GMREDI_OPTIONS.h"
5
6 subroutine GMREDI_RTRANSPORT(
7 I iMin,iMax,jMin,jMax,bi,bj,K,
8 I Tracer,tracerIdentity,
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 _RL Tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
34 INTEGER tracerIdentity
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 _RL rTrans
45
46 C Surface flux is zero
47 IF (useGMRedi .AND. K.GT.1) THEN
48
49 DO j=jMin,jMax
50 DO i=iMin,iMax
51
52 C- Horizontal gradients interpolated to W points
53 dTdx = op5*(
54 & +op5*(_maskW(i+1,j,k,bi,bj)
55 & *_recip_dxC(i+1,j,bi,bj)*
56 & (Tracer(i+1,j,k,bi,bj)-Tracer(i,j,k,bi,bj))
57 & +_maskW(i,j,k,bi,bj)
58 & *_recip_dxC(i,j,bi,bj)*
59 & (Tracer(i,j,k,bi,bj)-Tracer(i-1,j,k,bi,bj)))
60 & +op5*(_maskW(i+1,j,k-1,bi,bj)
61 & *_recip_dxC(i+1,j,bi,bj)*
62 & (Tracer(i+1,j,k-1,bi,bj)-Tracer(i,j,k-1,bi,bj))
63 & +_maskW(i,j,k-1,bi,bj)
64 & *_recip_dxC(i,j,bi,bj)*
65 & (Tracer(i,j,k-1,bi,bj)-Tracer(i-1,j,k-1,bi,bj)))
66 & )
67
68 dTdy = op5*(
69 & +op5*(_maskS(i,j,k,bi,bj)
70 & *_recip_dyC(i,j,bi,bj)*
71 & (Tracer(i,j,k,bi,bj)-Tracer(i,j-1,k,bi,bj))
72 & +_maskS(i,j+1,k,bi,bj)
73 & *_recip_dyC(i,j+1,bi,bj)*
74 & (Tracer(i,j+1,k,bi,bj)-Tracer(i,j,k,bi,bj)))
75 & +op5*(_maskS(i,j,k-1,bi,bj)
76 & *_recip_dyC(i,j,bi,bj)*
77 & (Tracer(i,j,k-1,bi,bj)-Tracer(i,j-1,k-1,bi,bj))
78 & +_maskS(i,j+1,k-1,bi,bj)
79 & *_recip_dyC(i,j+1,bi,bj)*
80 & (Tracer(i,j+1,k-1,bi,bj)-Tracer(i,j,k-1,bi,bj)))
81 & )
82
83 C- Off-diagonal components of vertical flux
84 df(i,j) = df(i,j)
85 & - _rA(i,j,bi,bj)
86 & *( Kwx(i,j,k,bi,bj)*dTdx +Kwy(i,j,k,bi,bj)*dTdy )
87
88 ENDDO
89 ENDDO
90
91 #ifdef GM_BOLUS_ADVEC
92 IF (GM_AdvForm .AND. GM_AdvSeparate) THEN
93 DO j=jMin,jMax
94 DO i=iMin,iMax
95 rTrans =
96 & dyG(i+1,j,bi,bj)*GM_PsiX(i+1,j,k,bi,bj)
97 & -dyG( i ,j,bi,bj)*GM_PsiX( i ,j,k,bi,bj)
98 & +dxG(i,j+1,bi,bj)*GM_PsiY(i,j+1,k,bi,bj)
99 & -dxG(i, j ,bi,bj)*GM_PsiY(i, j ,k,bi,bj)
100 df(i,j) = df(i,j)
101 & +rTrans*op5
102 & *(Tracer(i,j,k,bi,bj)+Tracer(i,j,k-1,bi,bj))
103 ENDDO
104 ENDDO
105 ENDIF
106 #endif /* GM_BOLUS_ADVEC */
107
108 c IF (.NOT.implicitDiffusion) THEN
109 c
110 c This vertical diffusion term is currently implemented
111 c by adding the VisbeckK*Kwz diffusivity to KappaRT/S
112 c See calc_diffusivity.F and calc_gt.F (calc_gs.F)
113 c
114 c DO j=jMin,jMax
115 c DO i=iMin,iMax
116 c df(i,j) = df(i,j) - _rA(i,j,bi,bj)
117 c & *maskUp(i,j)*VisbeckK(i,j,bi,bj)*Kwz(i,j,k,bi,bj)
118 c & *recip_drC(k)*rkfac
119 c & *(Tracer(i,j,k-1,bi,bj)-Tracer(i,j,k,bi,bj))
120 c ENDDO
121 c ENDDO
122 c ENDIF
123
124 ENDIF
125 #endif /* ALLOW_GMREDI */
126
127 RETURN
128 END

  ViewVC Help
Powered by ViewVC 1.1.22