1 |
C $Header: /u/gcmpack/MITgcm/verification/fizhi-gridalt-hs/code/do_fizhi.F,v 1.3 2004/09/29 14:47:54 molod Exp $ |
2 |
C $Name: $ |
3 |
#include "FIZHI_OPTIONS.h" |
4 |
subroutine do_fizhi(myid, |
5 |
. idim1,idim2,jdim1,jdim2,Nrphin,Nsxin,Nsyin,im1,im2,jm1,jm2,bi,bj, |
6 |
. nchp,nchptot,nchpland, |
7 |
. uphy,vphy,thphy,sphy,pephy,lons,lats, |
8 |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
9 |
. tgz,sst,sice,phis_var,landtype,fracland,emiss,albnirdr,albnirdf, |
10 |
. albvisdr,albvisdf,ityp,chfr,alai,agrn,igrd,chlat,chlon, |
11 |
. tcanopy,tdeep,ecanopy,swetshal,swetroot,swetdeep,snodep,capac, |
12 |
. o3,qstr,co2,cfc11,cfc12,cfc22,n2o,methane, |
13 |
. duphy,dvphy,dthphy,dsphy) |
14 |
c----------------------------------------------------------------------- |
15 |
c Interface routine to calculate physics increments - calls fizhi_driver. |
16 |
c Purpose of this routine is to set up arrays local to fizhi and 'save' |
17 |
c them from one iteration to the next, and act as interface between the |
18 |
c model common blocks (held in fizhi_wrapper) and fizhi_driver. |
19 |
c Copies of variables that are 'shadowed' are made here without shadows |
20 |
c for passing to fizhi_driver. |
21 |
c Note: routine is called from inside a bi-bj loop |
22 |
c |
23 |
c----------------------------------------------------------------------- |
24 |
implicit none |
25 |
#include "SIZE.h" |
26 |
#include "fizhi_SIZE.h" |
27 |
#include "chronos.h" |
28 |
|
29 |
C Argument list declarations |
30 |
integer myid,im1,im2,jm1,jm2,idim1,idim2,jdim1,jdim2 |
31 |
integer Nrphin,Nsxin,Nsyin,bi,bj,nchp |
32 |
integer nchptot(Nsxin,Nsyin),nchpland(Nsxin,Nsyin) |
33 |
_RL uphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
34 |
_RL vphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
35 |
_RL thphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
36 |
_RL sphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
37 |
_RL pephy(idim1:idim2,jdim1:jdim2,Nrphin+1,Nsxin,Nsyin) |
38 |
_RS lons(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
39 |
_RS lats(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
40 |
_RL ctmt(nchp,Nsxin,Nsyin),xxmt(nchp,Nsxin,Nsyin) |
41 |
_RL yymt(nchp,Nsxin,Nsyin) |
42 |
_RL zetamt(nchp,Nsxin,Nsyin) |
43 |
_RL xlmt(nchp,Nrphin,Nsxin,Nsyin),khmt(nchp,Nrphin,Nsxin,Nsyin) |
44 |
_RL tke(nchp,Nrphin,Nsxin,Nsyin) |
45 |
_RL tgz(im2,jm2,Nsxin,Nsyin) |
46 |
_RL sst(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
47 |
_RL sice(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
48 |
_RL phis_var(im2,jm2,Nsxin,Nsyin) |
49 |
integer landtype(im2,jm2,Nsxin,Nsyin) |
50 |
_RL fracland(im2,jm2,Nsxin,Nsyin),emiss(im2,jm2,10,Nsxin,Nsyin) |
51 |
_RL albvisdr(im2,jm2,Nsxin,Nsyin),albvisdf(im2,jm2,Nsxin,Nsyin) |
52 |
_RL albnirdr(im2,jm2,Nsxin,Nsyin),albnirdf(im2,jm2,Nsxin,Nsyin) |
53 |
_RL chfr(nchp,Nsxin,Nsyin),alai(nchp,Nsxin,Nsyin) |
54 |
_RL agrn(nchp,Nsxin,Nsyin) |
55 |
integer ityp(nchp,Nsxin,Nsyin),igrd(nchp,Nsxin,Nsyin) |
56 |
_RL chlat(nchp,Nsxin,Nsyin),chlon(nchp,Nsxin,Nsyin) |
57 |
_RL tcanopy(nchp,Nsxin,Nsyin),tdeep(nchp,Nsxin,Nsyin) |
58 |
_RL ecanopy(nchp,Nsxin,Nsyin),swetshal(nchp,Nsxin,Nsyin) |
59 |
_RL swetroot(nchp,Nsxin,Nsyin),swetdeep(nchp,Nsxin,Nsyin) |
60 |
_RL snodep(nchp,Nsxin,Nsyin),capac(nchp,Nsxin,Nsyin) |
61 |
_RL o3(im2,jm2,Nrphin,Nsxin,Nsyin) |
62 |
_RL qstr(im2,jm2,Nrphin,Nsxin,Nsyin) |
63 |
_RL co2,cfc11,cfc12,cfc22,n2o(Nrphin),methane(Nrphin) |
64 |
_RL duphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
65 |
_RL dvphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
66 |
_RL dthphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
67 |
_RL dsphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
68 |
|
69 |
|
70 |
c Local Variables |
71 |
integer ptracer,ntracer |
72 |
parameter (ptracer = 1) |
73 |
parameter (ntracer = 1) |
74 |
integer iras,nlwcld,nlwlz,nswcld,nswlz |
75 |
integer imstturbsw,imstturblw |
76 |
|
77 |
_RL xlats(sNx,sNy),xlons(sNx,sNy),sea_ice(sNx,sNy) |
78 |
_RL p(sNx,sNy,Nsx,Nsy) |
79 |
_RL u(sNx,sNy,Nrphys),v(sNx,sNy,Nrphys),t(sNx,sNy,Nrphys) |
80 |
_RL q(sNx,sNy,Nrphys,ntracer) |
81 |
_RL pl(sNx,sNy,Nrphys,Nsx,Nsy),pkl(sNx,sNy,Nrphys,Nsx,Nsy) |
82 |
_RL ple(sNx,sNy,Nrphys+1,Nsx,Nsy) |
83 |
_RL pkle(sNx,sNy,Nrphys+1,Nsx,Nsy) |
84 |
_RL dpres(sNx,sNy,Nrphys,Nsx,Nsy) |
85 |
_RL lwdt(sNx,sNy,Nrphys,Nsx,Nsy) |
86 |
_RL lwdtclr(sNx,sNy,Nrphys,Nsx,Nsy) |
87 |
_RL swdt(sNx,sNy,Nrphys,Nsx,Nsy) |
88 |
_RL swdtclr(sNx,sNy,Nrphys,Nsx,Nsy) |
89 |
_RL turbu(sNx,sNy,Nrphys,Nsx,Nsy) |
90 |
_RL turbv(sNx,sNy,Nrphys,Nsx,Nsy) |
91 |
_RL turbt(sNx,sNy,Nrphys,Nsx,Nsy) |
92 |
_RL turbq(sNx,sNy,Nrphys,ntracer,Nsx,Nsy) |
93 |
_RL moistu(sNx,sNy,Nrphys,Nsx,Nsy) |
94 |
_RL moistv(sNx,sNy,Nrphys,Nsx,Nsy) |
95 |
_RL moistt(sNx,sNy,Nrphys,Nsx,Nsy) |
96 |
_RL moistq(sNx,sNy,Nrphys,ntracer,Nsx,Nsy) |
97 |
_RL radswt(sNx,sNy,Nsx,Nsy),radswg(sNx,sNy,Nsx,Nsy) |
98 |
_RL swgclr(sNx,sNy,Nsx,Nsy) |
99 |
_RL fdirpar(sNx,sNy,Nsx,Nsy),fdifpar(sNx,sNy,Nsx,Nsy) |
100 |
_RL osr(sNx,sNy,Nsx,Nsy),osrclr(sNx,sNy,Nsx,Nsy) |
101 |
_RL tg0(sNx,sNy,Nsx,Nsy),radlwg(sNx,sNy,Nsx,Nsy) |
102 |
_RL lwgclr(sNx,sNy,Nsx,Nsy),st4(sNx,sNy,Nsx,Nsy) |
103 |
_RL dst4(sNx,sNy,Nsx,Nsy),dlwdtg(sNx,sNy,Nrphys,Nsx,Nsy) |
104 |
_RL rainlsp(sNx,sNy,Nsx,Nsy),raincon(sNx,sNy,Nsx,Nsy) |
105 |
_RL snowfall(sNx,sNy,Nsx,Nsy) |
106 |
_RL cldtot_lw(sNx,sNy,Nrphys,Nsx,Nsy) |
107 |
_RL cldras_lw(sNx,sNy,Nrphys,Nsx,Nsy) |
108 |
_RL cldlsp_lw(sNx,sNy,Nrphys,Nsx,Nsy) |
109 |
_RL lwlz(sNx,sNy,Nrphys,Nsx,Nsy) |
110 |
_RL cldtot_sw(sNx,sNy,Nrphys,Nsx,Nsy) |
111 |
_RL cldras_sw(sNx,sNy,Nrphys,Nsx,Nsy) |
112 |
_RL cldlsp_sw(sNx,sNy,Nrphys,Nsx,Nsy) |
113 |
_RL swlz(sNx,sNy,Nrphys,Nsx,Nsy) |
114 |
_RL qliqavesw(sNx,sNy,Nrphys,Nsx,Nsy) |
115 |
_RL qliqavelw(sNx,sNy,Nrphys,Nsx,Nsy) |
116 |
_RL fccavesw(sNx,sNy,Nrphys,Nsx,Nsy) |
117 |
_RL fccavelw(sNx,sNy,Nrphys,Nsx,Nsy) |
118 |
_RL qq(sNx,sNy,Nrphys,Nsx,Nsy) |
119 |
|
120 |
integer i,j,L |
121 |
_RL getcon, kappa, p0kappa, s0, ra |
122 |
_RL cosz(sNx,sNy) |
123 |
|
124 |
_RL tempij(sNx,sNy) |
125 |
_RL tempi(2) |
126 |
|
127 |
_RL kF,sigma_b,ks,ka,deg2rad,pi,atm_po,atm_kappa,termp,kv,kT |
128 |
_RL term1,term2,thetalim,thetaeq,recip_p0g |
129 |
|
130 |
logical alarm |
131 |
external alarm |
132 |
|
133 |
c save lwdt,lwdtclr,swdt,swdtclr,turbu,turbv,turbt,turbq |
134 |
c save moistu,moistv,moistt,moistq |
135 |
c save radswg,swgclr,fdirpar,fdifpar,osr,osrclr,tg0,radlwg |
136 |
c save st4,dst4,dlwdtg,rainlsp,raincon,snowfall,iras |
137 |
c save nlwcld,cldtot_lw,cldras_lw,cldlsp_lw,nlwlz,lwlz |
138 |
c save nswcld,cldtot_sw,cldras_sw,cldlsp_sw,nswlz,swlz |
139 |
c save imstturbsw,imstturblw,qliqavesw,qliqavelw,fccavesw,fccavelw |
140 |
c save qq |
141 |
c save pl,ple,dpres,pkle,pkl |
142 |
|
143 |
common /saver/ lwdt,lwdtclr,swdt,swdtclr,turbu,turbv,turbt,turbq |
144 |
common /saver/ moistu,moistv,moistt,moistq |
145 |
common /saver/ radswg,swgclr,fdirpar,fdifpar,osr,osrclr,tg0,radlwg |
146 |
common /saver/ st4,dst4,dlwdtg,rainlsp,raincon,snowfall |
147 |
common /saver/ cldtot_lw,cldras_lw,cldlsp_lw,lwlz |
148 |
common /saver/ cldtot_sw,cldras_sw,cldlsp_sw,swlz |
149 |
common /saver/ imstturbsw,imstturblw,qliqavesw,qliqavelw,fccavesw |
150 |
common /saver/ fccavelw |
151 |
common /saver/ qq |
152 |
common /saver/ pl,ple,dpres,pkle,pkl |
153 |
common /saver/ nlwcld,nlwlz |
154 |
common /saver/ nswcld,nswlz |
155 |
common /saver/ iras |
156 |
|
157 |
C*********************************************************************** |
158 |
C Unshadow input arrays (and make 'fizhi theta' from true theta) |
159 |
C*********************************************************************** |
160 |
|
161 |
Creal if( (nhms.eq.nhms0) .and. (nymd.eq.nymd0) ) then |
162 |
Creal _BEGIN_MASTER(myid) |
163 |
Creal if(myid.eq.1.and.bi.eq.1) print *,' Initializing fizhi arrays ' |
164 |
Creal _END_MASTER(myid) |
165 |
Creal imstturblw = 0 |
166 |
Creal imstturbsw = 0 |
167 |
Creal iras = 0 |
168 |
Creal nlwcld = 0 |
169 |
Creal nlwlz = 0 |
170 |
Creal nswcld = 0 |
171 |
Creal nswlz = 0 |
172 |
Creal do L = 1,Nrphys |
173 |
Creal do j = jm1,jm2 |
174 |
Creal do i = im1,im2 |
175 |
Creal swlz(i,j,L,bi,bj) = 0. |
176 |
Creal lwlz(i,j,L,bi,bj) = 0. |
177 |
Creal qliqavesw(i,j,L,bi,bj) = 0. |
178 |
Creal qliqavelw(i,j,L,bi,bj) = 0. |
179 |
Creal fccavesw(i,j,L,bi,bj) = 0. |
180 |
Creal fccavelw(i,j,L,bi,bj) = 0. |
181 |
Creal cldtot_sw(i,j,L,bi,bj) = 0. |
182 |
Creal cldras_sw(i,j,L,bi,bj) = 0. |
183 |
Creal cldlsp_sw(i,j,L,bi,bj) = 0. |
184 |
Creal cldtot_lw(i,j,L,bi,bj) = 0. |
185 |
Creal cldras_lw(i,j,L,bi,bj) = 0. |
186 |
Creal cldlsp_lw(i,j,L,bi,bj) = 0. |
187 |
Creal lwdt(i,j,L,bi,bj) = 0. |
188 |
Creal swdt(i,j,L,bi,bj) = 0. |
189 |
Creal turbt(i,j,L,bi,bj) = 0. |
190 |
Creal moistt(i,j,L,bi,bj) = 0. |
191 |
Creal turbq(i,j,L,1,bi,bj) = 0. |
192 |
Creal moistq(i,j,L,1,bi,bj) = 0. |
193 |
Creal turbu(i,j,L,bi,bj) = 0. |
194 |
Creal moistu(i,j,L,bi,bj) = 0. |
195 |
Creal turbv(i,j,L,bi,bj) = 0. |
196 |
Creal moistv(i,j,L,bi,bj) = 0. |
197 |
Creal enddo |
198 |
Creal enddo |
199 |
Creal enddo |
200 |
Creal do j = jm1,jm2 |
201 |
Creal do i = im1,im2 |
202 |
Creal rainlsp(i,j,bi,bj) = 0. |
203 |
Creal raincon(i,j,bi,bj) = 0. |
204 |
Creal snowfall(i,j,bi,bj) = 0. |
205 |
Creal enddo |
206 |
Creal enddo |
207 |
Creal endif |
208 |
Creal |
209 |
Creal kappa = getcon('KAPPA') |
210 |
Creal p0kappa = 1000.0 ** kappa |
211 |
Creal S0 = getcon('S0') |
212 |
Creal |
213 |
Creal do j = jm1,jm2 |
214 |
Creal do i = im1,im2 |
215 |
Creal xlats(i,j) = lats(i,j,bi,bj) |
216 |
Creal xlons(i,j) = lons(i,j,bi,bj) |
217 |
Creal enddo |
218 |
Creal enddo |
219 |
Creal |
220 |
Creal call astro ( nymd,nhms, xlats,xlons, im2*jm2, cosz,ra ) |
221 |
Creal do j=jm1,jm2 |
222 |
Creal do i=im1,im2 |
223 |
Creal radswt(i,j,bi,bj) = S0*(1.0/ra**2)*cosz(i,j) |
224 |
Creal enddo |
225 |
Creal enddo |
226 |
Creal |
227 |
Creal if( alarm('moist') .or. alarm('turb') .or. |
228 |
Creal. alarm('radsw') .or. alarm('radlw') ) then |
229 |
Creal |
230 |
Crealpute pressures - all pressure are converted here to hPa |
231 |
Creal do j = jm1,jm2 |
232 |
Creal do i = im1,im2 |
233 |
Creal ple(i,j,Nrphys+1,bi,bj) = pephy(i,j,Nrphys+1,bi,bj)/100. |
234 |
Creal pkle(i,j,Nrphys+1,bi,bj)=(pephy(i,j,Nrphys+1,bi,bj)/100.) **kappa |
235 |
Creal p(i,j,bi,bj) = pephy(i,j,Nrphys+1,bi,bj)/100. |
236 |
Creal sea_ice(i,j) = sice(i,j,bi,bj) |
237 |
Creal enddo |
238 |
Creal enddo |
239 |
Creal do L = 1,Nrphys |
240 |
Creal do j = jm1,jm2 |
241 |
Creal do i = im1,im2 |
242 |
Creal u(i,j,L) = uphy(i,j,L,bi,bj) |
243 |
Creal v(i,j,L) = vphy(i,j,L,bi,bj) |
244 |
Creal t(i,j,L) = thphy(i,j,L,bi,bj)/p0kappa |
245 |
Creal q(i,j,L,1) = sphy(i,j,L,bi,bj) |
246 |
Creal pl(i,j,L,bi,bj) = (pephy(i,j,L,bi,bj)+pephy(i,j,L+1,bi,bj))/200. |
247 |
Creal dpres(i,j,L,bi,bj)=(pephy(i,j,L+1,bi,bj)-pephy(i,j,L,bi,bj))/100. |
248 |
Creal ple(i,j,L,bi,bj) = pephy(i,j,L,bi,bj)/100. |
249 |
Creal if (ple(i,j,L,bi,bj).gt.0.) then |
250 |
Creal pkle(i,j,L,bi,bj) = ple(i,j,L,bi,bj) **kappa |
251 |
Creal else |
252 |
Creal pkle(i,j,L,bi,bj) = 0. |
253 |
Creal endif |
254 |
Creal enddo |
255 |
Creal enddo |
256 |
Creal enddo |
257 |
Creal |
258 |
Creal call pkappa (im2,jm2,Nrphys,ple(1,1,1,bi,bj),pkle(1,1,1,bi,bj), |
259 |
Creal. pkl(1,1,1,bi,bj)) |
260 |
Creal |
261 |
Creal call fizhi_driver(myid,im2,jm2,Nrphys,bi,bj,ptracer,ntracer,xlats, |
262 |
Creal. xlons,p(1,1,bi,bj),u,v,t,q,pl(1,1,1,bi,bj),ple(1,1,1,bi,bj), |
263 |
Creal. dpres(1,1,1,bi,bj),pkle(1,1,1,bi,bj),pkl(1,1,1,bi,bj), |
264 |
Creal. fracland(1,1,bi,bj),landtype(1,1,bi,bj),radswt(1,1,bi,bj), |
265 |
Creal. phis_var(1,1,bi,bj),tgz(1,1,bi,bj),sea_ice,nchp,chlat(1,bi,bj), |
266 |
Creal. chlon(1,bi,bj),igrd(1,bi,bj),nchptot(bi,bj),nchpland(bi,bj), |
267 |
Creal. chfr(1,bi,bj),ityp(1,bi,bj),tcanopy(1,bi,bj),tdeep(1,bi,bj), |
268 |
Creal. ecanopy(1,bi,bj),swetshal(1,bi,bj),swetroot(1,bi,bj), |
269 |
Creal. swetdeep(1,bi,bj),capac(1,bi,bj),snodep(1,bi,bj), |
270 |
Creal. ctmt(1,bi,bj),xxmt(1,bi,bj),yymt(1,bi,bj),zetamt(1,bi,bj), |
271 |
Creal. xlmt(1,1,bi,bj),khmt(1,1,bi,bj),tke(1,1,bi,bj), |
272 |
Creal. albvisdr(1,1,bi,bj),albvisdf(1,1,bi,bj),albnirdr(1,1,bi,bj), |
273 |
Creal. albnirdf(1,1,bi,bj),emiss(1,1,1,bi,bj),alai(1,bi,bj), |
274 |
Creal. agrn(1,bi,bj), |
275 |
Creal. qstr(1,1,1,bi,bj),o3(1,1,1,bi,bj), |
276 |
Creal. co2,cfc11,cfc12,cfc22,methane,n2o, |
277 |
Creal. lwdt(1,1,1,bi,bj),lwdtclr(1,1,1,bi,bj),swdt(1,1,1,bi,bj), |
278 |
Creal. swdtclr(1,1,1,bi,bj),turbu(1,1,1,bi,bj),turbv(1,1,1,bi,bj), |
279 |
Creal. turbt(1,1,1,bi,bj),turbq(1,1,1,1,bi,bj),moistu(1,1,1,bi,bj), |
280 |
Creal. moistv(1,1,1,bi,bj),moistt(1,1,1,bi,bj),moistq(1,1,1,1,bi,bj), |
281 |
Creal. radswg(1,1,bi,bj),swgclr(1,1,bi,bj),fdirpar(1,1,bi,bj), |
282 |
Creal. fdifpar(1,1,bi,bj),osr(1,1,bi,bj),osrclr(1,1,bi,bj), |
283 |
Creal. tg0(1,1,bi,bj),radlwg(1,1,bi,bj),lwgclr(1,1,bi,bj), |
284 |
Creal. st4(1,1,bi,bj),dst4(1,1,bi,bj),dlwdtg(1,1,1,bi,bj), |
285 |
Creal. rainlsp(1,1,bi,bj),raincon(1,1,bi,bj),snowfall(1,1,bi,bj),iras, |
286 |
Creal. nlwcld,cldtot_lw(1,1,1,bi,bj),cldras_lw(1,1,1,bi,bj), |
287 |
Creal. cldlsp_lw(1,1,1,bi,bj),nlwlz,lwlz(1,1,1,bi,bj), |
288 |
Creal. nswcld,cldtot_sw(1,1,1,bi,bj),cldras_sw(1,1,1,bi,bj), |
289 |
Creal. cldlsp_sw(1,1,1,bi,bj),nswlz,swlz(1,1,1,bi,bj), |
290 |
Creal. imstturbsw,imstturblw,qliqavesw(1,1,1,bi,bj), |
291 |
Creal. qliqavelw(1,1,1,bi,bj),fccavesw(1,1,1,bi,bj), |
292 |
Creal. fccavelw(1,1,1,bi,bj),qq(1,1,1,bi,bj)) |
293 |
Creal |
294 |
Creal do L = 1,Nrphys |
295 |
Creal do j = jm1,jm2 |
296 |
Creal do i = im1,im2 |
297 |
Creal duphy(i,j,L,bi,bj) = moistu(i,j,L,bi,bj) + turbu(i,j,L,bi,bj) |
298 |
Creal dvphy(i,j,L,bi,bj) = moistv(i,j,L,bi,bj) + turbv(i,j,L,bi,bj) |
299 |
Creal dthphy(i,j,L,bi,bj) = ((moistt(i,j,L,bi,bj)+turbt(i,j,L,bi,bj)+ |
300 |
Creal. lwdt(i,j,L,bi,bj) + |
301 |
Creal. dlwdtg(i,j,L,bi,bj) * (tgz(i,j,bi,bj)-tg0(i,j,bi,bj)) + |
302 |
Creal. swdt(i,j,L,bi,bj)*radswt(i,j,bi,bj) )*p0kappa ) / p(i,j,bi,bj) |
303 |
Creal dsphy(i,j,L,bi,bj) = (moistq(i,j,L,1,bi,bj)+turbq(i,j,L,1,bi,bj)) |
304 |
Creal. /p(i,j,bi,bj) |
305 |
Creal enddo |
306 |
Creal enddo |
307 |
Creal enddo |
308 |
Creal |
309 |
Creal endif |
310 |
Creal |
311 |
Creal call fizhi_step_diag(myid,p,uphy,vphy,thphy,sphy,qq,pkl,dpres, |
312 |
Creal. radswt,radswg,swgclr,osr,osrclr,st4,dst4,tgz,tg0,radlwg,lwgclr, |
313 |
Creal. turbu,turbv,turbt,turbq,moistu,moistv,moistt,moistq, |
314 |
Creal. lwdt,swdt,lwdtclr,swdtclr,dlwdtg, |
315 |
Creal. im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,bi,bj,ntracer) |
316 |
Creal |
317 |
|
318 |
kF=1. _d 0/86400. _d 0 |
319 |
sigma_b = 0.7 _d 0 |
320 |
ka=1. _d 0/(40. _d 0*86400. _d 0) |
321 |
ks=1. _d 0/(4. _d 0 *86400. _d 0) |
322 |
pi = getcon('PI') |
323 |
atm_kappa = getcon('KAPPA') |
324 |
atm_po = getcon('ATMPOPA') |
325 |
deg2rad = getcon('DEG2RAD') |
326 |
|
327 |
do L = 1,Nrphys |
328 |
do j = jm1,jm2 |
329 |
do i = im1,im2 |
330 |
recip_P0g= 1. _d 0 / pephy(i,j,Nrphys+1,bi,bj) |
331 |
c U and V terms: |
332 |
termP=0.5 _d 0*((pephy(i,j,L,bi,bj)+pephy(i,j,L+1,bi,bj)) |
333 |
& *recip_P0g ) |
334 |
kV=kF*MAX( 0. _d 0, (termP-sigma_b)/(1. _d 0-sigma_b) ) |
335 |
duphy(i,j,L,bi,bj)= -kV*uphy(i,j,L,bi,bj) |
336 |
dvphy(i,j,L,bi,bj)= -kV*vphy(i,j,L,bi,bj) |
337 |
|
338 |
c T terms |
339 |
C-- Forcing term(s) |
340 |
term1=60. _d 0*(sin(lats(I,J,bi,bj)*deg2rad)**2) |
341 |
termP=0.5 _d 0*( pephy(i,j,L,bi,bj) + pephy(i,j,L+1,bi,bj) ) |
342 |
term2=10. _d 0*log(termP/atm_po) |
343 |
& *(cos(lats(I,J,bi,bj)*deg2rad)**2) |
344 |
thetaLim = 200. _d 0/ ((termP/atm_po)**atm_kappa) |
345 |
thetaEq=315. _d 0-term1-term2 |
346 |
thetaEq=MAX(thetaLim,thetaEq) |
347 |
kT=ka+(ks-ka) |
348 |
& *MAX(0. _d 0, |
349 |
& (termP*recip_P0g-sigma_b)/(1. _d 0-sigma_b) ) |
350 |
& *COS((lats(I,J,bi,bj)*deg2rad))**4 |
351 |
if(termP*recip_P0g.gt.0.04)then |
352 |
dthphy(i,j,L,bi,bj)=- kT*( thphy(I,J,L,bi,bj)-thetaEq ) |
353 |
else |
354 |
dthphy(i,j,L,bi,bj)=0. |
355 |
endif |
356 |
|
357 |
c S terms (hs runs dry - no moisture) |
358 |
C-- Forcing term(s) |
359 |
dsphy(i,j,L,bi,bj)=0. |
360 |
|
361 |
enddo |
362 |
enddo |
363 |
enddo |
364 |
|
365 |
return |
366 |
end |