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

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

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


Revision 1.12 - (hide annotations) (download)
Tue Jan 21 19:34:13 2003 UTC (21 years, 5 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint50c_post, checkpoint48e_post, checkpoint50c_pre, checkpoint48i_post, checkpoint51, checkpoint50, checkpoint50d_post, checkpoint50b_pre, checkpoint48b_post, checkpoint48c_pre, checkpoint48d_pre, checkpoint48d_post, checkpoint48f_post, checkpoint48h_post, checkpoint51b_pre, checkpoint48a_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint47j_post, checkpoint48c_post, checkpoint50g_post, checkpoint50h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint50e_post, checkpoint50d_pre, checkpoint48, checkpoint49, checkpoint48g_post, checkpoint50b_post, checkpoint51a_post
Changes since 1.11: +31 -10 lines
Yet more changes:
o adgmredi_calc_tensor
  avoiding all recomputation of gmredi_slope_limit
o adgmredi_x/y/rtransport
  added flag for excessive storing to avoid recomp. of
  u/v/rtans, dTdx/y/z
  -> this is not really necessary and very memory-consuming
o adgmredi_slope_psi:
  consistency with gmredi_slope_limit in treatment of GM_slopeSqCutoff
o gmredi_slope_limit
  re-activated full calculation of taperfct for case 'ac02'

1 heimbach 1.12 C $Header: /u/gcmpack/MITgcm/pkg/gmredi/gmredi_ytransport.F,v 1.11 2003/01/12 21:13:36 jmc Exp $
2 jmc 1.11 C $Name: $
3 adcroft 1.1
4     #include "GMREDI_OPTIONS.h"
5    
6     subroutine GMREDI_YTRANSPORT(
7     I iMin,iMax,jMin,jMax,bi,bj,K,
8 heimbach 1.8 I yA,Tracer,tracerIdentity,
9 adcroft 1.1 U df,
10     I myThid)
11     C /==========================================================\
12     C | o SUBROUTINE GMREDI_YTRANSPORT |
13     C | Add horizontal y 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 heimbach 1.7
26     #ifdef ALLOW_AUTODIFF_TAMC
27     #include "tamc.h"
28     #include "tamc_keys.h"
29     #endif /* ALLOW_AUTODIFF_TAMC */
30 adcroft 1.1
31     C == Routine arguments ==
32     C iMin,iMax,jMin, - Range of points for which calculation
33     C jMax,bi,bj,k results will be set.
34     C xA - Area of X face
35     C Tracer - 3D Tracer field
36     C df - Diffusive flux component work array.
37     INTEGER iMin,iMax,jMin,jMax,bi,bj,k
38     _RS yA(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39     _RL Tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
40 heimbach 1.9 integer tracerIdentity
41 adcroft 1.1 _RL df (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42     INTEGER myThid
43    
44     #ifdef ALLOW_GMREDI
45    
46     C == Local variables ==
47     C I, J - Loop counters
48     INTEGER I, J
49 heimbach 1.12 INTEGER km1,kp1
50     _RL maskp1
51     #ifdef GM_EXTRA_DIAGONAL
52     _RL dTdz(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
53     #endif
54     #ifdef GM_BOLUS_ADVEC
55     _RL vTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
56     #endif
57 adcroft 1.1
58 heimbach 1.7 #ifdef ALLOW_AUTODIFF_TAMC
59 heimbach 1.8 act0 = tracerIdentity - 1
60     max0 = maxpass
61 heimbach 1.7 act1 = bi - myBxLo(myThid)
62     max1 = myBxHi(myThid) - myBxLo(myThid) + 1
63     act2 = bj - myByLo(myThid)
64     max2 = myByHi(myThid) - myByLo(myThid) + 1
65     act3 = myThid - 1
66     max3 = nTx*nTy
67     act4 = ikey_dynamics - 1
68 heimbach 1.8 igadkey = (act0 + 1)
69     & + act1*max0
70     & + act2*max0*max1
71     & + act3*max0*max1*max2
72     & + act4*max0*max1*max2*max3
73     kkey = (igadkey-1)*Nr + k
74     if (tracerIdentity.GT.maxpass)
75     & STOP 'maxpass seems smaller than tracerIdentity'
76 heimbach 1.7 #endif /* ALLOW_AUTODIFF_TAMC */
77    
78 heimbach 1.2 IF (useGMRedi) THEN
79 heimbach 1.7
80     #ifdef ALLOW_AUTODIFF_TAMC
81 heimbach 1.8 # ifdef GM_NON_UNITY_DIAGONAL
82     CADJ STORE Kvy(:,:,k,bi,bj) =
83     CADJ & comlev1_gmredi_k_gad, key=kkey, byte=isbyte
84     # endif
85     # ifdef GM_EXTRA_DIAGONAL
86     CADJ STORE Kvz(:,:,k,bi,bj) =
87     CADJ & comlev1_gmredi_k_gad, key=kkey, byte=isbyte
88     # endif
89 heimbach 1.7 #endif
90 adcroft 1.1
91     C-- Area integrated meridional flux
92     DO j=jMin,jMax
93     DO i=iMin,iMax
94     df(i,j) = df(i,j)
95 jmc 1.5 & -yA(i,j)
96 adcroft 1.1 #ifdef GM_NON_UNITY_DIAGONAL
97 heimbach 1.3 & *Kvy(i,j,k,bi,bj)
98 jmc 1.5 #else
99     & *(GM_isopycK
100     #ifdef GM_VISBECK_VARIABLE_K
101 jmc 1.11 & +op5*(VisbeckK(i,j,bi,bj)+VisbeckK(i,j-1,bi,bj))
102 adcroft 1.1 #endif
103 jmc 1.5 & )
104     #endif /* GM_NON_UNITY_DIAGONAL */
105 adcroft 1.1 & *_recip_dyC(i,j,bi,bj)
106     & *(Tracer(i,j,k,bi,bj)-Tracer(i,j-1,k,bi,bj))
107     ENDDO
108     ENDDO
109 jmc 1.5
110     #ifdef GM_EXTRA_DIAGONAL
111     IF (GM_ExtraDiag) THEN
112     km1 = MAX(k-1,1)
113     kp1 = MIN(k+1,Nr)
114    
115     DO j=jMin,jMax
116     DO i=iMin,iMax
117    
118     C- Vertical gradients interpolated to V points
119 heimbach 1.12 dTdz(i,j) = op5*(
120 heimbach 1.10 & +op5*recip_drC(k)*
121 jmc 1.5 & ( maskC(i,j-1,k,bi,bj)*
122     & (Tracer(i,j-1,km1,bi,bj)-Tracer(i,j-1,k,bi,bj))
123     & +maskC(i, j ,k,bi,bj)*
124     & (Tracer(i, j ,km1,bi,bj)-Tracer(i, j ,k,bi,bj))
125     & )
126 heimbach 1.10 & +op5*recip_drC(kp1)*
127 jmc 1.5 & ( maskC(i,j-1,kp1,bi,bj)*
128     & (Tracer(i,j-1,k,bi,bj)-Tracer(i,j-1,kp1,bi,bj))
129     & +maskC(i, j ,kp1,bi,bj)*
130     & (Tracer(i, j ,k,bi,bj)-Tracer(i, j ,kp1,bi,bj))
131     & ) )
132 heimbach 1.12 ENDDO
133     ENDDO
134     #ifdef GM_AUTODIFF_EXCESSIVE_STORE
135     CADJ STORE dtdz(:,:) =
136     CADJ & comlev1_gmredi_k_gad, key=kkey, byte=isbyte
137     #endif
138     DO j=jMin,jMax
139     DO i=iMin,iMax
140 jmc 1.5 C- Off-diagonal components of horizontal flux
141 heimbach 1.12 df(i,j) = df(i,j) - yA(i,j)*Kvz(i,j,k,bi,bj)*dTdz(i,j)
142 jmc 1.5
143     ENDDO
144     ENDDO
145     ENDIF
146     #endif /* GM_EXTRA_DIAGONAL */
147    
148     #ifdef GM_BOLUS_ADVEC
149 jmc 1.6 IF (GM_AdvForm .AND. GM_AdvSeparate) THEN
150 jmc 1.5 kp1 = MIN(k+1,Nr)
151     maskp1 = 1.
152     IF (k.GE.Nr) maskp1 = 0.
153     DO j=jMin,jMax
154     DO i=iMin,iMax
155 heimbach 1.12 vTrans(i,j) = dxG(i,j,bi,bj)*( GM_PsiY(i,j,kp1,bi,bj)*maskp1
156     & -GM_PsiY(i,j,k,bi,bj) )
157     & *maskS(i,j,k,bi,bj)
158     ENDDO
159     ENDDO
160     #ifdef GM_AUTODIFF_EXCESSIVE_STORE
161     CADJ STORE vtrans(:,:) =
162     CADJ & comlev1_gmredi_k_gad, key=kkey, byte=isbyte
163     #endif
164     DO j=jMin,jMax
165     DO i=iMin,iMax
166 jmc 1.5 df(i,j) = df(i,j)
167 heimbach 1.12 & +vTrans(i,j)*op5*(Tracer(i,j,k,bi,bj)+Tracer(i,j-1,k,bi,bj))
168 jmc 1.5 ENDDO
169     ENDDO
170     ENDIF
171     #endif /* GM_BOLUS_ADVEC */
172 adcroft 1.1
173     ENDIF
174     #endif /* ALLOW_GMREDI */
175    
176     RETURN
177     END

  ViewVC Help
Powered by ViewVC 1.1.22