/[MITgcm]/MITgcm/model/src/convective_adjustment.F
ViewVC logotype

Contents of /MITgcm/model/src/convective_adjustment.F

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


Revision 1.19 - (show annotations) (download)
Thu Oct 9 04:19:18 2003 UTC (20 years, 7 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52d_pre, checkpoint51o_pre, checkpoint51l_post, checkpoint52, checkpoint51t_post, checkpoint51n_post, checkpoint51s_post, checkpoint51n_pre, checkpoint52b_pre, checkpoint51l_pre, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint51r_post, checkpoint51i_post, checkpoint52d_post, checkpoint52a_pre, branch-netcdf, checkpoint51o_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.18: +4 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 C $Header: /u/u3/gcmpack/MITgcm/model/src/convective_adjustment.F,v 1.18.2.1 2003/10/02 18:10:45 edhill Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: CONVECTIVE_ADJUSTMENT
9 C !INTERFACE:
10 SUBROUTINE CONVECTIVE_ADJUSTMENT(
11 I bi, bj, iMin, iMax, jMin, jMax,
12 I myTime, myIter, myThid )
13 C !DESCRIPTION: \bv
14 C *==========================================================*
15 C | SUBROUTINE CONVECTIVE_ADJUSTMENT
16 C | o Driver for vertical mixing or similar parameterization
17 C *==========================================================*
18 C \ev
19
20 C !USES:
21 IMPLICIT NONE
22 C == Global data ==
23 #include "SIZE.h"
24 #include "EEPARAMS.h"
25 #include "PARAMS.h"
26 #include "DYNVARS.h"
27 #include "GRID.h"
28 #ifdef ALLOW_PASSIVE_TRACER
29 #include "TR1.h"
30 #endif
31 #ifdef ALLOW_TIMEAVE
32 #include "TIMEAVE_STATV.h"
33 #endif
34 #ifdef ALLOW_AUTODIFF_TAMC
35 #include "tamc.h"
36 #include "tamc_keys.h"
37 #endif /* ALLOW_AUTODIFF_TAMC */
38 EXTERNAL DIFFERENT_MULTIPLE
39 LOGICAL DIFFERENT_MULTIPLE
40
41 C !INPUT/OUTPUT PARAMETERS:
42 C == Routine arguments ==
43 C bi,bj,iMin,iMax,jMin,jMax,K - Loop counters
44 C myTime - Current time in simulation
45 C myIter - Current iteration in simulation
46 C myThid - Thread number of this instance of S/R CONVECT
47 INTEGER bi,bj,iMin,iMax,jMin,jMax
48 _RL myTime
49 INTEGER myIter
50 INTEGER myThid
51
52 #ifdef INCLUDE_CONVECT_CALL
53
54 C !LOCAL VARIABLES:
55 C == Local variables ==
56 C rhoKm1, rhoK :: Density at adjacent levels (common ref. level)
57 C ConvectCount :: Convection mixing freq. counter.
58 INTEGER i, j, K, kTop, kBottom, kDir, deltaK
59 _RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
60 _RL rhoK (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
61 _RL ConvectCount(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
62 _RL weightA(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
63 _RL weightB(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
64 CEOP
65
66 C-- Check to see if should convect now
67 IF ( DIFFERENT_MULTIPLE(cAdjFreq,myTime,myTime-deltaTClock) ) THEN
68
69 C-- Initialise counters
70 kTop = 0
71 kBottom = 0
72 kDir = 0
73 deltaK = 0
74
75 C- Initialisation of Convection Counter
76 DO K=1,Nr
77 DO j=1-OLy,sNy+OLy
78 DO i=1-OLx,sNx+OLx
79 ConvectCount(i,j,k) = 0.
80 ENDDO
81 ENDDO
82 ENDDO
83
84 #ifdef ALLOW_AUTODIFF_TAMC
85 act1 = bi - myBxLo(myThid)
86 max1 = myBxHi(myThid) - myBxLo(myThid) + 1
87 act2 = bj - myByLo(myThid)
88 max2 = myByHi(myThid) - myByLo(myThid) + 1
89 act3 = myThid - 1
90 max3 = nTx*nTy
91 act4 = ikey_dynamics - 1
92 ikey = (act1 + 1) + act2*max1
93 & + act3*max1*max2
94 & + act4*max1*max2*max3
95 #endif /* ALLOW_AUTODIFF_TAMC */
96
97 #ifdef ALLOW_KPP
98 C-- CONVECT not needed with KPP mixing
99 IF (
100 & (.NOT.useKPP)
101 & ) THEN
102 #endif /* ALLOW_KPP */
103
104 IF ( buoyancyRelation .eq. 'OCEANIC' ) THEN
105 kTop = 2
106 kBottom = Nr
107 kDir = 1
108 deltaK = -1
109 ELSEIF ( buoyancyRelation .eq. 'OCEANICP' ) THEN
110 kTop = Nr
111 kBottom = 2
112 kDir = -1
113 deltaK = 0
114 ELSEIF ( buoyancyRelation .eq. 'ATMOSPHERIC' ) THEN
115 kTop = Nr
116 kBottom = 2
117 kDir = -1
118 deltaK = 0
119 ELSE
120 STOP 'CONVECTIVE_ADJUSTMENT: We should never reach this point'
121 ENDIF
122
123 C-- Loop over all *interior* layers
124 DO K=kTop,kBottom,kDir
125
126 #ifdef ALLOW_AUTODIFF_TAMC
127 kkey = (ikey-1)*Nr + k
128 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
129 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
130 #endif /* ALLOW_AUTODIFF_TAMC */
131 C- Density of K-1 layer (above W(K)) reference to K-1 T-level
132 CALL FIND_RHO(
133 I bi,bj,iMin,iMax,jMin,jMax,K-1,K+deltaK,
134 I theta,salt,
135 O rhoKm1,
136 I myThid )
137
138 C- Density of K layer (below W(K)) reference to K-1 T-level.
139 #ifdef ALLOW_AUTODIFF_TAMC
140 CADJ STORE theta(:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
141 CADJ STORE salt (:,:,k,bi,bj) = comlev1_bibj_k, key=kkey, byte=isbyte
142 #endif /* ALLOW_AUTODIFF_TAMC */
143 CALL FIND_RHO(
144 I bi,bj,iMin,iMax,jMin,jMax,K,K+deltaK,
145 I theta,salt,
146 O rhoK,
147 I myThid )
148
149 #ifdef ALLOW_AUTODIFF_TAMC
150 CADJ STORE rhoKm1(:,:) = comlev1_bibj_k, key = kkey, byte = isbyte
151 CADJ STORE rhoK (:,:) = comlev1_bibj_k, key = kkey, byte = isbyte
152 #endif /* ALLOW_AUTODIFF_TAMC */
153 C- Check static stability with layer below and mix as needed.
154 c CALL CONVECT(
155 c I bi,bj,iMin,iMax,jMin,jMax,K,rhoKm1,rhoK,
156 c U ConvectCount,
157 c I myTime,myIter,myThid)
158
159 C- Pre-calculate mixing weights for interface K
160 CALL CONVECTIVE_WEIGHTS(
161 I bi,bj,K,rhoKm1,rhoK,
162 O weightA,weightB,ConvectCount,
163 I myThid)
164
165 C- Convectively mix heat across interface K
166 CALL CONVECTIVELY_MIXTRACER(
167 I bi,bj,k,weightA,weightB,
168 U theta,
169 I myThid)
170
171 C- Convectively mix salt across interface K
172 CALL CONVECTIVELY_MIXTRACER(
173 I bi,bj,k,weightA,weightB,
174 U salt,
175 I myThid)
176
177 #ifdef ALLOW_PASSIVE_TRACER
178 C- Convectively mix passive tracer across interface K
179 ceh3 needs an IF ( usePASSIVE_TRACER ) THEN
180 CALL CONVECTIVELY_MIXTRACER(
181 I bi,bj,k,weightA,weightB,
182 U Tr1,
183 I myThid)
184 #endif /* ALLOW_PASSIVE_TRACER */
185
186 #ifdef ALLOW_PTRACERS
187 C- Convectively mix passive tracers across interface K
188 IF ( usePTRACERS ) THEN
189 CALL PTRACERS_CONVECT(
190 I bi,bj,k,weightA,weightB,myThid)
191 ENDIF
192 #endif /* ALLOW_PTRACERS */
193
194 C-- End DO K=1,Nr
195 ENDDO
196
197 #ifdef ALLOW_TIMEAVE
198 ceh3 needs an IF ( useTIMEAVE ) THEN
199 IF (myIter.ne.nIter0 .AND. taveFreq.GT.0.) THEN
200 CALL TIMEAVE_CUMUL_1T(ConvectCountTave, ConvectCount,
201 I Nr, deltaTclock, bi, bj, myThid)
202 ENDIF
203 #endif /* ALLOW_TIMEAVE */
204
205 #ifdef ALLOW_KPP
206 C-- End IF (.NOT.useKPP)
207 ENDIF
208 #endif /* ALLOW_KPP */
209
210 C-- End IF (DIFFERENT_MULTIPLE)
211 ENDIF
212
213 #endif /* INCLUDE_CONVECT_CALL */
214
215 RETURN
216 END

  ViewVC Help
Powered by ViewVC 1.1.22