/[MITgcm]/MITgcm/pkg/aim/phy_vdifsc.F
ViewVC logotype

Annotation of /MITgcm/pkg/aim/phy_vdifsc.F

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


Revision 1.5 - (hide annotations) (download)
Thu Sep 6 13:28:01 2001 UTC (22 years, 9 months ago) by adcroft
Branch: MAIN
CVS Tags: icebear2, checkpoint44h_pre, release1_p12, release1_p10, release1_p11, release1_p16, release1_p15, ecco_c44_e17, ecco_c44_e16, ecco_c44_e21, ecco_c44_e26, ecco_c44_e27, ecco_c44_e24, icebear5, icebear4, checkpoint44f_pre, icebear3, checkpoint46f_post, release1_p13_pre, checkpoint46d_pre, checkpoint46e_post, release1-branch_tutorials, release1_p14, checkpoint44g_post, checkpoint46h_pre, checkpoint44h_post, release1_p12_pre, checkpoint44e_post, checkpoint46e_pre, ecco-branch-mod4, checkpoint43a-release1mods, checkpoint45d_post, checkpoint45b_post, checkpoint46b_pre, chkpt44a_pre, release1-branch-end, release1_final_v1, ecco_c44_e19, checkpoint46, ecco_c44_e20, checkpoint44, release1_p13, ecco_c44_e18, checkpoint44f_post, release1_p17, release1_b1, checkpoint44b_post, chkpt44c_post, chkpt44d_post, checkpoint42, release1_p9, release1_p8, checkpoint43, checkpoint46g_pre, release1_p2, release1_p3, release1_p4, release1_p6, checkpoint46a_post, chkpt44a_post, checkpoint44b_pre, release1_p1, checkpoint46a_pre, ecco-branch-mod1, checkpoint45c_post, release1_p5, checkpoint44e_pre, chkpt44c_pre, checkpoint40pre9, release1_p7, ecco_ice2, ecco_ice1, checkpoint46b_post, checkpoint46d_post, ecco-branch-mod2, checkpoint46g_post, checkpoint45a_post, checkpoint46c_pre, ecco-branch-mod3, ecco-branch-mod5, ecco_c44_e22, release1_beta1, ecco_c44_e23, release1-branch_branchpoint, checkpoint46c_post, checkpoint40, checkpoint45, checkpoint46h_post, release1_chkpt44d_post, ecco_c44_e25, checkpoint41
Branch point for: c24_e25_ice, ecco-branch, release1_coupled, icebear, release1_final, release1-branch, release1, release1_50yr
Changes since 1.4: +3 -1 lines
Added missing declarations...

