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

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

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


Revision 1.21 - (show annotations) (download)
Wed Oct 15 22:55:01 2003 UTC (20 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint52n_post, checkpoint52d_pre, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint52k_post, checkpoint54, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint54f_post, checkpoint51t_post, checkpoint51n_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint52e_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint52b_pre, checkpoint54b_post, checkpoint51l_pre, checkpoint52m_post, checkpoint51q_post, checkpoint52b_post, checkpoint52h_pre, checkpoint51m_post, checkpoint52c_post, checkpoint53c_post, checkpoint54a_post, checkpoint51r_post, checkpoint53a_post, checkpoint52d_post, checkpoint53g_post, checkpoint52a_pre, checkpoint52i_post, checkpoint53f_post, checkpoint54a_pre, checkpoint53b_pre, checkpoint52j_post, branch-netcdf, checkpoint52l_post, checkpoint51o_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint52f_pre, checkpoint53d_pre, checkpoint54c_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.20: +2 -2 lines
* reverse gravitySign back to "logical" value: +1 when R increases downward

1 C $Header: /u/gcmpack/MITgcm/model/src/convect.F,v 1.20 2003/10/09 04:19:18 edhill Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: CONVECT
9 C !INTERFACE:
10 SUBROUTINE CONVECT( bi, bj, iMin, iMax, jMin, jMax, K,
11 & rhoKm1, rhoKp1, ConvectCount,
12 & myTime,myIter, myThid )
13 C !DESCRIPTION: \bv
14 C *==========================================================*
15 C | SUBROUTINE CONVECT
16 C | o Does vertical mixing of unstable water columns
17 C *==========================================================*
18 C | Uses simple homgenisation scheme between unstable
19 C | layers.
20 C *==========================================================*
21 C \ev
22 C !USES:
23 IMPLICIT NONE
24 C == Global data ==
25 #include "SIZE.h"
26 #include "EEPARAMS.h"
27 #include "PARAMS.h"
28 #include "DYNVARS.h"
29 #include "GRID.h"
30 #ifdef ALLOW_PASSIVE_TRACER
31 #include "TR1.h"
32 #endif
33 EXTERNAL DIFFERENT_MULTIPLE
34 LOGICAL DIFFERENT_MULTIPLE
35
36 C !INPUT/OUTPUT PARAMETERS:
37 C == Routine arguments ==
38 C bi,bj,iMin,iMax,jMin,jMax,K - Loop counters
39 C rhoKm1 - rho in layer above
40 C rhoKp1 - rho in layer below
41 C myTime - Current time in simulation
42 C myIter - Current iteration in simulation
43 C myThid - Thread number of this instance of S/R CONVECT
44 INTEGER bi,bj,iMin,iMax,jMin,jMax,K
45 _RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
46 _RL rhoKp1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
47 _RL ConvectCount(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
48 _RL myTime
49 INTEGER myIter
50 INTEGER myThid
51
52 C !LOCAL VARIABLES:
53 C == Local variables ==
54 C i,j :: Loop counter
55 C tMix :: Temp. for calculation of mixed theta.
56 C sMix :: Temp. for calculation of mixed salt.
57 C tr1Mix :: Temp. for calculation of mixed tracer.
58 C dSum :: Temp. for layer thicknesses
59 INTEGER i,j
60 _RL tMix(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
61 _RL sMix(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
62 #ifdef ALLOW_PASSIVE_TRACER
63 ceh3 needs an IF ( usePASSIVE_TRACER ) THEN
64 _RL tr1Mix(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
65 #endif
66 _RL dSum(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
67 CEOP
68
69 C-- Check to see if should convect now
70 IF ( DIFFERENT_MULTIPLE(cAdjFreq,myTime,myTime-deltaTClock) ) THEN
71
72 C-- Calculate heat content of two level column
73 DO j=jMin,jmax
74 DO i=iMin,imax
75 tMix(i,j) = theta(i,j,k-1,bi,bj)
76 & *_hFacC(i,j,k-1,bi,bj)*drF(k-1)
77 & +theta(i,j,k,bi,bj)
78 & *_hFacC(i,j,k,bi,bj)*drF(k)
79 sMix(i,j) = salt (i,j,k-1,bi,bj)
80 & *_hFacC(i,j,k-1,bi,bj)*drF(k-1)
81 & +salt (i,j,k,bi,bj)
82 & *_hFacC(i,j,k,bi,bj)*drF(k)
83 #ifdef ALLOW_PASSIVE_TRACER
84 ceh3 needs an IF ( usePASSIVE_TRACER ) THEN
85 tr1Mix(i,j) = Tr1 (i,j,k-1,bi,bj)
86 & *_hFacC(i,j,k-1,bi,bj)*drF(k-1)
87 & +Tr1 (i,j,k,bi,bj)
88 & *_hFacC(i,j,k,bi,bj)*drF(k)
89 #endif
90 dSum(i,j) = _hFacC(i,j,k-1,bi,bj)*drF(k-1)
91 & +_hFacC(i,j,k,bi,bj)*drF(k)
92 ENDDO
93 ENDDO
94
95 C-- Where statically unstable, mix the heat and salt
96 DO j=jMin,jmax
97 DO i=iMin,imax
98 IF ( _hFacC(i,j,k,bi,bj) .GT. 0. .AND.
99 & (rhokm1(i,j)-rhokp1(i,j))*rkFac*gravitySign .LT. 0.
100 & ) THEN
101 theta(i,j,k-1,bi,bj) = tMix(i,j)/dSum(i,j)
102 theta(i,j,k ,bi,bj) = tMix(i,j)/dSum(i,j)
103 salt(i,j,k-1,bi,bj) = sMix(i,j)/dSum(i,j)
104 salt(i,j,k ,bi,bj) = sMix(i,j)/dSum(i,j)
105 #ifdef ALLOW_PASSIVE_TRACER
106 ceh3 needs an IF ( usePASSIVE_TRACER ) THEN
107 Tr1(i,j,k-1,bi,bj) = Tr1Mix(i,j)/dSum(i,j)
108 Tr1(i,j,k ,bi,bj) = Tr1Mix(i,j)/dSum(i,j)
109 #endif
110 ConvectCount(i,j,k) = ConvectCount(i,j,k) + 1.
111 ENDIF
112 ENDDO
113 ENDDO
114
115 ENDIF
116
117 RETURN
118 END

  ViewVC Help
Powered by ViewVC 1.1.22