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

Annotation of /MITgcm/model/src/convective_weights.F

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


Revision 1.4 - (hide 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, checkpoint57g_pre, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint56b_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint57d_post, checkpoint57i_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint52, checkpoint52f_post, checkpoint54f_post, checkpoint51t_post, checkpoint51n_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint55c_post, checkpoint52e_pre, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint57a_post, checkpoint57h_pre, checkpoint52b_pre, checkpoint54b_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint55g_post, checkpoint51q_post, checkpoint52b_post, checkpoint52c_post, checkpoint57c_post, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint51r_post, checkpoint57e_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, eckpoint57e_pre, checkpoint52a_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint57h_done, checkpoint52j_post, checkpoint57f_pre, branch-netcdf, checkpoint52l_post, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint51o_post, checkpoint53b_post, checkpoint52a_post, ecco_c52_e35, checkpoint51m_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post, checkpoint51p_post, checkpoint51u_post
Branch point for: branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.3: +2 -2 lines
* reverse gravitySign back to "logical" value: +1 when R increases downward

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/model/src/convective_weights.F,v 1.3 2002/08/15 17:25:31 adcroft Exp $
2 adcroft 1.2 C $Name: $
3 adcroft 1.1
4     #include "CPP_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: CONVECTIVE_WEIGHTS
8     C !INTERFACE:
9     SUBROUTINE CONVECTIVE_WEIGHTS(
10     I bi,bj,k,rhoKm1,rhoK,
11     O weightA,weightB,ConvectCount,
12     I myThid)
13     C !DESCRIPTION:
14     C Calculates the weights used to represent convective mixing
15     C between two layers.
16     C
17     C Mixing is represented by:
18     C T(k-1) = T(k-1) + B * ( T(k) - T(k-1) )
19     C T(k) = T(k) + A * ( T(k-1) - T(k) )
20     C
21     C In the stable case, A = B = 0
22     C In the unstable case, A and B are non-zero and are chosen so as to
23     C conserve total volume of T.
24    
25 adcroft 1.2 C !USES:
26 adcroft 1.1 IMPLICIT NONE
27     #include "SIZE.h"
28     #include "EEPARAMS.h"
29     #include "PARAMS.h"
30     #include "GRID.h"
31    
32 adcroft 1.2 C !INPUT/OUTPUT PARAMETERS:
33 adcroft 1.1 C bi,bj,k - indices
34     C rhoKm1 - rho in layer above
35     C rhoK - rho in layer below
36     C weightA - weight for level K
37     C weightB - weight for level K+1
38     C ConvectCount - counter to diagnose where convection occurs
39     C myThid - thread number
40     INTEGER bi,bj,k
41     _RL rhoKm1(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
42     _RL rhoK(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
43     _RL weightA(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
44     _RL weightB(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
45     _RL ConvectCount(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr)
46     INTEGER myThid
47    
48     #ifdef INCLUDE_CONVECT_CALL
49    
50 adcroft 1.2 C !LOCAL VARIABLES:
51 adcroft 1.1 C i,j :: Loop counter
52     C dS,d1,d2 :: Layer thicknesses
53     INTEGER i,j
54     _RL dS,d1,d2
55     CEOP
56    
57     DO j=1-Oly,sNy+Oly
58     DO i=1-Olx,sNx+Olx
59     IF ( _hFacC(i,j,k-1,bi,bj)
60     & *_hFacC(i,j,k,bi,bj) .GT. 0.
61 jmc 1.4 & .AND. (rhokm1(i,j)-rhok(i,j))*rKfac*gravitySign .LT. 0.
62 adcroft 1.3 & ) THEN
63 adcroft 1.1
64     C Where statically unstable, mix the tracers conserving volume
65     d1 = _hFacC(i,j,k-1,bi,bj)*drF(k-1)
66     d2 = _hFacC(i,j, k ,bi,bj)*drF( k )
67     dS = d1+d2
68     weightA(i,j) = d2/dS
69     weightB(i,j) = d1/dS
70     ConvectCount(i,j,k) = ConvectCount(i,j,k) + 1.
71     ELSE
72     C Where statically stable, do nothing
73     weightA(i,j) = 0.
74     weightB(i,j) = 0.
75     ENDIF
76     ENDDO
77     ENDDO
78    
79     #endif /* INCLUDE_CONVECT_CALL */
80    
81     RETURN
82     END

  ViewVC Help
Powered by ViewVC 1.1.22