2 |
C $Name$ |
C $Name$ |
3 |
#include "FIZHI_OPTIONS.h" |
#include "FIZHI_OPTIONS.h" |
4 |
subroutine gwdrag (myid,pz,pl,ple,dpres,pkz,uz,vz,tz,qz,phis_var, |
subroutine gwdrag (myid,pz,pl,ple,dpres,pkz,uz,vz,tz,qz,phis_var, |
5 |
. dudt,dvdt,dtdt,im,jm,lm,bi,bj,istrip,npcs,imglobal) |
. dudt,dvdt,dtdt,im,jm,Lm,bi,bj,istrip,npcs,imglobal) |
6 |
C*********************************************************************** |
C*********************************************************************** |
7 |
C |
C |
8 |
C PURPOSE: |
C PURPOSE: |
13 |
C ====== |
C ====== |
14 |
C myid ....... Process ID |
C myid ....... Process ID |
15 |
C pz ....... Surface Pressure [im,jm] |
C pz ....... Surface Pressure [im,jm] |
16 |
C pl ....... 3D pressure field [im,jm,lm] |
C pl ....... 3D pressure field [im,jm,Lm] |
17 |
C ple ....... 3d pressure at model level edges [im,jm,lm+1] |
C ple ....... 3d pressure at model level edges [im,jm,Lm+1] |
18 |
C dpres ....... pressure difference across level [im,jm,lm] |
C dpres ....... pressure difference across level [im,jm,Lm] |
19 |
C pkz ....... pressure**kappa [im,jm,lm] |
C pkz ....... pressure**kappa [im,jm,Lm] |
20 |
C uz ....... zonal velocity [im,jm,lm] |
C uz ....... zonal velocity [im,jm,Lm] |
21 |
C vz ....... meridional velocity [im,jm,lm] |
C vz ....... meridional velocity [im,jm,Lm] |
22 |
C tz ....... temperature [im,jm,lm] |
C tz ....... temperature [im,jm,Lm] |
23 |
C qz ....... specific humidity [im,jm,lm] |
C qz ....... specific humidity [im,jm,Lm] |
24 |
C phis_var .... topography variance |
C phis_var .... topography variance |
25 |
C im ....... number of grid points in x direction |
C im ....... number of grid points in x direction |
26 |
C jm ....... number of grid points in y direction |
C jm ....... number of grid points in y direction |
27 |
C lm ....... number of grid points in vertical |
C Lm ....... number of grid points in vertical |
28 |
C istrip ...... 'strip' length for cache size control |
C istrip ...... 'strip' length for cache size control |
29 |
C npcs ....... number of strips |
C npcs ....... number of strips |
30 |
C imglobal .... (avg) number of longitude points around the globe |
C imglobal .... (avg) number of longitude points around the globe |
38 |
C*********************************************************************** |
C*********************************************************************** |
39 |
implicit none |
implicit none |
40 |
|
|
|
#ifdef ALLOW_DIAGNOSTICS |
|
|
#include "SIZE.h" |
|
|
#include "DIAGNOSTICS_SIZE.h" |
|
|
#include "DIAGNOSTICS.h" |
|
|
#endif |
|
|
|
|
41 |
c Input Variables |
c Input Variables |
42 |
c --------------- |
c --------------- |
43 |
integer myid,im,jm,lm,bi,bj,istrip,npcs,imglobal |
integer myid,im,jm,Lm,bi,bj,istrip,npcs,imglobal |
44 |
real pz(im,jm) |
_RL pz(im,jm) |
45 |
real pl(im,jm,lm) |
_RL pl(im,jm,Lm) |
46 |
real ple(im,jm,lm+1) |
_RL ple(im,jm,Lm+1) |
47 |
real dpres(im,jm,lm) |
_RL dpres(im,jm,Lm) |
48 |
real pkz(im,jm,lm) |
_RL pkz(im,jm,Lm) |
49 |
real uz(im,jm,lm) |
_RL uz(im,jm,Lm) |
50 |
real vz(im,jm,lm) |
_RL vz(im,jm,Lm) |
51 |
real tz(im,jm,lm) |
_RL tz(im,jm,Lm) |
52 |
real qz(im,jm,lm) |
_RL qz(im,jm,Lm) |
53 |
real phis_var(im,jm) |
_RL phis_var(im,jm) |
54 |
|
|
55 |
real dudt(im,jm,lm) |
_RL dudt(im,jm,Lm) |
56 |
real dvdt(im,jm,lm) |
_RL dvdt(im,jm,Lm) |
57 |
real dtdt(im,jm,lm) |
_RL dtdt(im,jm,Lm) |
58 |
|
|
59 |
c Local Variables |
c Local Variables |
60 |
c --------------- |
c --------------- |
61 |
real tv(im,jm,lm) |
_RL tv(im,jm,Lm) |
62 |
real dragu(im,jm,lm), dragv(im,jm,lm) |
_RL dragu(im,jm,Lm), dragv(im,jm,Lm) |
63 |
real dragt(im,jm,lm) |
_RL dragt(im,jm,Lm) |
64 |
real dragx(im,jm), dragy(im,jm) |
_RL dragx(im,jm), dragy(im,jm) |
65 |
real sumu(im,jm) |
_RL sumu(im,jm) |
66 |
integer nthin(im,jm),nbase(im,jm) |
integer nthin(im,jm),nbase(im,jm) |
67 |
integer nthini, nbasei |
integer nthini, nbasei |
68 |
|
|
69 |
real phis_std(im,jm) |
_RL phis_std(im,jm) |
70 |
|
|
71 |
real std(istrip), ps(istrip) |
_RL std(istrip), ps(istrip) |
72 |
real us(istrip,lm), vs(istrip,lm), ts(istrip,lm) |
_RL us(istrip,Lm), vs(istrip,Lm), ts(istrip,Lm) |
73 |
real dragus(istrip,lm), dragvs(istrip,lm) |
_RL dragus(istrip,Lm), dragvs(istrip,Lm) |
74 |
real dragxs(istrip), dragys(istrip) |
_RL dragxs(istrip), dragys(istrip) |
75 |
real plstr(istrip,lm),plestr(istrip,lm),dpresstr(istrip,lm) |
_RL plstr(istrip,Lm),plestr(istrip,Lm),dpresstr(istrip,Lm) |
76 |
integer nthinstr(istrip),nbasestr(istrip) |
integer nthinstr(istrip),nbasestr(istrip) |
77 |
|
|
78 |
integer n,i,j,L |
integer n,i,j,L |
79 |
real getcon, pi |
_RL getcon, pi |
80 |
real grav, rgas, cp, cpinv, lstar |
_RL grav, rgas, cp, cpinv, lstar |
81 |
|
#ifdef ALLOW_DIAGNOSTICS |
82 |
|
logical diagnostics_is_on |
83 |
|
external diagnostics_is_on |
84 |
|
_RL tmpdiag(im,jm) |
85 |
|
#endif |
86 |
|
|
87 |
c Initialization |
c Initialization |
88 |
c -------------- |
c -------------- |
98 |
do j=1,jm |
do j=1,jm |
99 |
do i=1,im |
do i=1,im |
100 |
|
|
101 |
do nthini = 1,lm+1 |
do nthini = 1,Lm+1 |
102 |
if( 1000.0-ple(i,j,lm+2-nthini).gt.25. ) then |
if( pz(i,j)-ple(i,j,Lm+2-nthini).gt.25. ) then |
103 |
nthin(i,j) = nthini |
nthin(i,j) = nthini |
104 |
goto 10 |
goto 10 |
105 |
endif |
endif |
106 |
enddo |
enddo |
107 |
10 continue |
10 continue |
108 |
do nbasei = 1,lm+1 |
do nbasei = 1,Lm+1 |
109 |
if( ple(i,j,lm+2-nbasei).lt.666.7 ) then |
if( ple(i,j,Lm+2-nbasei).lt.(0.667*pz(i,j)) ) then |
110 |
nbase(i,j) = nbasei |
nbase(i,j) = nbasei |
111 |
goto 20 |
goto 20 |
112 |
endif |
endif |
113 |
enddo |
enddo |
114 |
20 continue |
20 continue |
115 |
if( 666.7-ple(i,j,lm+2-nbase(i,j)) .gt. |
if( (0.667*pz(i,j))-ple(i,j,Lm+2-nbase(i,j)) .gt. |
116 |
. ple(i,j,lm+3-nbase(i,j))-666.7 ) then |
. ple(i,j,Lm+3-nbase(i,j))-(0.667*pz(i,j)) ) then |
117 |
nbase(i,j) = nbase(i,j)-1 |
nbase(i,j) = nbase(i,j)-1 |
118 |
endif |
endif |
119 |
|
|
120 |
enddo |
enddo |
121 |
enddo |
enddo |
122 |
|
|
123 |
c Compute Topography Sub-Grid Standard Deviation |
c Compute Topography Sub-Grid Standard Deviation |
124 |
|
c and constrain the Maximum Value |
125 |
c ---------------------------------------------- |
c ---------------------------------------------- |
126 |
do j=1,jm |
do j=1,jm |
127 |
do i=1,im |
do i=1,im |
128 |
phis_std(i,j) = min( 400.0, sqrt( max(0.0,phis_var(i,j)) )/grav ) |
phis_std(i,j) = min( 400.0 _d 0, sqrt( max(0.0 _d 0, |
129 |
|
$ phis_var(i,j)) )/grav ) |
130 |
enddo |
enddo |
131 |
enddo |
enddo |
132 |
|
|
133 |
c Compute Virtual Temperatures |
c Compute Virtual Temperatures |
134 |
c ---------------------------- |
c ---------------------------- |
135 |
do L = 1,lm |
do L = 1,Lm |
136 |
do j = 1,jm |
do j = 1,jm |
137 |
do i = 1,im |
do i = 1,im |
138 |
tv(i,j,L) = tz(i,j,L)*pkz(i,j,L)*(1.+.609*qz(i,j,L)) |
tv(i,j,L) = tz(i,j,L)*pkz(i,j,L)*(1.+.609*qz(i,j,L)) |
140 |
enddo |
enddo |
141 |
enddo |
enddo |
142 |
|
|
143 |
|
do L = 1,Lm |
144 |
|
do j = 1,jm |
145 |
|
do i = 1,im |
146 |
|
dragu(i,j,L) = 0. |
147 |
|
dragv(i,j,L) = 0. |
148 |
|
dragt(i,j,L) = 0. |
149 |
|
enddo |
150 |
|
enddo |
151 |
|
enddo |
152 |
|
|
153 |
c Call Gravity Wave Drag Paramterization on A-Grid |
c Call Gravity Wave Drag Paramterization on A-Grid |
154 |
c ------------------------------------------------ |
c ------------------------------------------------ |
155 |
|
|
156 |
do n=1,npcs |
do n=1,npcs |
157 |
|
|
158 |
call strip ( phis_std,std,im*jm,istrip,1,n ) |
call stripit ( phis_std,std,im*jm,im*jm,istrip,1,n ) |
159 |
|
|
160 |
call strip ( pz,ps,im*jm,istrip,1 ,n ) |
call stripit ( pz,ps,im*jm,im*jm,istrip,1 ,n ) |
161 |
call strip ( uz,us,im*jm,istrip,lm,n ) |
call stripit ( uz,us,im*jm,im*jm,istrip,Lm,n ) |
162 |
call strip ( vz,vs,im*jm,istrip,lm,n ) |
call stripit ( vz,vs,im*jm,im*jm,istrip,Lm,n ) |
163 |
call strip ( tv,ts,im*jm,istrip,lm,n ) |
call stripit ( tv,ts,im*jm,im*jm,istrip,Lm,n ) |
164 |
call strip ( pl,plstr,im*jm,istrip,lm,n ) |
call stripit ( pl,plstr,im*jm,im*jm,istrip,Lm,n ) |
165 |
call strip ( ple,plestr,im*jm,istrip,lm,n ) |
call stripit ( ple,plestr,im*jm,im*jm,istrip,Lm,n ) |
166 |
call strip ( dpres,dpresstr,im*jm,istrip,lm,n ) |
call stripit ( dpres,dpresstr,im*jm,im*jm,istrip,Lm,n ) |
167 |
call stripint ( nthin,nthinstr,im*jm,istrip,lm,n ) |
call stripitint ( nthin,nthinstr,im*jm,im*jm,istrip,1,n ) |
168 |
call stripint ( nbase,nbasestr,im*jm,istrip,lm,n ) |
call stripitint ( nbase,nbasestr,im*jm,im*jm,istrip,1,n ) |
169 |
|
|
170 |
call GWDD ( ps,us,vs,ts, |
call GWDD ( ps,us,vs,ts, |
171 |
. dragus,dragvs,dragxs,dragys,std, |
. dragus,dragvs,dragxs,dragys,std, |
172 |
. plstr,plestr,dpresstr,grav,rgas,cp, |
. plstr,plestr,dpresstr,grav,rgas,cp, |
173 |
. istrip,lm,nthinstr,nbasestr,lstar ) |
. istrip,Lm,nthinstr,nbasestr,lstar ) |
174 |
|
|
175 |
call paste ( dragus,dragu,istrip,im*jm,lm,n ) |
call pastit( dragus,dragu,istrip,im*jm,im*jm,Lm,n ) |
176 |
call paste ( dragvs,dragv,istrip,im*jm,lm,n ) |
call pastit( dragvs,dragv,istrip,im*jm,im*jm,Lm,n ) |
177 |
call paste ( dragxs,dragx,istrip,im*jm,1 ,n ) |
call pastit( dragxs,dragx,istrip,im*jm,im*jm,1 ,n ) |
178 |
call paste ( dragys,dragy,istrip,im*jm,1 ,n ) |
call pastit( dragys,dragy,istrip,im*jm,im*jm,1 ,n ) |
179 |
|
|
180 |
enddo |
enddo |
181 |
|
|
182 |
c Add Gravity-Wave Drag to Wind and Theta Tendencies |
c Add Gravity-Wave Drag to Wind and Theta Tendencies |
183 |
c -------------------------------------------------- |
c -------------------------------------------------- |
184 |
do L = 1,lm |
do L = 1,Lm |
185 |
do j = 1,jm |
do j = 1,jm |
186 |
do i = 1,im |
do i = 1,im |
187 |
dragu(i,j,L) = sign( min(0.006,abs(dragu(i,j,L))),dragu(i,j,L) ) |
dragu(i,j,L) = sign( min(0.006 _d 0,abs(dragu(i,j,L))), dragu(i |
188 |
dragv(i,j,L) = sign( min(0.006,abs(dragv(i,j,L))),dragv(i,j,L) ) |
$ ,j,L) ) |
189 |
|
dragv(i,j,L) = sign( min(0.006 _d 0,abs(dragv(i,j,L))), dragv(i |
190 |
|
$ ,j,L) ) |
191 |
dragt(i,j,L) = -( uz(i,j,L)*dragu(i,j,L)+vz(i,j,L)*dragv(i,j,L) ) |
dragt(i,j,L) = -( uz(i,j,L)*dragu(i,j,L)+vz(i,j,L)*dragv(i,j,L) ) |
192 |
. *cpinv |
. *cpinv |
193 |
dudt(i,j,L) = dudt(i,j,L) + dragu(i,j,L) |
dudt(i,j,L) = dudt(i,j,L) + dragu(i,j,L) |
199 |
|
|
200 |
c Compute Diagnostics |
c Compute Diagnostics |
201 |
c ------------------- |
c ------------------- |
202 |
if( igwdu.ne.0 .or. igwdv.ne.0 .or. igwdt.ne.0 ) then |
#ifdef ALLOW_DIAGNOSTICS |
203 |
do L = 1,lm |
do L = 1,Lm |
204 |
if( igwdu.ne.0 ) then |
|
205 |
do j = 1,jm |
if(diagnostics_is_on('GWDU ',myid) ) then |
206 |
do i = 1,im |
do j=1,jm |
207 |
qdiag(i,j,igwdu+L-1,bi,bj) = qdiag(i,j,igwdu+L-1,bi,bj) + |
do i=1,im |
208 |
. dragu(i,j,L)*86400 |
tmpdiag(i,j) = dragu(i,j,L)*86400 |
209 |
enddo |
enddo |
210 |
enddo |
enddo |
211 |
endif |
call diagnostics_fill(tmpdiag,'GWDU ',L,1,3,bi,bj,myid) |
212 |
if( igwdv.ne.0 ) then |
endif |
213 |
do j = 1,jm |
|
214 |
do i = 1,im |
if(diagnostics_is_on('GWDV ',myid) ) then |
215 |
qdiag(i,j,igwdv+L-1,bi,bj) = qdiag(i,j,igwdv+L-1,bi,bj) + |
do j=1,jm |
216 |
. dragv(i,j,L)*86400 |
do i=1,im |
217 |
enddo |
tmpdiag(i,j) = dragv(i,j,L)*86400 |
218 |
enddo |
enddo |
219 |
endif |
enddo |
220 |
if( igwdt.ne.0 ) then |
call diagnostics_fill(tmpdiag,'GWDV ',L,1,3,bi,bj,myid) |
221 |
do j = 1,jm |
endif |
222 |
do i = 1,im |
|
223 |
qdiag(i,j,igwdt+L-1,bi,bj) = qdiag(i,j,igwdt+L-1,bi,bj) + |
if(diagnostics_is_on('GWDT ',myid) ) then |
224 |
. dragt(i,j,L)*86400 |
do j=1,jm |
225 |
enddo |
do i=1,im |
226 |
enddo |
tmpdiag(i,j) = dragt(i,j,L)*86400 |
227 |
endif |
enddo |
228 |
enddo |
enddo |
229 |
|
call diagnostics_fill(tmpdiag,'GWDT ',L,1,3,bi,bj,myid) |
230 |
endif |
endif |
231 |
|
|
232 |
|
enddo |
233 |
|
|
234 |
c Gravity Wave Drag at Surface (U-Wind) |
c Gravity Wave Drag at Surface (U-Wind) |
235 |
c ------------------------------------- |
c ------------------------------------- |
236 |
if( igwdus.ne.0 ) then |
if(diagnostics_is_on('GWDUS ',myid) ) then |
237 |
do j = 1,jm |
call diagnostics_fill(dragx,'GWDUS ',0,1,3,bi,bj,myid) |
|
do i = 1,im |
|
|
qdiag(i,j,igwdus,bi,bj) = qdiag(i,j,igwdus,bi,bj) + dragx(i,j) |
|
|
enddo |
|
|
enddo |
|
238 |
endif |
endif |
239 |
|
|
240 |
c Gravity Wave Drag at Surface (V-Wind) |
c Gravity Wave Drag at Surface (V-Wind) |
241 |
c ------------------------------------- |
c ------------------------------------- |
242 |
if( igwdvs.ne.0 ) then |
if(diagnostics_is_on('GWDVS ',myid) ) then |
243 |
do j = 1,jm |
call diagnostics_fill(dragy,'GWDVS ',0,1,3,bi,bj,myid) |
|
do i = 1,im |
|
|
qdiag(i,j,igwdvs,bi,bj) = qdiag(i,j,igwdvs,bi,bj) + dragy(i,j) |
|
|
enddo |
|
|
enddo |
|
244 |
endif |
endif |
245 |
|
|
246 |
c Gravity Wave Drag at Model Top (U-Wind) |
c Gravity Wave Drag at Model Top (U-Wind) |
247 |
c --------------------------------------- |
c --------------------------------------- |
248 |
if( igwdut.ne.0 ) then |
if(diagnostics_is_on('GWDUT ',myid) ) then |
249 |
do j = 1,jm |
do j = 1,jm |
250 |
do i = 1,im |
do i = 1,im |
251 |
sumu(i,j) = 0.0 |
sumu(i,j) = 0.0 |
252 |
enddo |
enddo |
253 |
enddo |
enddo |
254 |
do L = 1,lm |
do L = 1,Lm |
255 |
do j = 1,jm |
do j = 1,jm |
256 |
do i = 1,im |
do i = 1,im |
257 |
sumu(i,j) = sumu(i,j) + dragu(i,j,L)*dpres(i,j,L)/pz(i,j) |
sumu(i,j) = sumu(i,j) + dragu(i,j,L)*dpres(i,j,L)/pz(i,j) |
258 |
enddo |
enddo |
259 |
enddo |
enddo |
260 |
enddo |
enddo |
261 |
do j = 1,jm |
do j=1,jm |
262 |
do i = 1,im |
do i=1,im |
263 |
qdiag(i,j,igwdut,bi,bj) = qdiag(i,j,igwdut,bi,bj) + dragx(i,j) |
tmpdiag(i,j) = dragx(i,j) + sumu(i,j)*pz(i,j)/grav*100 |
264 |
. + sumu(i,j)*pz(i,j)/grav*100 |
enddo |
265 |
enddo |
enddo |
266 |
enddo |
call diagnostics_fill(tmpdiag,'GWDUT ',0,1,3,bi,bj,myid) |
267 |
endif |
endif |
268 |
|
|
269 |
c Gravity Wave Drag at Model Top (V-Wind) |
c Gravity Wave Drag at Model Top (V-Wind) |
270 |
c --------------------------------------- |
c --------------------------------------- |
271 |
if( igwdvt.ne.0 ) then |
if(diagnostics_is_on('GWDVT ',myid) ) then |
272 |
do j = 1,jm |
do j = 1,jm |
273 |
do i = 1,im |
do i = 1,im |
274 |
sumu(i,j) = 0.0 |
sumu(i,j) = 0.0 |
275 |
enddo |
enddo |
276 |
enddo |
enddo |
277 |
do L = 1,lm |
do L = 1,Lm |
278 |
do j = 1,jm |
do j = 1,jm |
279 |
do i = 1,im |
do i = 1,im |
280 |
sumu(i,j) = sumu(i,j) + dragv(i,j,L)*dpres(i,j,L)/pz(i,j) |
sumu(i,j) = sumu(i,j) + dragv(i,j,L)*dpres(i,j,L)/pz(i,j) |
281 |
enddo |
enddo |
282 |
enddo |
enddo |
283 |
enddo |
enddo |
284 |
do j = 1,jm |
do j=1,jm |
285 |
do i = 1,im |
do i=1,im |
286 |
qdiag(i,j,igwdvt,bi,bj) = qdiag(i,j,igwdvt,bi,bj) + dragy(i,j) |
tmpdiag(i,j) = dragy(i,j) + sumu(i,j)*pz(i,j)/grav*100 |
287 |
. + sumu(i,j)*pz(i,j)/grav*100 |
enddo |
288 |
enddo |
enddo |
289 |
enddo |
call diagnostics_fill(tmpdiag,'GWDVT ',0,1,3,bi,bj,myid) |
290 |
endif |
endif |
291 |
|
#endif |
|
ngwdu = ngwdu + 1 |
|
|
ngwdv = ngwdv + 1 |
|
|
ngwdt = ngwdt + 1 |
|
|
ngwdus = ngwdus + 1 |
|
|
ngwdvs = ngwdvs + 1 |
|
|
ngwdut = ngwdut + 1 |
|
|
ngwdvt = ngwdvt + 1 |
|
292 |
|
|
293 |
return |
return |
294 |
end |
end |
295 |
SUBROUTINE GWDD ( ps,u,v,t,dudt,dvdt,xdrag,ydrag, |
SUBROUTINE GWDD ( ps,u,v,t,dudt,dvdt,xdrag,ydrag, |
296 |
. std,pl,ple,dpres, |
. std,pl,ple,dpres, |
297 |
. grav,rgas,cp,irun,lm,nthin,nbase,lstar ) |
. grav,rgas,cp,irun,Lm,nthin,nbase,lstar ) |
298 |
C*********************************************************************** |
C*********************************************************************** |
299 |
C |
C |
300 |
C Description: |
C Description: |
316 |
C rgas ....... Gas constant |
C rgas ....... Gas constant |
317 |
C cp ......... Specific Heat at constant pressure |
C cp ......... Specific Heat at constant pressure |
318 |
C irun ....... Number of grid-points in horizontal dimension |
C irun ....... Number of grid-points in horizontal dimension |
319 |
C lm ......... Number of grid-points in vertical dimension |
C Lm ......... Number of grid-points in vertical dimension |
320 |
C lstar ...... Monochromatic Wavelength/(2*pi) |
C lstar ...... Monochromatic Wavelength/(2*pi) |
321 |
C |
C |
322 |
C Output: |
C Output: |
326 |
C xdrag ...... Zonal Surface and Base Layer Stress (Pa) |
C xdrag ...... Zonal Surface and Base Layer Stress (Pa) |
327 |
C ydrag ...... Meridional Surface and Base Layer Stress (Pa) |
C ydrag ...... Meridional Surface and Base Layer Stress (Pa) |
328 |
C |
C |
329 |
|
C NOTE: Quantities computed locally in GWDD use a |
330 |
|
C bottom-up counting of levels |
331 |
|
C The fizhi code uses a top-down so all |
332 |
|
C Quantities that came in through the arg list |
333 |
|
C must use reverse vertical indexing!!! |
334 |
C*********************************************************************** |
C*********************************************************************** |
335 |
|
|
336 |
implicit none |
implicit none |
337 |
|
|
338 |
c Input Variables |
c Input Variables |
339 |
c --------------- |
c --------------- |
340 |
integer irun,lm |
integer irun,Lm |
341 |
real ps(irun) |
_RL ps(irun) |
342 |
real u(irun,lm), v(irun,lm), t(irun,lm) |
_RL u(irun,Lm), v(irun,Lm), t(irun,Lm) |
343 |
real dudt(irun,lm), dvdt(irun,lm) |
_RL dudt(irun,Lm), dvdt(irun,Lm) |
344 |
real xdrag(irun), ydrag(irun) |
_RL xdrag(irun), ydrag(irun) |
345 |
real std(irun) |
_RL std(irun) |
346 |
real ple(irun,lm+1), pl(irun,lm), dpres(irun,lm) |
_RL ple(irun,Lm+1), pl(irun,Lm), dpres(irun,Lm) |
347 |
real grav, rgas, cp |
_RL grav, rgas, cp |
348 |
integer nthin(irun),nbase(irun) |
integer nthin(irun),nbase(irun) |
349 |
real lstar |
_RL lstar |
350 |
|
|
351 |
c Dynamic Allocation Variables |
c Dynamic Allocation Variables |
352 |
c ---------------------------- |
c ---------------------------- |
353 |
real ubar(irun), vbar(irun), robar(irun) |
_RL ubar(irun), vbar(irun), robar(irun) |
354 |
real speed(irun), ang(irun) |
_RL speed(irun), ang(irun) |
355 |
real bv(irun,lm) |
_RL bv(irun,Lm) |
356 |
real nbar(irun) |
_RL nbar(irun) |
357 |
|
|
358 |
real tstd(irun) |
_RL XTENS(irun,Lm+1), YTENS(irun,Lm+1) |
359 |
real XTENS(irun,lm+1), YTENS(irun,lm+1) |
_RL TENSIO(irun,Lm+1) |
360 |
real TENSIO(irun,lm+1) |
_RL DRAGSF(irun) |
361 |
real DRAGSF(irun) |
_RL RO(irun,Lm), DZ(irun,Lm) |
|
real RO(irun,lm), DZ(irun,lm) |
|
362 |
|
|
363 |
integer icrilv(irun) |
integer icrilv(irun) |
364 |
|
|
365 |
c Local Variables |
c Local Variables |
366 |
c --------------- |
c --------------- |
367 |
integer i,l |
integer i,L |
368 |
real a,g,stdmax,agrav,akwnmb |
_RL a,g,agrav,akwnmb |
369 |
real gocp,roave,roiave,frsf,gstar,vai1,vai2 |
_RL gocp,roave,roiave,frsf,gstar,vai1,vai2 |
370 |
real vaisd,velco,deluu,delvv,delve2,delz,vsqua |
_RL vaisd,velco,deluu,delvv,delve2,delz,vsqua |
371 |
real richsn,crifro,crif2,fro2,coef |
_RL richsn,crifro,crif2,fro2,coef |
372 |
|
|
373 |
c Initialization |
c Initialization |
374 |
c -------------- |
c -------------- |
375 |
a = 1.0 |
a = 1.0 |
376 |
g = 1.0 |
g = 1.0 |
377 |
agrav = 1.0/GRAV |
agrav = 1.0/grav |
378 |
akwnmb = 1.0/lstar |
akwnmb = 1.0/lstar |
379 |
gocp = GRAV/CP |
gocp = grav/cp |
380 |
|
|
381 |
c Constrain the Maximum Value of the Standard Deviation |
c Compute Atmospheric Density (with virtual temp) |
382 |
c ----------------------------------------------------- |
c ----------------------------------------------- |
383 |
stdmax = 400. |
do l = 1,Lm |
384 |
do i = 1,irun |
do i = 1,irun |
385 |
tstd(i) = std(i) |
ro(i,L) = pl(i,Lm+1-L)/(rgas*t(i,Lm+1-L)) |
|
if( std(i).gt.stdmax ) tstd(i) = stdmax |
|
|
enddo |
|
|
|
|
|
c Compute Atmospheric Density |
|
|
c --------------------------- |
|
|
do l = 1,lm |
|
|
do i = 1,irun |
|
|
ro(i,l) = pl(i,l)/(rgas*t(i,lm+1-l)) |
|
386 |
enddo |
enddo |
387 |
enddo |
enddo |
388 |
|
|
389 |
c Compute Layer Thicknesses |
c Compute Layer Thicknesses |
390 |
c ------------------------- |
c ------------------------- |
391 |
do l = 2,lm |
do l = 2,Lm |
392 |
do i = 1,irun |
do i = 1,irun |
393 |
roiave = ( 1./ro(i,l-1) + 1./ro(i,l) )*0.5 |
roiave = ( 1./ro(i,L-1) + 1./ro(i,L) )*0.5 |
394 |
dz(i,l) = agrav*roiave*( pl(i,l-1)-pl(i,l) ) |
dz(i,L) = agrav*roiave*( pl(i,Lm+2-L)-pl(i,Lm+1-L) ) |
395 |
enddo |
enddo |
396 |
enddo |
enddo |
397 |
|
|
398 |
|
|
399 |
c****************************************************** |
c*********************************************************************** |
400 |
c Surface and Base Layer Stress * |
c Surface and Base Layer Stress * |
401 |
c****************************************************** |
c*********************************************************************** |
402 |
|
|
403 |
c Definition of Surface Wind Vector |
c Definition of Surface Wind Vector |
404 |
c --------------------------------- |
c --------------------------------- |
405 |
do i = 1,irun |
do i = 1,irun |
406 |
robar(i) = 0.0 |
robar(i) = 0.0 |
407 |
ubar(i) = 0.0 |
ubar(i) = 0.0 |
408 |
vbar(i) = 0.0 |
vbar(i) = 0.0 |
409 |
enddo |
enddo |
410 |
|
|
411 |
do i = 1,irun |
do i = 1,irun |
412 |
do L = 1,nbase(i)-1 |
do L = 1,nbase(i)-1 |
413 |
robar(i) = robar(i) + ro(i,L) *(ple(i,L)-ple(i,L+1)) |
robar(i) = robar(i) + ro(i,L) * (ple(i,Lm+2-L)-ple(i,Lm+1-L)) |
414 |
ubar(i) = ubar(i) + u(i,lm+1-L)*(ple(i,L)-ple(i,L+1)) |
ubar(i) = ubar(i) + u(i,Lm+1-L) * (ple(i,Lm+2-L)-ple(i,Lm+1-L)) |
415 |
vbar(i) = vbar(i) + v(i,lm+1-L)*(ple(i,L)-ple(i,L+1)) |
vbar(i) = vbar(i) + v(i,Lm+1-L) * (ple(i,Lm+2-L)-ple(i,Lm+1-L)) |
416 |
enddo |
enddo |
417 |
enddo |
enddo |
418 |
|
|
419 |
do i = 1,irun |
do i = 1,irun |
420 |
robar(i) = robar(i)/(ple(i,1)-ple(i,nbase(i))) * 100.0 |
robar(i) = robar(i)/(ps(i)-ple(i,Lm+1-(nbase(i)-1))) * 100.0 |
421 |
ubar(i) = ubar(i)/(ple(i,1)-ple(i,nbase(i))) |
ubar(i) = ubar(i)/(ps(i)-ple(i,Lm+1-(nbase(i)-1))) |
422 |
vbar(i) = vbar(i)/(ple(i,1)-ple(i,nbase(i))) |
vbar(i) = vbar(i)/(ps(i)-ple(i,Lm+1-(nbase(i)-1))) |
|
|
|
|
speed(i) = SQRT( ubar(i)*ubar(i) + vbar(i)*vbar(i) ) |
|
|
ang(i) = ATAN2(vbar(i),ubar(i)) |
|
423 |
|
|
424 |
|
speed(i) = sqrt( ubar(i)*ubar(i) + vbar(i)*vbar(i) ) |
425 |
|
ang(i) = atan2(vbar(i),ubar(i)) |
426 |
enddo |
enddo |
427 |
|
|
428 |
c Brunt Vaisala Frequency |
c Brunt Vaisala Frequency |
429 |
c ----------------------- |
c ----------------------- |
430 |
do i = 1,irun |
do i = 1,irun |
431 |
do l = 2,nbase(i) |
do l = 2,nbase(i) |
432 |
VAI1 = (T(i,lm+1-l)-T(i,lm+2-l))/DZ(i,l)+GOCP |
vai1 = (t(i,Lm+1-L)-t(i,Lm+2-L))/dz(i,L)+gocp |
433 |
if( VAI1.LT.0.0 ) then |
if( vai1.LT.0.0 ) then |
434 |
VAI1 = 0.0 |
vai1 = 0.0 |
435 |
endif |
endif |
436 |
VAI2 = 2.0*GRAV/( T(i,lm+1-l)+T(i,lm+2-l) ) |
vai2 = 2.0*grav/( t(i,Lm+1-L)+t(i,Lm+2-L) ) |
437 |
VSQUA = VAI1*VAI2 |
vsqua = vai1*vai2 |
438 |
BV(i,l) = SQRT(VSQUA) |
bv(i,L) = sqrt(vsqua) |
439 |
enddo |
enddo |
440 |
enddo |
enddo |
441 |
|
|
442 |
c Stress at the Surface Level |
c Stress at the Surface Level |
443 |
c --------------------------- |
c --------------------------- |
444 |
do i = 1,irun |
do i = 1,irun |
445 |
nbar(i) = 0.0 |
nbar(i) = 0.0 |
446 |
enddo |
enddo |
447 |
do i = 1,irun |
do i = 1,irun |
448 |
do l = 2,nbase(i) |
do l = 2,nbase(i) |
449 |
NBAR(i) = NBAR(i) + BV(i,l)*(pl(i,l-1)-pl(i,l)) |
nbar(i) = nbar(i) + bv(i,L)*(pl(i,Lm+2-L)-pl(i,Lm+1-L)) |
450 |
enddo |
enddo |
451 |
enddo |
enddo |
452 |
|
|
453 |
do i = 1,irun |
do i = 1,irun |
454 |
NBAR(i) = NBAR(i)/(pl(i,1)-pl(i,nbase(i))) |
nbar(i) = nbar(i)/(pl(i,Lm)-pl(i,Lm+1-nbase(i))) |
455 |
FRSF = NBAR(i)*tstd(i)/speed(i) |
frsf = nbar(i)*std(i)/speed(i) |
456 |
|
|
457 |
if( speed(i).eq.0.0 .or. nbar(i).eq.0.0 ) then |
if( speed(i).eq.0.0 .or. nbar(i).eq.0.0 ) then |
458 |
TENSIO(i,1) = 0.0 |
tensio(i,1) = 0.0 |
459 |
else |
else |
460 |
GSTAR = G*FRSF*FRSF/(FRSF*FRSF+A*A) |
gstar = g*frsf*frsf/(frsf*frsf+a*a) |
461 |
TENSIO(i,1) = GSTAR*(ROBAR(i)*speed(i)*speed(i)*speed(i)) |
tensio(i,1) = gstar*(robar(i)*speed(i)*speed(i)*speed(i)) |
462 |
. / (NBAR(i)*LSTAR) |
. / (nbar(i)*lstar) |
463 |
endif |
endif |
464 |
|
|
465 |
XTENS(i,1) = TENSIO(i,1) * cos(ang(i)) |
xtens(i,1) = tensio(i,1) * cos(ang(i)) |
466 |
YTENS(i,1) = TENSIO(i,1) * sin(ang(i)) |
ytens(i,1) = tensio(i,1) * sin(ang(i)) |
467 |
DRAGSF(i) = TENSIO(i,1) |
dragsf(i) = tensio(i,1) |
468 |
XDRAG(i) = XTENS(i,1) |
xdrag(i) = xtens(i,1) |
469 |
YDRAG(i) = YTENS(i,1) |
ydrag(i) = ytens(i,1) |
470 |
enddo |
enddo |
471 |
|
|
472 |
c Check for Very thin lowest layer |
c Check for Very thin lowest layer |
473 |
c -------------------------------- |
c -------------------------------- |
474 |
do i = 1,irun |
do i = 1,irun |
475 |
if( NTHIN(i).gt.1 ) then |
if( nthin(i).gt.1 ) then |
476 |
do l = 1,nthin(i) |
do l = 1,nthin(i) |
477 |
TENSIO(i,l) = TENSIO(i,1) |
tensio(i,L) = tensio(i,1) |
478 |
XTENS(i,l) = XTENS(i,1) |
xtens(i,L) = xtens(i,1) |
479 |
YTENS(i,l) = YTENS(i,1) |
ytens(i,L) = ytens(i,1) |
480 |
enddo |
enddo |
481 |
endif |
endif |
482 |
enddo |
enddo |
483 |
|
|
484 |
c****************************************************** |
c****************************************************** |
486 |
c****************************************************** |
c****************************************************** |
487 |
|
|
488 |
do i = 1,irun |
do i = 1,irun |
489 |
do l = nthin(i)+1,nbase(i) |
do l = nthin(i)+1,nbase(i) |
490 |
|
|
491 |
velco = 0.5*( (u(i,lm+1-l)*ubar(i) + v(i,lm+1-l)*vbar(i)) |
velco = 0.5*( (u(i,Lm+1-L)*ubar(i) + v(i,Lm+1-L)*vbar(i)) |
492 |
. + (u(i,lm+2-l)*ubar(i) + v(i,lm+2-l)*vbar(i)) ) |
. + (u(i,Lm+2-L)*ubar(i) + v(i,Lm+2-L)*vbar(i)) ) |
493 |
. / speed(i) |
. / speed(i) |
494 |
|
|
495 |
C Convert to Newton/m**2 |
C Convert to Newton/m**2 |
496 |
roave = 0.5*(ro(i,l-1)+ro(i,l)) * 100.0 |
roave = 0.5*(ro(i,L-1)+ro(i,L)) * 100.0 |
497 |
|
|
498 |
if( VELCO.le.0.0 ) then |
if( velco.le.0.0 ) then |
499 |
TENSIO(i,l) = TENSIO(i,l-1) |
tensio(i,L) = tensio(i,L-1) |
500 |
goto 1500 |
goto 1500 |
501 |
endif |
endif |
502 |
|
|
503 |
c Froude number squared |
c Froude number squared |
504 |
c --------------------- |
c --------------------- |
505 |
FRO2 = bv(i,l)/(AKWNMB*ROAVE*VELCO*VELCO*VELCO)*TENSIO(i,l-1) |
fro2 = bv(i,L)/(akwnmb*roave*velco*velco*velco)*tensio(i,L-1) |
506 |
DELUU = u(i,lm+1-l)-u(i,lm+2-l) |
deluu = u(i,Lm+1-L)-u(i,Lm+2-L) |
507 |
DELVV = v(i,lm+1-l)-v(i,lm+2-l) |
delvv = v(i,Lm+1-L)-v(i,Lm+2-L) |
508 |
DELVE2 = ( DELUU*DELUU + DELVV*DELVV ) |
delve2 = ( deluu*deluu + delvv*delvv ) |
509 |
|
|
510 |
c Compute Richarson Number |
c Compute Richarson Number |
511 |
c ------------------------ |
c ------------------------ |
512 |
if( DELVE2.ne.0.0 ) then |
if( delve2.ne.0.0 ) then |
513 |
DELZ = DZ(i,l) |
delz = dz(i,L) |
514 |
VSQUA = BV(i,l)*BV(i,l) |
vsqua = bv(i,L)*bv(i,L) |
515 |
RICHSN = DELZ*DELZ*VSQUA/DELVE2 |
richsn = delz*delz*vsqua/delve2 |
516 |
else |
else |
517 |
RICHSN = 99999.0 |
richsn = 99999.0 |
518 |
endif |
endif |
519 |
|
|
520 |
if( RICHSN.le.0.25 ) then |
if( richsn.le.0.25 ) then |
521 |
TENSIO(i,l) = TENSIO(i,l-1) |
tensio(i,L) = tensio(i,L-1) |
522 |
goto 1500 |
goto 1500 |
523 |
endif |
endif |
524 |
|
|
525 |
c Stress in the Base Layer changes if the local Froude number |
c Stress in the Base Layer changes if the local Froude number |
526 |
c exceeds the Critical Froude number |
c exceeds the Critical Froude number |
527 |
c ---------------------------------- |
c ---------------------------------- |
528 |
CRIFRO = 1.0 - 0.25/RICHSN |
crifro = 1.0 - 0.25/richsn |
529 |
CRIF2 = CRIFRO*CRIFRO |
crif2 = crifro*crifro |
530 |
if( l.eq.2 ) CRIF2 = MIN(0.7,CRIF2) |
if( l.eq.2 ) crif2 = min(0.7 _d 0,crif2) |
531 |
|
|
532 |
if( FRO2.gt.CRIF2 ) then |
if( fro2.gt.crif2 ) then |
533 |
TENSIO(i,l) = CRIF2/FRO2*TENSIO(i,l-1) |
tensio(i,L) = crif2/fro2*tensio(i,L-1) |
534 |
else |
else |
535 |
TENSIO(i,l) = TENSIO(i,l-1) |
tensio(i,L) = tensio(i,L-1) |
536 |
endif |
endif |
537 |
|
|
538 |
1500 CONTINUE |
1500 continue |
539 |
XTENS(i,l) = TENSIO(i,l)*COS(ang(i)) |
xtens(i,L) = tensio(i,L)*cos(ang(i)) |
540 |
YTENS(i,l) = TENSIO(i,l)*SIN(ang(i)) |
ytens(i,L) = tensio(i,L)*sin(ang(i)) |
541 |
|
|
542 |
enddo |
enddo |
543 |
enddo |
enddo |
544 |
|
|
545 |
c****************************************************** |
c****************************************************** |
547 |
c****************************************************** |
c****************************************************** |
548 |
|
|
549 |
do i = 1,irun |
do i = 1,irun |
550 |
icrilv(i) = 0 |
icrilv(i) = 0 |
551 |
enddo |
enddo |
552 |
|
|
553 |
do i = 1,irun |
do i = 1,irun |
554 |
do l = nbase(i)+1,lm+1 |
do l = nbase(i)+1,Lm+1 |
555 |
|
|
556 |
TENSIO(i,l) = 0.0 |
tensio(i,L) = 0.0 |
557 |
|
|
558 |
c Check for Critical Level Absorption |
c Check for Critical Level Absorption |
559 |
c ----------------------------------- |
c ----------------------------------- |
560 |
if( icrilv(i).eq.1 ) goto 130 |
if( icrilv(i).eq.1 ) goto 130 |
561 |
|
|
562 |
c Let Remaining Stress escape out the top edge of model |
c Let Remaining Stress escape out the top edge of model |
563 |
c ----------------------------------------------------- |
c ----------------------------------------------------- |
564 |
if( l.eq.lm+1 ) then |
if( l.eq.Lm+1 ) then |
565 |
TENSIO(i,l) = TENSIO(i,l-1) |
tensio(i,L) = tensio(i,L-1) |
566 |
goto 130 |
goto 130 |
567 |
endif |
endif |
568 |
|
|
569 |
ROAVE = 0.5*(ro(i,l-1)+ro(i,l)) * 100.0 |
roave = 0.5*(ro(i,L-1)+ro(i,L)) * 100.0 |
570 |
VAI1 = (T(i,lm+1-l)-T(i,lm+2-l))/DZ(i,l)+GOCP |
vai1 = (t(i,Lm+1-L)-t(i,Lm+2-L))/dz(i,L)+gocp |
571 |
|
|
572 |
if( VAI1.lt.0.0 ) then |
if( vai1.lt.0.0 ) then |
573 |
icrilv(i) = 1 |
icrilv(i) = 1 |
574 |
TENSIO(i,l) = 0.0 |
tensio(i,L) = 0.0 |
575 |
goto 130 |
goto 130 |
576 |
endif |
endif |
577 |
|
|
578 |
|
vai2 = 2.0*grav/(t(i,Lm+1-L)+t(i,Lm+2-L)) |
579 |
|
vsqua = vai1*vai2 |
580 |
|
vaisd = sqrt(vsqua) |
581 |
|
|
582 |
VAI2 = 2.0*GRAV/(T(i,lm+1-l)+T(i,lm+2-l)) |
velco = 0.5*( (u(i,Lm+1-L)*ubar(i) + v(i,Lm+1-L)*vbar(i)) |
583 |
VSQUA = VAI1*VAI2 |
. + (u(i,Lm+2-L)*ubar(i) + v(i,Lm+2-L)*vbar(i)) ) |
|
VAISD = SQRT(VSQUA) |
|
|
|
|
|
velco = 0.5*( (u(i,lm+1-l)*ubar(i) + v(i,lm+1-l)*vbar(i)) |
|
|
. + (u(i,lm+2-l)*ubar(i) + v(i,lm+2-l)*vbar(i)) ) |
|
584 |
. / speed(i) |
. / speed(i) |
585 |
|
|
586 |
if( velco.lt.0.0 ) then |
if( velco.lt.0.0 ) then |
587 |
icrilv(i) = 1 |
icrilv(i) = 1 |
588 |
TENSIO(i,l) = 0.0 |
tensio(i,L) = 0.0 |
589 |
goto 130 |
goto 130 |
590 |
endif |
endif |
591 |
|
|
592 |
c Froude number squared |
c Froude number squared |
593 |
c --------------------- |
c --------------------- |
594 |
FRO2 = vaisd/(AKWNMB*ROAVE*VELCO*VELCO*VELCO)*TENSIO(i,l-1) |
fro2 = vaisd/(akwnmb*roave*velco*velco*velco)*tensio(i,L-1) |
595 |
DELUU = u(i,lm+1-l)-u(i,lm+2-l) |
deluu = u(i,Lm+1-L)-u(i,Lm+2-L) |
596 |
DELVV = v(i,lm+1-l)-v(i,lm+2-l) |
delvv = v(i,Lm+1-L)-v(i,Lm+2-L) |
597 |
DELVE2 = ( DELUU*DELUU + DELVV*DELVV ) |
delve2 = ( deluu*deluu + delvv*delvv ) |
598 |
|
|
599 |
c Compute Richarson Number |
c Compute Richarson Number |
600 |
c ------------------------ |
c ------------------------ |
601 |
if( DELVE2.ne.0.0 ) then |
if( delve2.ne.0.0 ) then |
602 |
DELZ = DZ(i,l) |
delz = dz(i,L) |
603 |
RICHSN = DELZ*DELZ*VSQUA/DELVE2 |
richsn = delz*delz*vsqua/delve2 |
604 |
else |
else |
605 |
RICHSN = 99999.0 |
richsn = 99999.0 |
606 |
endif |
endif |
607 |
|
|
608 |
if( RICHSN.le.0.25 ) then |
if( richsn.le.0.25 ) then |
609 |
TENSIO(i,l) = 0.0 |
tensio(i,L) = 0.0 |
610 |
icrilv(i) = 1 |
icrilv(i) = 1 |
611 |
goto 130 |
goto 130 |
612 |
endif |
endif |
613 |
|
|
614 |
c Stress in Layer changes if the local Froude number |
c Stress in Layer changes if the local Froude number |
615 |
c exceeds the Critical Froude number |
c exceeds the Critical Froude number |
616 |
c ---------------------------------- |
c ---------------------------------- |
617 |
CRIFRO = 1.0 - 0.25/RICHSN |
crifro = 1.0 - 0.25/richsn |
618 |
CRIF2 = CRIFRO*CRIFRO |
crif2 = crifro*crifro |
|
|
|
|
if( FRO2.ge.CRIF2 ) then |
|
|
TENSIO(i,l) = CRIF2/FRO2*TENSIO(i,l-1) |
|
|
else |
|
|
TENSIO(i,l) = TENSIO(i,l-1) |
|
|
endif |
|
619 |
|
|
620 |
130 continue |
if( fro2.ge.crif2 ) then |
621 |
XTENS(i,l) = TENSIO(i,l)*COS(ang(i)) |
tensio(i,L) = crif2/fro2*tensio(i,L-1) |
622 |
YTENS(i,l) = TENSIO(i,l)*SIN(ang(i)) |
else |
623 |
enddo |
tensio(i,L) = tensio(i,L-1) |
624 |
|
endif |
625 |
|
|
626 |
|
130 continue |
627 |
|
xtens(i,L) = tensio(i,L)*cos(ang(i)) |
628 |
|
ytens(i,L) = tensio(i,L)*sin(ang(i)) |
629 |
|
enddo |
630 |
enddo |
enddo |
631 |
|
|
632 |
C ****************************************************** |
C ****************************************************** |
634 |
C ****************************************************** |
C ****************************************************** |
635 |
|
|
636 |
do i = 1,irun |
do i = 1,irun |
637 |
do l = nthin(i)+1,lm |
do l = nthin(i)+1,Lm |
638 |
coef = -grav*ple(i,lm+1)/dpres(i,lm+1-l) |
coef = -grav*ps(i)/dpres(i,Lm+1-L) |
639 |
dudt(i,lm+1-l) = coef*(XTENS(i,l+1)-XTENS(i,l)) |
dudt(i,Lm+1-L) = coef*(xtens(i,L+1)-xtens(i,L)) |
640 |
dvdt(i,lm+1-l) = coef*(YTENS(i,l+1)-YTENS(i,l)) |
dvdt(i,Lm+1-L) = coef*(ytens(i,L+1)-ytens(i,L)) |
641 |
enddo |
enddo |
642 |
enddo |
enddo |
643 |
|
|
644 |
c Momentum change near the surface |
c Momentum change near the surface |
645 |
c -------------------------------- |
c -------------------------------- |
646 |
do i = 1,irun |
do i = 1,irun |
647 |
coef = grav*ple(i,lm+1)/(ple(i,lm+1-nthin(i))-ple(i,lm+1)) |
coef = grav*ps(i)/(ple(i,Lm+1-nthin(i))-ple(i,Lm+1)) |
648 |
dudt(i,lm) = coef*(XTENS(i,nthin(i)+1)-XTENS(i,1)) |
dudt(i,Lm) = coef*(xtens(i,nthin(i)+1)-xtens(i,1)) |
649 |
dvdt(i,lm) = coef*(YTENS(i,nthin(i)+1)-YTENS(i,1)) |
dvdt(i,Lm) = coef*(ytens(i,nthin(i)+1)-ytens(i,1)) |
650 |
enddo |
enddo |
651 |
|
|
652 |
c If Lowest layer is very thin, it is strapped to next layer |
c If Lowest layer is very thin, it is strapped to next layer |
653 |
c ---------------------------------------------------------- |
c ---------------------------------------------------------- |
654 |
do i = 1,irun |
do i = 1,irun |
655 |
if( nthin(i).gt.1 ) then |
if( nthin(i).gt.1 ) then |
656 |
do l = 2,nthin(i) |
do l = 2,nthin(i) |
657 |
dudt(i,lm+1-l) = dudt(i,lm) |
dudt(i,Lm+1-L) = dudt(i,Lm) |
658 |
dvdt(i,lm+1-l) = dvdt(i,lm) |
dvdt(i,Lm+1-L) = dvdt(i,Lm) |
659 |
enddo |
enddo |
660 |
endif |
endif |
661 |
enddo |
enddo |
662 |
|
|
663 |
c Convert Units to (m/sec**2) |
c Convert Units to (m/sec**2) |
664 |
c --------------------------- |
c --------------------------- |
665 |
do l = 1,lm |
do l = 1,Lm |
666 |
do i = 1,irun |
do i = 1,irun |
667 |
dudt(i,l) = - dudt(i,l)/ps(i)*0.01 |
dudt(i,L) = - dudt(i,L)/ps(i)*0.01 |
668 |
dvdt(i,l) = - dvdt(i,l)/ps(i)*0.01 |
dvdt(i,L) = - dvdt(i,L)/ps(i)*0.01 |
669 |
enddo |
enddo |
670 |
enddo |
enddo |
671 |
|
|