1 |
molod |
1.22 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/do_fizhi.F,v 1.21 2004/07/18 23:17:00 molod Exp $ |
2 |
edhill |
1.2 |
C $Name: $ |
3 |
molod |
1.9 |
#include "CPP_EEOPTIONS.h" |
4 |
molod |
1.10 |
subroutine do_fizhi(myid,uphy,vphy,thphy,sphy,pephy,lons,lats, |
5 |
molod |
1.22 |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
6 |
|
|
. tgz,sice,phis_var,landtype,fracland,emiss,albnirdr,albnirdf, |
7 |
|
|
. albvisdr,albvisdf,ityp,chfr,alai,agrn,igrd,chlat,chlon, |
8 |
|
|
. tcanopy,tdeep,ecanopy,swetshal,swetroot,swetdeep,snodep,capac, |
9 |
|
|
. o3,qstr,co2,cfc11,cfc12,cfc22,n2o,methane, |
10 |
|
|
. idim1,idim2,jdim1,jdim2,Nrphin,Nsxin,Nsyin,im1,im2,jm1,jm2,bi,bj, |
11 |
|
|
. nchp,nchpland, |
12 |
|
|
. duphy,dvphy,dthphy,dsphy) |
13 |
molod |
1.1 |
c----------------------------------------------------------------------- |
14 |
molod |
1.9 |
c Interface routine to calculate physics increments - calls fizhi_driver. |
15 |
|
|
c Purpose of this routine is to set up arrays local to fizhi and 'save' |
16 |
|
|
c them from one iteration to the next, and act as interface between the |
17 |
|
|
c model common blocks (held in fizhi_wrapper) and fizhi_driver. |
18 |
|
|
c Copies of variables that are 'shadowed' are made here without shadows |
19 |
|
|
c for passing to fizhi_driver. |
20 |
|
|
c Note: routine is called from inside a bi-bj loop |
21 |
molod |
1.1 |
c |
22 |
|
|
c----------------------------------------------------------------------- |
23 |
molod |
1.5 |
implicit none |
24 |
molod |
1.22 |
#include "SIZE.h" |
25 |
|
|
#include "fizhi_SIZE.h" |
26 |
molod |
1.19 |
#include "chronos.h" |
27 |
molod |
1.1 |
|
28 |
molod |
1.10 |
C Argument list declarations |
29 |
|
|
integer myid,im1,im2,jm1,jm2,idim1,idim2,jdim1,jdim2 |
30 |
molod |
1.22 |
integer Nrphin,Nsxin,Nsyin,bi,bj,nchp,nchpland |
31 |
|
|
_RL uphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
32 |
|
|
_RL vphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
33 |
|
|
_RL thphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
34 |
|
|
_RL sphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
35 |
|
|
_RL pephy(idim1:idim2,jdim1:jdim2,Nrphin+1,Nsxin,Nsyin) |
36 |
|
|
_RL lons(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
37 |
|
|
_RL lats(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
38 |
|
|
_RL ctmt(nchp,Nsxin,Nsyin),xxmt(nchp,Nsxin,Nsyin) |
39 |
|
|
_RL yymt(nchp,Nsxin,Nsyin) |
40 |
|
|
_RL zetamt(nchp,Nsxin,Nsyin) |
41 |
|
|
_RL xlmt(nchp,Nrphin,Nsxin,Nsyin),khmt(nchp,Nrphin,Nsxin,Nsyin) |
42 |
|
|
_RL tke(nchp,Nrphin,Nsxin,Nsyin) |
43 |
|
|
_RL tgz(im2,jm2,Nsxin,Nsyin) |
44 |
|
|
_RL sice(idim1:idim2,jdim1:jdim2,Nsxin,Nsyin) |
45 |
|
|
_RL phis_var(im2,jm2,Nsxin,Nsyin),landtype(im2,jm2,Nsxin,Nsyin) |
46 |
|
|
_RL fracland(im2,jm2,Nsxin,Nsyin),emiss(im2,jm2,10,Nsxin,Nsyin) |
47 |
|
|
_RL albvisdr(im2,jm2,Nsxin,Nsyin),albvisdf(im2,jm2,Nsxin,Nsyin) |
48 |
|
|
_RL albnirdr(im2,jm2,Nsxin,Nsyin),albnirdf(im2,jm2,Nsxin,Nsyin) |
49 |
|
|
_RL chfr(nchp,Nsxin,Nsyin),alai(nchp,Nsxin,Nsyin) |
50 |
|
|
_RL agrn(nchp,Nsxin,Nsyin) |
51 |
|
|
integer ityp(nchp,Nsxin,Nsyin),igrd(nchp,Nsxin,Nsyin) |
52 |
|
|
_RL chlat(nchp,Nsxin,Nsyin),chlon(nchp,Nsxin,Nsyin) |
53 |
|
|
_RL tcanopy(nchp,Nsxin,Nsyin),tdeep(nchp,Nsxin,Nsyin) |
54 |
|
|
_RL ecanopy(nchp,Nsxin,Nsyin),swetshal(nchp,Nsxin,Nsyin) |
55 |
|
|
_RL swetroot(nchp,Nsxin,Nsyin),swetdeep(nchp,Nsxin,Nsyin) |
56 |
|
|
_RL snodep(nchp,Nsxin,Nsyin),capac(nchp,Nsxin,Nsyin) |
57 |
|
|
_RL o3(im2,jm2,Nsxin,Nsyin),qstr(im2,jm2,Nsxin,Nsyin) |
58 |
|
|
_RL co2,cfc11,cfc12,cfc22,n2o(Nrphin),methane(Nrphin) |
59 |
|
|
_RL duphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
60 |
|
|
_RL dvphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
61 |
|
|
_RL dthphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
62 |
|
|
_RL dsphy(idim1:idim2,jdim1:jdim2,Nrphin,Nsxin,Nsyin) |
63 |
|
|
|
64 |
|
|
c Local Variables |
65 |
molod |
1.10 |
integer ptracer,ntracer |
66 |
molod |
1.19 |
parameter (ptracer = 1) |
67 |
|
|
parameter (ntracer = 1) |
68 |
molod |
1.10 |
integer iras,nlwcld,nlwlz,nswcld,nswlz |
69 |
|
|
integer imstturbsw,imstturblw |
70 |
|
|
|
71 |
molod |
1.22 |
real xlats(sNx,sNy), xlons(sNx,sNy), sea_ice(sNx,sNy) |
72 |
|
|
real p(sNx,sNy,Nsx,Nsy) |
73 |
|
|
real u(sNx,sNy,Nrphys), v(sNx,sNy,Nrphys), t(sNx,sNy,Nrphys) |
74 |
|
|
real q(sNx,sNy,Nrphys,ntracer) |
75 |
|
|
real pl(sNx,sNy,Nrphys,Nsx,Nsy),pkl(sNx,sNy,Nrphys,Nsx,Nsy) |
76 |
|
|
real ple(sNx,sNy,Nrphys+1,Nsx,Nsy),pkle(sNx,sNy,Nrphys+1,Nsx,Nsy) |
77 |
|
|
real dpres(sNx,sNy,Nrphys,Nsx,Nsy) |
78 |
|
|
real lwdt(sNx,sNy,Nrphys,Nsx,Nsy),lwdtclr(sNx,sNy,Nrphys,Nsx,Nsy) |
79 |
|
|
real swdt(sNx,sNy,Nrphys,Nsx,Nsy),swdtclr(sNx,sNy,Nrphys,Nsx,Nsy) |
80 |
|
|
real turbu(sNx,sNy,Nrphys,Nsx,Nsy),turbv(sNx,sNy,Nrphys,Nsx,Nsy) |
81 |
|
|
real turbt(sNx,sNy,Nrphys,Nsx,Nsy) |
82 |
|
|
real turbq(sNx,sNy,Nrphys,ntracer,Nsx,Nsy) |
83 |
|
|
real moistu(sNx,sNy,Nrphys,Nsx,Nsy),moistv(sNx,sNy,Nrphys,Nsx,Nsy) |
84 |
|
|
real moistt(sNx,sNy,Nrphys,Nsx,Nsy) |
85 |
|
|
real moistq(sNx,sNy,Nrphys,ntracer,Nsx,Nsy) |
86 |
|
|
real radswt(sNx,sNy,Nsx,Nsy),radswg(sNx,sNy,Nsx,Nsy) |
87 |
|
|
real swgclr(sNx,sNy,Nsx,Nsy) |
88 |
|
|
real fdirpar(sNx,sNy,Nsx,Nsy),fdifpar(sNx,sNy,Nsx,Nsy) |
89 |
|
|
real osr(sNx,sNy,Nsx,Nsy),osrclr(sNx,sNy,Nsx,Nsy) |
90 |
|
|
real tg0(sNx,sNy,Nsx,Nsy),radlwg(sNx,sNy,Nsx,Nsy) |
91 |
|
|
real lwgclr(sNx,sNy,Nsx,Nsy),st4(sNx,sNy,Nsx,Nsy) |
92 |
|
|
real dst4(sNx,sNy,Nsx,Nsy),dlwdtg(sNx,sNy,Nrphys,Nsx,Nsy) |
93 |
|
|
real rainlsp(sNx,sNy,Nsx,Nsy),raincon(sNx,sNy,Nsx,Nsy) |
94 |
|
|
real snowfall(sNx,sNy,Nsx,Nsy) |
95 |
|
|
real cldtot_lw(sNx,sNy,Nrphys,Nsx,Nsy) |
96 |
|
|
real clras_lw(sNx,sNy,Nrphys,Nsx,Nsy) |
97 |
|
|
real cldlsp_lw(sNx,sNy,Nrphys,Nsx,Nsy) |
98 |
|
|
real lwlz(sNx,sNy,Nrphys,Nsx,Nsy) |
99 |
|
|
real cldtot_sw(sNx,sNy,Nrphys,Nsx,Nsy) |
100 |
|
|
real clras_sw(sNx,sNy,Nrphys,Nsx,Nsy) |
101 |
|
|
real cldlsp_sw(sNx,sNy,Nrphys,Nsx,Nsy) |
102 |
|
|
real swlz(sNx,sNy,Nrphys,Nsx,Nsy) |
103 |
|
|
real qliqavesw(sNx,sNy,Nrphys,Nsx,Nsy) |
104 |
|
|
real qliqavelw(sNx,sNy,Nrphys,Nsx,Nsy) |
105 |
|
|
real fccavesw(sNx,sNy,Nrphys,Nsx,Nsy) |
106 |
|
|
real fccavelw(sNx,sNy,Nrphys,Nsx,Nsy) |
107 |
|
|
real qq(sNx,sNy,Nrphys,Nsx,Nsy) |
108 |
molod |
1.10 |
|
109 |
molod |
1.5 |
integer i,j,L |
110 |
molod |
1.12 |
real getcon, kappa, p0kappa, s0, ra |
111 |
molod |
1.22 |
real cosz(sNx,sNy) |
112 |
molod |
1.11 |
|
113 |
molod |
1.13 |
logical alarm |
114 |
|
|
external alarm |
115 |
|
|
|
116 |
molod |
1.22 |
save lwdt,lwdtclr,swdt,swdtclr,turbu,turbv,turbt,turbq |
117 |
|
|
save moistu,moistv,moistt,moistq |
118 |
|
|
save radswg,swgclr,fdirpar,fdifpar,osr,osrclr,tg0,radlwg |
119 |
|
|
save st4,dst4,dlwdtg,rainlsp,raincon,snowfall,iras |
120 |
|
|
save nlwcld,cldtot_lw,clras_lw,cldlsp_lw,nlwlz,lwlz |
121 |
|
|
save nswcld,cldtot_sw,clras_sw,cldlsp_sw,nswlz,swlz |
122 |
|
|
save imstturbsw,imstturblw,qliqavesw,qliqavelw,fccavesw,fccavelw |
123 |
|
|
save qq |
124 |
|
|
save pl,ple,dpres,pkle,pkl |
125 |
molod |
1.13 |
|
126 |
molod |
1.11 |
C*********************************************************************** |
127 |
|
|
C Unshadow input arrays (and make 'fizhi theta' from true theta) |
128 |
|
|
C*********************************************************************** |
129 |
|
|
|
130 |
|
|
kappa = getcon('KAPPA') |
131 |
|
|
p0kappa = 1000.0 ** kappa |
132 |
molod |
1.12 |
S0 = getcon('S0') |
133 |
molod |
1.11 |
|
134 |
molod |
1.13 |
call astro ( nymd,nhms, xlats,xlons, im2*jm2, cosz,ra ) |
135 |
|
|
do j=jm1,jm2 |
136 |
|
|
do i=im1,im2 |
137 |
molod |
1.19 |
radswt(i,j,bi,bj) = S0*(1.0/ra**2)*cosz(i,j) |
138 |
molod |
1.11 |
enddo |
139 |
|
|
enddo |
140 |
molod |
1.13 |
|
141 |
|
|
if( alarm('moist') .or. alarm('turb') .or. |
142 |
|
|
. alarm('radsw') .or. alarm('radlw') ) then |
143 |
|
|
|
144 |
molod |
1.18 |
C compute pressures - all pressure are converted here to hPa |
145 |
molod |
1.11 |
do j = jm1,jm2 |
146 |
|
|
do i = im1,im2 |
147 |
molod |
1.18 |
ple(i,j,Nrphys+1,bi,bj) = pephy(i,j,Nrphys+1,bi,bj)/100. |
148 |
|
|
pkle(i,j,Nrphys+1,bi,bj)=(pephy(i,j,Nrphys+1,bi,bj)/100.) **kappa |
149 |
|
|
p(i,j,bi,bj) = pephy(i,j,Nrphys+1,bi,bj)/100. |
150 |
molod |
1.11 |
xlats(i,j) = lats(i,j,bi,bj) |
151 |
|
|
xlons(i,j) = lons(i,j,bi,bj) |
152 |
|
|
sea_ice(i,j) = sice(i,j,bi,bj) |
153 |
|
|
enddo |
154 |
|
|
enddo |
155 |
molod |
1.13 |
do L = 1,Nrphys |
156 |
|
|
do j = jm1,jm2 |
157 |
|
|
do i = im1,im2 |
158 |
|
|
u(i,j,L) = uphy(i,j,L,bi,bj) |
159 |
|
|
v(i,j,L) = vphy(i,j,L,bi,bj) |
160 |
|
|
t(i,j,L) = thphy(i,j,L,bi,bj)/p0kappa |
161 |
|
|
q(i,j,L,1) = sphy(i,j,L,bi,bj) |
162 |
molod |
1.19 |
pl(i,j,L,bi,bj) = (pephy(i,j,L,bi,bj)+pephy(i,j,L+1,bi,bj))/200. |
163 |
|
|
dpres(i,j,L,bi,bj)=(pephy(i,j,L+1,bi,bj)-pephy(i,j,L,bi,bj))/100. |
164 |
molod |
1.18 |
ple(i,j,L,bi,bj) = pephy(i,j,L,bi,bj)/100. |
165 |
molod |
1.19 |
pkle(i,j,L,bi,bj) = (ple(i,j,L,bi,bj) /100.) **kappa |
166 |
molod |
1.13 |
enddo |
167 |
molod |
1.12 |
enddo |
168 |
|
|
enddo |
169 |
|
|
|
170 |
molod |
1.16 |
call pkappa (ple(1,1,1,bi,bj),pkle(1,1,1,bi,bj),im2,jm2,Nrphys, |
171 |
|
|
. pkl(1,1,1,bi,bj)) |
172 |
molod |
1.1 |
|
173 |
molod |
1.17 |
call fizhi_driver(myid,im2,jm2,Nrphys,bi,bj,ptracer,ntracer,xlats, |
174 |
|
|
. xlons,p(1,1,bi,bj),u,v,t,q,pl(1,1,1,bi,bj),ple(1,1,1,bi,bj), |
175 |
molod |
1.16 |
. dpres(1,1,1,bi,bj),pkle(1,1,1,bi,bj),pkl(1,1,1,bi,bj), |
176 |
molod |
1.19 |
. fracland(1,1,bi,bj),landtype(1,1,bi,bj),radswt(1,1,bi,bj), |
177 |
|
|
. phis_var(1,1,bi,bj),tgz(1,1,bi,bj),sea_ice,nchp,chlat(1,bi,bj), |
178 |
|
|
. chlon(1,bi,bj),igrd(1,bi,bj),nchpland,chfr(1,bi,bj),ityp(1,bi,bj) |
179 |
|
|
. ,tcanopy(1,bi,bj),tdeep(1,bi,bj),ecanopy(1,bi,bj), |
180 |
molod |
1.12 |
. swetshal(1,bi,bj),swetroot(1,bi,bj),swetdeep(1,bi,bj), |
181 |
|
|
. capac(1,bi,bj),snodep(1,bi,bj), |
182 |
|
|
. ctmt(1,bi,bj),xxmt(1,bi,bj),yymt(1,bi,bj),zetamt(1,bi,bj), |
183 |
|
|
. xlmt(1,1,bi,bj),khmt(1,1,bi,bj),tke(1,1,bi,bj), |
184 |
molod |
1.19 |
. albvisdr(1,1,bi,bj),albvisdf(1,1,bi,bj),albnirdr(1,1,bi,bj), |
185 |
|
|
. albnirdf(1,1,bi,bj),emiss(1,1,1,bi,bj),alai(1,bi,bj), |
186 |
|
|
. agrn(1,bi,bj), |
187 |
molod |
1.12 |
. qstr(1,1,bi,bj),o3(1,1,bi,bj),co2,cfc11,cfc12,cfc22,methane,n2o, |
188 |
molod |
1.14 |
. lwdt(1,1,1,bi,bj),lwdtclr(1,1,1,bi,bj),swdt(1,1,1,bi,bj), |
189 |
|
|
. swdtclr(1,1,1,bi,bj),turbu(1,1,1,bi,bj),turbv(1,1,1,bi,bj), |
190 |
molod |
1.19 |
. turbt(1,1,1,bi,bj),turbq(1,1,1,1,bi,bj),moistu(1,1,1,bi,bj), |
191 |
|
|
. moistv(1,1,1,bi,bj),moistt(1,1,1,bi,bj),moistq(1,1,1,1,bi,bj), |
192 |
molod |
1.14 |
. radswg(1,1,bi,bj),swgclr(1,1,bi,bj),fdirpar(1,1,bi,bj), |
193 |
|
|
. fdifpar(1,1,bi,bj),osr(1,1,bi,bj),osrclr(1,1,bi,bj), |
194 |
molod |
1.19 |
. tg0(1,1,bi,bj),radlwg(1,1,bi,bj),lwgclr(1,1,bi,bj), |
195 |
molod |
1.14 |
. st4(1,1,bi,bj),dst4(1,1,bi,bj),dlwdtg(1,1,1,bi,bj), |
196 |
|
|
. rainlsp(1,1,bi,bj),raincon(1,1,bi,bj),snowfall(1,1,bi,bj),iras, |
197 |
|
|
. nlwcld,cldtot_lw(1,1,1,bi,bj),clras_lw(1,1,1,bi,bj), |
198 |
|
|
. cldlsp_lw(1,1,1,bi,bj),nlwlz,lwlz(1,1,1,bi,bj), |
199 |
|
|
. nswcld,cldtot_sw(1,1,1,bi,bj),clras_sw(1,1,1,bi,bj), |
200 |
|
|
. cldlsp_sw(1,1,1,bi,bj),nswlz,swlz(1,1,1,bi,bj), |
201 |
|
|
. imstturbsw,imstturblw,qliqavesw(1,1,1,bi,bj), |
202 |
|
|
. qliqavelw(1,1,1,bi,bj),fccavesw(1,1,1,bi,bj), |
203 |
|
|
. fccavelw(1,1,1,bi,bj),qq(1,1,1,bi,bj)) |
204 |
molod |
1.13 |
|
205 |
|
|
endif |
206 |
molod |
1.12 |
|
207 |
|
|
do L = 1,Nrphys |
208 |
|
|
do j = jm1,jm2 |
209 |
|
|
do i = im1,im2 |
210 |
molod |
1.14 |
duphy(i,j,L,bi,bj) = moistu(i,j,L,bi,bj) + turbu(i,j,L,bi,bj) |
211 |
|
|
dvphy(i,j,L,bi,bj) = moistv(i,j,L,bi,bj) + turbv(i,j,L,bi,bj) |
212 |
|
|
dthphy(i,j,L,bi,bj) = ((moistt(i,j,L,bi,bj)+turbt(i,j,L,bi,bj)+ |
213 |
|
|
. lwdt(i,j,L,bi,bj) + |
214 |
|
|
. dlwdtg(i,j,L,bi,bj) * (tgz(i,j,bi,bj)-tg0(i,j,bi,bj)) + |
215 |
molod |
1.16 |
. swdt(i,j,L,bi,bj)*radswt(i,j,bi,bj) )*p0kappa ) / p(i,j,bi,bj) |
216 |
molod |
1.14 |
dsphy(i,j,L,bi,bj) = (moistq(i,j,L,1,bi,bj)+turbq(i,j,L,1,bi,bj)) |
217 |
molod |
1.16 |
. /p(i,j,bi,bj) |
218 |
molod |
1.12 |
enddo |
219 |
|
|
enddo |
220 |
|
|
enddo |
221 |
molod |
1.5 |
|
222 |
molod |
1.19 |
call fizhi_step_diag(myid,p,uphy,vphy,thphy,sphy,qq,pkl,dpres, |
223 |
molod |
1.15 |
. radswt,radswg,swgclr,osr,osrclr,st4,dst4,tgz,tg0,radlwg,lwgclr, |
224 |
|
|
. turbu,turbv,turbt,turbq,moistu,moistv,moistt,moistq, |
225 |
molod |
1.20 |
. lwdt,swdt,lwdtclr,swdtclr,dlwdtg, |
226 |
|
|
. im1,im2,jm1,jm2,Nrphys,Nsx,Nsy,bi,bj,ntracer) |
227 |
molod |
1.15 |
|
228 |
molod |
1.5 |
return |
229 |
|
|
end |