1 adcroft 1.5 C $Header: /u/gcmpack/models/MITgcmUV/pkg/aim/phy_vdifsc.F,v 1.4 2001/06/18 17:39:58 cnh Exp $
2 cnh 1.3 C $Name: $
3 adcroft 1.2
4     cch SUBROUTINE VDIFSC (UA,VA,SE,RH,QA,QSAT,
5     SUBROUTINE VDIFSC (UA,VA,Ta,RH,QA,QSAT,
6 cnh 1.3 & UTENVD,VTENVD,TTENVD,QTENVD,
7     & myThid)
8 adcroft 1.2 C-
9     C-- SUBROUTINE VDIFSC (UA,VA,SE,RH,QA,QSAT,
10     C-- & UTENVD,VTENVD,TTENVD,QTENVD)
11     C-
12     C-- Purpose: Compute tendencies of momentum, energy and moisture
13     C-- due to vertical diffusion and shallow convection
14     C-- Input: UA = u-wind (3-dim)
15     C-- VA = v-wind (3-dim)
16     C-- SE = dry static energy (3-dim)
17     C-- RH = relative humidity [0-1] (3-dim)
18     C-- QA = specific humidity [g/kg] (3-dim)
19     C-- QSAT = saturation sp. humidity [g/kg] (3-dim)
20     C-- Output: UTENVD = u-wind tendency (3-dim)
21     C-- VTENVD = v-wind tendency (3-dim)
22     C-- TTENVD = temperature tendency (3-dim)
23     C-- QTENVD = sp. humidity tendency [g/(kg s)] (3-dim)
24     C-
25    
26    
27     IMPLICIT rEAL*8 (A-H,O-Z)
28 cnh 1.3 INTEGER myThid
29 adcroft 1.2
30     C Resolution parameters
31    
32     #include "atparam.h"
33     #include "atparam1.h"
34 cnh 1.3 #include "EEPARAMS.h"
35 adcroft 1.2 #include "Lev_def.h"
36     C
37 adcroft 1.5 INTEGER NLON,NLAT,NLEV,NGP
38 adcroft 1.2 PARAMETER ( NLON=IX, NLAT=IL, NLEV=KX, NGP=NLON*NLAT )
39     C
40     C Physical constants + functions of sigma and latitude
41     C
42     #include "com_physcon.h"
43     C
44     C Vertical diffusion constants
45     C
46     #include "com_vdicon.h"
47     C
48     REAL UA(NGP,NLEV), VA(NGP,NLEV), SE(NGP,NLEV),
49     & RH(NGP,NLEV), QA(NGP,NLEV), QSAT(NGP,NLEV)
50     C
51     REAL UTENVD(NGP,NLEV), VTENVD(NGP,NLEV),
52     & TTENVD(NGP,NLEV), QTENVD(NGP,NLEV)
53     C
54     INTEGER NL1(NGP)
55     REAL RTST(NGP)
56     REAL RNL1(NGP)
57     C
58     REAL Th(NGP,NLEV), Ta(NGP,NLEV)
59     REAL dThdp
60     REAL stab(NGP)
61     REAL AUX(NGP)
62     REAL Prefw(NLEV), Prefs(NLEV)
63     DATA Prefs / 75., 250., 500., 775., 950./
64     DATA Prefw / 0., 150., 350., 650., 900./
65     REAL Pground
66     DATA pground /1000./
67     Cchdbg
68     REAL xindconv1
69     SAVE xindconv1
70     REAL xindconv
71     SAVE xindconv
72     INTEGER npas
73     SAVE npas
74     LOGICAL ifirst
75     DATA ifirst /.TRUE./
76     SAVE ifirst
77 adcroft 1.5 INTEGER J,K
78 adcroft 1.2 C
79     C-- 1. Initalization
80     C
81     DO K=1,NLEV
82     DO J=1,NGP
83     UTENVD(J,K) = 0.
84     VTENVD(J,K) = 0.
85     TTENVD(J,K) = 0.
86     QTENVD(J,K) = 0.
87     ENDDO
88     ENDDO
89 cnh 1.4
90 adcroft 1.2 c
91     C
92     C *****************************************
93     C *****************************************
94     Cchdbg
95 cnh 1.4 C if(ifirst) then
96     C xindconv=0.
97     C xindconv1=0.
98     C npas=0
99     C ifirst=.FALSE.
100     C endif
101     C npas = npas +1
102 adcroft 1.2 Cchdbg
103     C ******************************************
104     C *****************************************
105     C
106     C-- 2. Vertical diffusion and shallow convection
107     C
108     DO J=1,NGP
109 cnh 1.3 NL1(J)=NLEVxy(J,myThid)-1
110 adcroft 1.2 ENDDO
111     C
112     RTVD = -1./(3600.*TRVDI)
113     RTSQ = -1./(3600.*TRSHC)
114     C
115     DO J=1,NGP
116 cnh 1.3 IF ( NLEVxy(J,myThid) .GT. 0 ) THEN
117     RTST(J) = RTSQ*DSIG(NL1(J))/((DSIG(NLEVxy(J,myThid))+DSIG(NL1(J)))*CP)
118     RNL1(J) = -DSIG(NLEVxy(J,myThid))/DSIG(NL1(J))
119 adcroft 1.2 ENDIF
120     ENDDO
121 cnh 1.4
122 adcroft 1.2 C
123     C
124     C New writing of the Conditional stability
125     C ----------------------------------------
126     DO J=1,NGP
127 cnh 1.3 IF ( NLEVxy(J,myThid) .GT. 0 ) THEN
128     DO k=NL1(J),NLEVxy(J,myThid)
129 adcroft 1.2 Th(J,K)=Ta(J,K)*(Pground/Prefs(k))**(RD/CP)
130     ENDDO
131     ENDIF
132     ENDDO
133     C
134     DO J=1,NGP
135 cnh 1.4 stab(J)=0.
136 cnh 1.3 IF ( NLEVxy(J,myThid) .GT. 0 ) THEN
137     dThdp=(Th(J,NL1(J))-Th(J,NLEVxy(J,myThid)))
138     & *((Prefw(NLEVxy(J,myThid))/Pground)**(RD/CP))*CP
139     stab(J)=dThdp+ALHC*(QSAT(J,NL1(J))-QSAT(J,NLEVxy(J,myThid)))
140 adcroft 1.2 ENDIF
141     ENDDO
142     121 continue
143     C
144     DO J=1,NGP
145     C
146 cnh 1.3 cch DMSE = (SE(J,NLEVxy(J,myThid))-SE(J,NL1(J)))+
147     cch & ALHC*(QA(J,NLEVxy(J,myThid))-QSAT(J,NL1(J)))
148 adcroft 1.2 DMSE = - stab(J)
149 cnh 1.3 IF ( NLEVxy(J,myThid) .GT. 0 ) THEN
150     QEQL = MIN(QA(J,NLEVxy(J,myThid)),RH(J,NL1(J))*QSAT(J,NLEVxy(J,myThid)))
151     cchdbg QEQL = MIN(QA(J,NLEVxy(J,myThid)),QA(J,NL1(J)))
152 adcroft 1.2 ENDIF
153     C
154     IF (DMSE.GE.0.0) THEN
155     C
156     C ***************************************************
157     C ***************************************************
158     C chdbg
159 cnh 1.4 C if(J.ge.6336 .and. J.eq.6348) then
160     C xindconv=xindconv+1./13.
161     C endif
162     C if(J.ge.4160 .and. J.eq.4172) then
163     C xindconv1=xindconv1+1./13.
164     C endif
165     C if(npas.eq.960 .and. J.eq.1) then
166     C write(0,*) 'xindconv=',xindconv
167     C write(0,*) 'xindconv1=',xindconv1
168     C endif
169 adcroft 1.2 Cchdbg
170     C ****************************************************
171     C ****************************************************
172     C
173     C 2.1 Shallow convection
174     C
175 cnh 1.3 IF ( NLEVxy(J,myThid) .GT. 0 ) THEN
176     TTENVD(J,NLEVxy(J,myThid)) = RTST(J)*DMSE
177     TTENVD(J,NL1(J)) = RNL1(J)*TTENVD(J,NLEVxy(J,myThid))
178     QTENVD(J,NLEVxy(J,myThid)) = RTSQ*(QA(J,NLEVxy(J,myThid))-QEQL)
179     QTENVD(J,NL1(J)) = RNL1(J)*QTENVD(J,NLEVxy(J,myThid))
180 adcroft 1.2 ENDIF
181     C
182     ELSE
183     C
184     C 2.2 Vertical diffusion of moisture
185    
186 cnh 1.3 QTENVD(J,NLEVxy(J,myThid)) = RTVD*(QA(J,NLEVxy(J,myThid))-QEQL)
187     QTENVD(J,NL1(J)) = RNL1(J)*QTENVD(J,NLEVxy(J,myThid))
188 adcroft 1.2 C
189     ENDIF
190     C
191     ENDDO
192     C
193     RETURN
194     END

  ViewVC Help
Powered by ViewVC 1.1.22