1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "FIZHI_OPTIONS.h" |
5 |
subroutine fizhi_driver (myid,im,jm,lm,bi,bj,ptracer,ntracer, |
subroutine fizhi_driver (myid,im,jm,lm,bi,bj,ptracer,ntracer, |
6 |
. xlats,xlons, |
. xlats,xlons, |
7 |
. p,u,v,t,q,pl,ple,dpres,pkht,pkl,fracland,landtype,radswt, |
. p,u,v,t,q,pl,ple,dpres,pkht,pkl,surfz,fracland,landtype,radswt, |
8 |
. phis_var,tgz,sea_ice, |
. phis_var,tgz,sea_ice, |
9 |
. nchp,chlat,chlon,igrd,nchpland,chfr,ityp, |
. nchp,chlat,chlon,igrd,nchptot,nchpland,chfr,ityp, |
10 |
. tcanopy,tdeep,ecanopy,swetshal,swetroot,swetdeep,capac,snodep, |
. tcanopy,tdeep,ecanopy,swetshal,swetroot,swetdeep,capac,snodep, |
11 |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
12 |
. albvisdr,albvisdf,albnirdr,albnirdf,emiss,alai,agrn, |
. albvisdr,albvisdf,albnirdr,albnirdf,emiss,alai,agrn, |
13 |
. chemq,chemo3,co2,cfc11,cfc12,cfc22,methane,n2o, |
. chemq,chemo3,co2,cfc11,cfc12,cfc22,methane,n2o, |
14 |
. lwdt,lwdtclr,swdt,swdtclr,turbu,turbv,turbt,turbq, |
. lwdt,lwdtclr,swdt,swdtclr,turbu,turbv,turbt,turbq, |
15 |
. moistu,moistv,moistt,moistq, |
. moistu,moistv,moistt,moistq, |
16 |
. radswg,swgclr,fdirpar,fdifpar,osr,osrclr,tg0,radlwg, |
. radswg,swgclr,fdirpar,fdifpar,osr,osrclr,tg0,radlwg,lwgclr, |
17 |
. st4,dst4,dlwdtg,rainlsp,raincon,snowfall,iras,nlwcld, |
. st4,dst4,dlwdtg,rainlsp,raincon,snowfall,iras,nlwcld, |
18 |
. cldtot_lw,clras_lw,cldlsp_lw,nlwlz,lwlz,nswcld,cldtot_sw, |
. cldtot_lw,cldras_lw,cldlsp_lw,nlwlz,lwlz,nswcld,cldtot_sw, |
19 |
. clras_sw,cldlsp_sw,nswlz,swlz,imstturbsw,imstturblw,qliqavesw, |
. cldras_sw,cldlsp_sw,nswlz,swlz,imstturbsw,imstturblw,qliqavesw, |
20 |
. qliqavelw,fccavesw,fccavelw,qq) |
. qliqavelw,fccavesw,fccavelw,qq) |
21 |
C*********************************************************************** |
C*********************************************************************** |
22 |
C Purpose |
C Purpose |
37 |
c Diagnostic Common |
c Diagnostic Common |
38 |
c ----------------- |
c ----------------- |
39 |
#ifdef ALLOW_DIAGNOSTICS |
#ifdef ALLOW_DIAGNOSTICS |
40 |
#include 'diagnostics.h' |
#include "SIZE.h" |
41 |
|
#include "DIAGNOSTICS_SIZE.h" |
42 |
|
#include "DIAGNOSTICS.h" |
43 |
#endif |
#endif |
44 |
|
|
45 |
c Timers Common |
c Timers Common |
46 |
c ------------- |
c ------------- |
47 |
#include 'chronos.h' |
#include "chronos.h" |
48 |
|
|
49 |
c Input Parameters |
c Input Parameters |
50 |
c ---------------- |
c ---------------- |
51 |
integer myid,im,jm,lm,bi,bj,ptracer,ntracer |
integer myid,im,jm,lm,bi,bj,ptracer,ntracer |
52 |
integer nchp,chlat,chlon,igrd,nchpland,chfr,ityp |
integer nchp,igrd(nchp),nchptot,nchpland,ityp(nchp) |
|
integer nwatlevs,nwatlats |
|
|
integer nozolevs,nozolats |
|
53 |
integer iras,nlwcld,nlwlz,nswcld,nswlz |
integer iras,nlwcld,nlwlz,nswcld,nswlz |
54 |
integer imstturbsw,imstturblw |
integer imstturbsw,imstturblw |
55 |
|
|
56 |
real xlats(im,jm), xlons(im,jm) |
_RL xlats(im,jm), xlons(im,jm) |
57 |
real p(im,jm) |
_RL p(im,jm) |
58 |
real u(im,jm,lm), v(im,jm,lm), t(im,jm,lm) |
_RL u(im,jm,lm),v(im,jm,lm),t(im,jm,lm) |
59 |
real q(im,jm,lm,ntracer) |
_RL q(im,jm,lm,ntracer) |
60 |
real pl(im,jm,lm),ple(im,jm,lm+1),dpres(im,jm,lm),pkht(im,jm,lm) |
_RL pl(im,jm,lm),ple(im,jm,lm+1),dpres(im,jm,lm) |
61 |
real radswt(im,jm), fracland(im,jm), landtype(im,jm) |
_RL pkht(im,jm,lm+1) |
62 |
real phis_var(im,jm), sea_ice(im,jm) |
_RL pkl(im,jm,lm) |
63 |
real tcanopy(nchp),tdeep(nchp),ecanopy(nchp),swetshal(nchp) |
_RL surfz(im,jm) |
64 |
real swetroot(nchp),swetdeep(nchp),capac(nchp),snodep(nchp) |
_RL radswt(im,jm), fracland(im,jm) |
65 |
real ctmt(nchp),xxmt(nchp),yymt(nchp),zetamt(nchp) |
integer landtype(im,jm) |
66 |
real xlmt(nchp,lm),khmt(nchp,lm),tke(nchp,lm) |
_RL phis_var(im,jm), sea_ice(im,jm) |
67 |
real stratq(nwatlats,nwatlevs ) |
_RL chlat(nchp),chlon(nchp),chfr(nchp) |
68 |
real watlats(nwatlats) |
_RL tcanopy(nchp),tdeep(nchp),ecanopy(nchp),swetshal(nchp) |
69 |
real watlevs(nwatlevs) |
_RL swetroot(nchp),swetdeep(nchp),capac(nchp),snodep(nchp) |
70 |
real ozone(nozolats,nozolevs) |
_RL ctmt(nchp),xxmt(nchp),yymt(nchp),zetamt(nchp) |
71 |
real ozolevs(nozolevs),ozolats(nozlats) |
_RL xlmt(nchp,lm),khmt(nchp,lm),tke(nchp,lm) |
72 |
real co2,cfc11,cfc12,cfc22,methane(lm),n2o(lm) |
_RL co2,cfc11,cfc12,cfc22,methane(lm),n2o(lm) |
73 |
real lwdt(im,jm,lm),lwdtclr(im,jm,lm) |
_RL lwdt(im,jm,lm),lwdtclr(im,jm,lm) |
74 |
real swdt(im,jm,lm),swdtclr(im,jm,lm) |
_RL swdt(im,jm,lm),swdtclr(im,jm,lm) |
75 |
real turbu(im,jm,lm),turbv(im,jm,lm),turbt(im,jm,lm) |
_RL turbu(im,jm,lm),turbv(im,jm,lm),turbt(im,jm,lm) |
76 |
real turbq(im,jm,lm) |
_RL turbq(im,jm,lm,ntracer) |
77 |
real moistu(im,jm,lm),moistv(im,jm,lm),moistt(im,jm,lm) |
_RL moistu(im,jm,lm),moistv(im,jm,lm),moistt(im,jm,lm) |
78 |
real moistq(im,jm,lm) |
_RL moistq(im,jm,lm,ntracer) |
79 |
real chemo3(im,jm,lm),chemq(im,jm,lm) |
_RL chemo3(im,jm,lm),chemq(im,jm,lm) |
80 |
real albvisdr(im,jm),albvisdf(im,jm),albnirdr(im,jm) |
_RL albvisdr(im,jm),albvisdf(im,jm),albnirdr(im,jm) |
81 |
real albnirdf(im,jm),emiss(im,jm) |
_RL albnirdf(im,jm),emiss(im,jm,10) |
82 |
real alai(nchp),agrn(nchp) |
_RL alai(nchp),agrn(nchp) |
83 |
real radswg(im,jm),swgclr(im,jm) |
_RL radswg(im,jm),swgclr(im,jm) |
84 |
real fdirpar(im,jm),fdifpar(im,jm),osr(im,jm),osrclr(im,jm) |
_RL fdirpar(im,jm),fdifpar(im,jm),osr(im,jm),osrclr(im,jm) |
85 |
real tg0(im,jm),radlwg(im,jm),st4(im,jm),dst4(im,jm) |
_RL tg0(im,jm),radlwg(im,jm),lwgclr(im,jm),st4(im,jm) |
86 |
real dlwdtg(im,jm,lm) |
_RL dst4(im,jm) |
87 |
real rainlsp(im,jm),raincon(im,jm),snowfall(im,jm) |
_RL dlwdtg(im,jm,lm) |
88 |
real cldtot_lw(im,jm,lm),clras_lw(im,jm,lm),cldlsp_lw(im,jm,lm) |
_RL rainlsp(im,jm),raincon(im,jm),snowfall(im,jm) |
89 |
real lwlz(im,jm,lm) |
_RL cldtot_lw(im,jm,lm),cldras_lw(im,jm,lm) |
90 |
real cldtot_sw(im,jm,lm),clras_sw(im,jm,lm),cldlsp_sw(im,jm,lm) |
_RL cldlsp_lw(im,jm,lm) |
91 |
real swlz(im,jm,lm) |
_RL lwlz(im,jm,lm) |
92 |
real qliqavesw(im,jm,lm),qliqavelw(im,jm,lm) |
_RL cldtot_sw(im,jm,lm),cldras_sw(im,jm,lm) |
93 |
real fccavesw(im,jm,lm),fccavelw(im,jm,lm) |
_RL cldlsp_sw(im,jm,lm) |
94 |
real qq(im,jm,lm) |
_RL swlz(im,jm,lm) |
95 |
real tgz(im,jm) |
_RL qliqavesw(im,jm,lm),qliqavelw(im,jm,lm) |
96 |
|
_RL fccavesw(im,jm,lm),fccavelw(im,jm,lm) |
97 |
|
_RL qq(im,jm,lm) |
98 |
|
_RL tgz(im,jm) |
99 |
|
|
100 |
c Local Variables |
c Local Variables |
101 |
c --------------- |
c --------------- |
102 |
|
_RL rfu(im,jm,lm),rfv(im,jm,lm),rft(im,jm,lm) |
103 |
logical alarm |
logical alarm |
104 |
external alarm |
external alarm |
105 |
|
integer numpcheck |
106 |
|
parameter (numpcheck = 5) |
107 |
|
integer pchecklevs(numpcheck) |
108 |
|
_RL pcheckpress(numpcheck) |
109 |
|
C data pcheckpress/950.,750.,700.,400.,10./ |
110 |
|
data pcheckpress/950.,900.,700.,400.,150./ |
111 |
|
|
112 |
|
integer low_level,mid_level,nltop,nsubmin,nsubmax,Lup |
113 |
integer ndmoist,ndturb,ndlw,ndsw |
integer ndmoist,ndturb,ndlw,ndsw |
114 |
integer istrip,npcs |
integer istrip,npcs |
115 |
integer i,j,L,n |
integer i,j,L |
116 |
integer ndum,ndpnt |
integer ndum,ndpnt |
117 |
real dum,akap,getcon |
_RL akap,getcon |
118 |
real ptop |
_RL ptop |
119 |
logical lpnt |
logical lpnt,cumfric |
120 |
|
|
121 |
istrip = min( im*jm,71 ) |
istrip = im*jm |
122 |
npcs = ((im*jm-1)/istrip) + 1 |
npcs = 1 |
123 |
|
|
124 |
ptop = 0. |
ptop = 0. |
125 |
akap = getcon('KAPPA') |
akap = getcon('KAPPA') |
135 |
call get_alarm ( 'pnt',ndum,ndum,ndpnt,ndum ) |
call get_alarm ( 'pnt',ndum,ndum,ndpnt,ndum ) |
136 |
lpnt = ndpnt.ne.0 |
lpnt = ndpnt.ne.0 |
137 |
|
|
138 |
C Compute pl,ple,pkht,pkl,dpres and pcheck for use by mini-drivers |
C Fill array of model levels closest to a given pressure value |
139 |
|
|
140 |
C Make 'model theta' out of theta, ie, divide by p0**kappa |
call getpwhere(myid,numpcheck,pcheckpress,pchecklevs) |
141 |
|
|
142 |
|
low_level = pchecklevs(3) |
143 |
|
mid_level = pchecklevs(4) |
144 |
|
nltop = pchecklevs(5) |
145 |
|
nsubmin = pchecklevs(1) |
146 |
|
nsubmax = pchecklevs(2) |
147 |
|
Lup = pchecklevs(3) |
148 |
|
|
149 |
|
cumfric = .false. |
150 |
|
|
151 |
C ********************************************************************** |
C ********************************************************************** |
152 |
C **** Call Physics Mini-Drivers **** |
C **** Call Physics Mini-Drivers **** |
153 |
C ********************************************************************** |
C ********************************************************************** |
154 |
|
|
155 |
C SHORT WAVE RADIATION |
C SHORT WAVE RADIATION |
156 |
C ==================== |
C ==================== |
157 |
IF ( alarm('radsw') ) THEN |
IF ( alarm('radsw') ) THEN |
158 |
|
|
159 |
call swrio ( nymd,nhms,bi,bj,ndsw,myid,istrip,npcs, |
call swrio ( nymd,nhms,bi,bj,ndsw,myid,istrip,npcs, |
160 |
|
. low_level,mid_level,im,jm,lm, |
161 |
. p,pl,ple,dpres,pkht,pkl,t,chemq,chemo3,co2, |
. p,pl,ple,dpres,pkht,pkl,t,chemq,chemo3,co2, |
162 |
. albvisdr,albvisdf,albnirdr,albnirdf,swdt,swdtclr, |
. albvisdr,albvisdf,albnirdr,albnirdf,swdt,swdtclr, |
163 |
. radswg,swgclr,fdifpar,fdirpar,osr,osrclr,im,jm,lm, |
. radswg,swgclr,fdifpar,fdirpar,osr,osrclr, |
164 |
. ptop,nswcld,cldtot_sw,cldras_sw,nswlz,swlz, |
. ptop,nswcld,cldtot_sw,cldras_sw,nswlz,swlz, |
165 |
. .false.,imstturbsw,qliqavesw, |
. .false.,imstturbsw,qliqavesw, |
166 |
. fccavesw,landtype,xlats,xlons ) |
. fccavesw,landtype,xlats,xlons ) |
180 |
enddo |
enddo |
181 |
|
|
182 |
call lwrio ( nymd,nhms,bi,bj,istrip,npcs, |
call lwrio ( nymd,nhms,bi,bj,istrip,npcs, |
183 |
. p,pl,ple,dpres,pkht,pkl,t,chemq,pkht,chemo3,co2, |
. low_level,mid_level,im,jm,lm, |
184 |
|
. p,pl,ple,dpres,pkht,pkl,t,chemq,chemo3,co2, |
185 |
. cfc11,cfc12,cfc22,methane,n2o,emiss,tgz,radlwg,st4,dst4, |
. cfc11,cfc12,cfc22,methane,n2o,emiss,tgz,radlwg,st4,dst4, |
186 |
. lwdt,dlwdtg,lwdtclr,lwgclr,im,jm,lm,ptop, |
. lwdt,dlwdtg,lwdtclr,lwgclr, |
187 |
. nlwcld,cldtot_lw,cldras_lw,nlwlz,lwlz, |
. nlwcld,cldtot_lw,cldras_lw,nlwlz,lwlz, |
188 |
. .false.,imstturblw,qliqavelw, |
. .false.,imstturblw,qliqavelw, |
189 |
. fccavelw,landtype ) |
. fccavelw,landtype ) |
190 |
|
|
191 |
ENDIF |
ENDIF |
192 |
|
|
193 |
C TURBULENCE |
C TURBULENCE |
194 |
C ========== |
C ========== |
195 |
IF ( alarm('turb') ) THEN |
IF ( alarm('turb') ) THEN |
196 |
|
|
197 |
call turbio (im,jm,lm,1,nymd,nhms,bi,bj,ndturb, |
call turbio (im,jm,lm,istrip,nymd,nhms,bi,bj,ndturb,nltop, |
198 |
. ptop,p,u,v,t,q,ntracer,ptracer,pl,ple,dpres,pkht,pkl, |
. ptop,p,u,v,t,q,ntracer,ptracer,pl,ple,dpres,pkht,pkl, |
199 |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
200 |
. tgz,fracland,landtype, |
. tgz,fracland,landtype, |
201 |
. tcanopy,ecanopy,tdeep,swetshal,swetroot,swetdeep,snodep,capac, |
. tcanopy,ecanopy,tdeep,swetshal,swetroot,swetdeep,snodep,capac, |
202 |
. nchp,nchpland,chfr,chlt,chlon,igrd,ityp,alai,agrn,sea_ice,lpnt, |
. nchp,nchptot,nchpland,chfr,chlat,chlon,igrd,ityp, |
203 |
. turbu,turbv,turbt,turbq,radlwg,st4,dst4,radswg,radswt, |
. alai,agrn,sea_ice,lpnt, |
204 |
. fdifpar,fdirpar,rainlsp,rainconv,snowfall,tg0, |
. turbu,turbv,turbt,turbq,radlwg,st4,dst4,radswg,radswt, |
205 |
. imstturblw,imstturbsw,qliqavelw,qliqavesw,fccavelw,fccavesw,qq, |
. fdifpar,fdirpar,rainlsp,raincon,snowfall,tg0, |
206 |
. myid,comm ) |
. imstturblw,imstturbsw,qliqavelw,qliqavesw,fccavelw,fccavesw,qq, |
207 |
|
. myid) |
208 |
|
|
209 |
c Add Gravity-Wave Drag Tendency |
c Add Gravity-Wave Drag Tendency |
210 |
c ------------------------------ |
c ------------------------------ |
211 |
C Comment this out for now - run tropospheric resolutions only. |
C Comment this out for now |
212 |
C Need to see how to get zonal wavelengths on the cube. |
|
213 |
|
c call gwdrag (myid,p,pl,ple,dpres,pkl,u,v,t,q,phis_var, |
214 |
|
c . turbu,turbv,turbt,im,jm,lm,bi,bj,istrip,npcs,imglobal) |
215 |
|
|
216 |
c call gwdrag (myid,p,pl,ple,dpres,pkht,pkl,u,v,t,q,phis_var, |
c Add Rayleigh Friction Damping Above 70 Km |
217 |
c . turbu,turbv,turbt,im,jm,lm,ptop,istrip,npcs, |
c ----------------------------------------- |
218 |
c . imglobal) |
|
219 |
|
call rayleigh(myid,pl,pkl,pkht,surfz,u,v,t,q,im,jm,lm, |
220 |
|
. bi,bj,rfu,rfv,rft) |
221 |
|
C Now Add Rayleigh Friction Tendencies to Turb Tendency |
222 |
|
|
223 |
|
C do L=1,lm |
224 |
|
C do j=1,jm |
225 |
|
C do i=1,im |
226 |
|
C turbu(i,j,L) = turbu(i,j,L) + rfu(i,j,L) |
227 |
|
C turbv(i,j,L) = turbv(i,j,L) + rfv(i,j,L) |
228 |
|
C turbt(i,j,L) = turbt(i,j,L) + rft(i,j,L) |
229 |
|
C enddo |
230 |
|
C enddo |
231 |
|
C enddo |
232 |
|
|
233 |
endif |
endif |
234 |
|
|
236 |
C =============== |
C =============== |
237 |
if ( alarm('moist') ) then |
if ( alarm('moist') ) then |
238 |
call moistio (ndmoist,istrip,npcs, |
call moistio (ndmoist,istrip,npcs, |
239 |
. p,pl,ple,dpres,pkht,pkl,t,q,bi,bj,ntracer,ptracer,qq, |
. low_level,mid_level,nltop,nsubmin,nsubmax,Lup, |
240 |
. moistu,moistv,moistt,moistq,im,jm,lm,ptop,iras, |
. p,pl,ple,dpres,pkht,pkl,u,v,t,q,bi,bj,ntracer,ptracer,qq, |
241 |
. rainlsp,rainconv,snowfall, |
. moistu,moistv,moistt,moistq,cumfric,im,jm,lm,ptop,iras, |
242 |
|
. rainlsp,raincon,snowfall, |
243 |
. nswcld,cldtot_sw,cldras_sw,cldlsp_sw,nswlz,swlz, |
. nswcld,cldtot_sw,cldras_sw,cldlsp_sw,nswlz,swlz, |
244 |
. nlwcld,cldtot_lw,cldras_lw,cldlsp_lw,nlwlz,lwlz, |
. nlwcld,cldtot_lw,cldras_lw,cldlsp_lw,nlwlz,lwlz, |
245 |
. .false.,myid) |
. .false.,myid) |
|
|
|
246 |
endif |
endif |
247 |
|
|
248 |
return |
return |