1 |
molod |
1.12 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/do_fizhi.F,v 1.11 2004/06/16 20:23:55 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.8 |
. ctmt,xxmt,yymt,zetamt,xlmt,khmt,tke, |
6 |
molod |
1.11 |
. tgz,sice,phis_var,landtype,fracland,emiss,albnidr,albnirdf, |
7 |
molod |
1.8 |
. 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,Nrphys,Nsx,Nsy,im1,im2,jm1,jm2,bi,bj, |
11 |
molod |
1.10 |
. nchp,nchpland, |
12 |
molod |
1.8 |
. 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.1 |
|
25 |
molod |
1.10 |
C Argument list declarations |
26 |
|
|
integer myid,im1,im2,jm1,jm2,idim1,idim2,jdim1,jdim2 |
27 |
|
|
integer Nrphys,Nsx,Nsy,bi,bj,nchp,nchpland, |
28 |
molod |
1.7 |
_RL uphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
29 |
|
|
_RL vphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
30 |
|
|
_RL thphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
31 |
|
|
_RL sphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
32 |
|
|
_RL pephy(idim1:idim2,jdim1:jdim2,Nrphys+1,Nsx,Nsy) |
33 |
|
|
_RL lons(idim1:idim2,jdim1:jdim2,Nsx,Nsy) |
34 |
|
|
_RL lats(idim1:idim2,jdim1:jdim2,Nsx,Nsy) |
35 |
molod |
1.5 |
_RL ctmt(nchp,Nsx,Nsy),xxmt(nchp,Nsx,Nsy),yymt(nchp,Nsx,Nsy) |
36 |
|
|
_RL zetamt(nchp,Nsx,Nsy) |
37 |
|
|
_RL xlmt(nchp,Nrphys,Nsx,Nsy),khmt(nchp,Nrphys,Nsx,Nsy) |
38 |
|
|
_RL tke(nchp,Nrphys,Nsx,Nsy) |
39 |
molod |
1.12 |
_RL tgz(im2,jm2,Nsx,Nsy) |
40 |
molod |
1.10 |
_RL sice(idim1:idim2,jdim1:jdim2,Nsx,Nsy) |
41 |
|
|
_RL phis_var(im2,jm2,Nsx,Nsy),landtype(im2,jm2,Nsx,Nsy) |
42 |
|
|
_RL fracland(im2,jm2,Nsx,Nsy),emiss(im2,jm2,10,Nsx,Nsy) |
43 |
|
|
_RL albvisdr(im2,jm2,Nsx,Nsy),albvisdf(im2,jm2,Nsx,Nsy) |
44 |
|
|
_RL albnirdr(im2,jm2,Nsx,Nsy),albnirdf(im2,jm2,Nsx,Nsy) |
45 |
|
|
_RL chfr(nchp,Nsx,Nsy),alai(nchp,Nsx,Nsy),agrn(nchp,Nsx,Nsy) |
46 |
|
|
integer ityp(nchp,Nsx,Nsy),igrd(nchp,Nsx,Nsy) |
47 |
|
|
_RL chlat(nchp,Nsx,Nsy),chlon(nchp,Nsx,Nsy) |
48 |
|
|
_RL tcanopy(nchp,Nsx,Nsy),tdeep(nchp,Nsx,Nsy) |
49 |
|
|
_RL ecanopy(nchp,Nsx,Nsy),swetshal(nchp,Nsx,Nsy) |
50 |
|
|
_RL swetroot(nchp,Nsx,Nsy),swetdeep(nchp,Nsx,Nsy) |
51 |
|
|
_RL snodep(nchp,Nsx,Nsy),capac(nchp,Nsx,Nsy), |
52 |
|
|
_RL o3(im2,jm2,Nsx,Nsy),qstr(im2,jm2,Nsx,Nsy) |
53 |
|
|
_RL co2,cfc11,cfc12,cfc22,n2o(Nrphys),methane(Nrphys) |
54 |
molod |
1.7 |
_RL duphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
55 |
|
|
_RL dvphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
56 |
|
|
_RL dthphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
57 |
|
|
_RL dsphy(idim1:idim2,jdim1:jdim2,Nrphys,Nsx,Nsy) |
58 |
molod |
1.1 |
c |
59 |
molod |
1.10 |
integer ptracer,ntracer |
60 |
|
|
integer iras,nlwcld,nlwlz,nswcld,nswlz |
61 |
|
|
integer imstturbsw,imstturblw |
62 |
|
|
|
63 |
|
|
real xlats(im2,jm2), xlons(im2,jm2), sea_ice(im2,jm2), p(im2,jm2) |
64 |
|
|
real u(im2,jm2,Nrphys), v(im2,jm2,Nrphys), t(im2,jm2,Nrphys) |
65 |
|
|
real q(im2,jm2,Nrphys,ntracer) |
66 |
|
|
real pl(im2,jm2,Nrphys),ple(im2,jm2,Nrphys+1) |
67 |
|
|
real dpres(im2,jm2,Nrphys),pkht(im2,jm2,Nrphys) |
68 |
|
|
real lwdt(im2,jm2,Nrphys),lwdtclr(im2,jm2,Nrphys) |
69 |
|
|
real swdt(im2,jm2,Nrphys),swdtclr(im2,jm2,Nrphys) |
70 |
|
|
real turbu(im2,jm2,Nrphys),turbv(im2,jm2,Nrphys) |
71 |
|
|
real turbt(im2,jm2,Nrphys),turbq(im2,jm2,Nrphys) |
72 |
|
|
real moistu(im2,jm2,Nrphys),moistv(im2,jm2,Nrphys) |
73 |
|
|
real moistt(im2,jm2,Nrphys),moistq(im2,jm2,Nrphys) |
74 |
|
|
real radswt(im2,jm2),radswg(im2,jm2),swgclr(im2,jm2) |
75 |
|
|
real albedo(im2,jm2),fdirpar(im2,jm2),fdifpar(im2,jm2) |
76 |
|
|
real osr(im2,jm2),osrclr(im2,jm2) |
77 |
molod |
1.12 |
real tg0(im2,jm2),radlwg(im2,jm2),st4(im2,jm2) |
78 |
|
|
real dst4(im2,jm2),dlwdtg(im2,jm2,Nrphys) |
79 |
molod |
1.10 |
real rainlsp(im2,jm2),raincon(im2,jm2),snowfall(im2,jm2) |
80 |
|
|
real cldtot_lw(im2,jm2,Nrphys),clras_lw(im2,jm2,Nrphys) |
81 |
|
|
real cldlsp_lw(im2,jm2,Nrphys),lwlz(im2,jm2,Nrphys) |
82 |
|
|
real cldtot_sw(im2,jm2,Nrphys),clras_sw(im2,jm2,Nrphys) |
83 |
|
|
real cldlsp_sw(im2,jm2,Nrphys),swlz(im2,jm2,Nrphys) |
84 |
|
|
real qliqavesw(im2,jm2,Nrphys),qliqavelw(im2,jm2,Nrphys) |
85 |
|
|
real fccavesw(im2,jm2,Nrphys),fccavelw(im2,jm2,Nrphys) |
86 |
|
|
real qq(im2,jm2,Nrphys) |
87 |
|
|
real u2m(im2,jm2),v2m(im2,jm2),t2m(im2,jm2),q2m(im2,jm2) |
88 |
|
|
real u10m(im2,jm2),v10m(im2,jm2),t10m(im2,jm2),q10m(im2,jm2) |
89 |
|
|
real gwet(im2,jm2),snow(im2,jm2) |
90 |
|
|
|
91 |
molod |
1.5 |
integer i,j,L |
92 |
molod |
1.12 |
real getcon, kappa, p0kappa, s0, ra |
93 |
|
|
real cosz(im2,jm2) |
94 |
molod |
1.11 |
|
95 |
|
|
C*********************************************************************** |
96 |
|
|
C Unshadow input arrays (and make 'fizhi theta' from true theta) |
97 |
|
|
C*********************************************************************** |
98 |
|
|
|
99 |
|
|
kappa = getcon('KAPPA') |
100 |
|
|
p0kappa = 1000.0 ** kappa |
101 |
molod |
1.12 |
S0 = getcon('S0') |
102 |
molod |
1.11 |
|
103 |
|
|
do L = 1,Nrphys |
104 |
|
|
do j = jm1,jm2 |
105 |
|
|
do i = im1,im2 |
106 |
|
|
u(i,j,L) = uphys(i,j,L,bi,bj) |
107 |
|
|
v(i,j,L) = vphys(i,j,L,bi,bj) |
108 |
molod |
1.12 |
t(i,j,L) = thphys(i,j,L,bi,bj)/p0kappa |
109 |
molod |
1.11 |
q(i,j,L,1) = sphys(i,j,L,bi,bj) |
110 |
|
|
enddo |
111 |
|
|
enddo |
112 |
|
|
enddo |
113 |
|
|
do j = jm1,jm2 |
114 |
|
|
do i = im1,im2 |
115 |
|
|
p(i,j) = pephys(i,j,Nrphys+1,bi,bj) |
116 |
|
|
xlats(i,j) = lats(i,j,bi,bj) |
117 |
|
|
xlons(i,j) = lons(i,j,bi,bj) |
118 |
|
|
sea_ice(i,j) = sice(i,j,bi,bj) |
119 |
|
|
enddo |
120 |
|
|
enddo |
121 |
|
|
|
122 |
molod |
1.12 |
call astro ( nymd,nhms, xlats,xlons, im2*jm2, cosz,ra ) |
123 |
|
|
do j=jm1,jm2 |
124 |
|
|
do i=im1,im2 |
125 |
|
|
radswt(i,j) = S0*(1.0/ra**2)*cosz(i,j) |
126 |
|
|
enddo |
127 |
|
|
enddo |
128 |
|
|
|
129 |
|
|
|
130 |
molod |
1.11 |
ptracer = 1 |
131 |
|
|
ntracer = 1 |
132 |
molod |
1.1 |
|
133 |
molod |
1.10 |
call fizhi_driver(myid,im2,jm2,Nrphys,ptracer,ntracer,xlats,xlons, |
134 |
molod |
1.12 |
. p,u,v,t,q,pl,ple,dpres,pkht,pkl,fracland(1,1,bi,bj), |
135 |
|
|
. landtype(1,1,bi,bj),radswt, |
136 |
|
|
. phis_var(1,1,bi,bj),tgz(1,1,bi,bj),sea_ice, |
137 |
|
|
. nchp,chlat(1,bi,bj),chlon(1,bi,bj),igrd(1,bi,bj),nchpland, |
138 |
|
|
. chfr(1,bi,bj),ityp(1,bi,bj), |
139 |
|
|
. tcanopy(1,bi,bj),tdeep(1,bi,bj),ecanopy(1,bi,bj), |
140 |
|
|
. swetshal(1,bi,bj),swetroot(1,bi,bj),swetdeep(1,bi,bj), |
141 |
|
|
. capac(1,bi,bj),snodep(1,bi,bj), |
142 |
|
|
. ctmt(1,bi,bj),xxmt(1,bi,bj),yymt(1,bi,bj),zetamt(1,bi,bj), |
143 |
|
|
. xlmt(1,1,bi,bj),khmt(1,1,bi,bj),tke(1,1,bi,bj), |
144 |
|
|
. albvisdr(1,bi,bj),albvisdf(1,bi,bj),albnirdr(1,bi,bj), |
145 |
|
|
. albnirdf(1,bi,bj),emiss(1,bi,bj),alai(1,bi,bj),agrn(1,bi,bj), |
146 |
|
|
. qstr(1,1,bi,bj),o3(1,1,bi,bj),co2,cfc11,cfc12,cfc22,methane,n2o, |
147 |
molod |
1.5 |
. lwdt,lwdtclr,swdt,swdtclr,turbu,turbv,turbt,turbq, |
148 |
|
|
. moistu,moistv,moistt,moistq, |
149 |
molod |
1.12 |
. radswg,swgclr,albedo,fdirpar,fdifpar,osr,osrclr,tg0,radlwg, |
150 |
|
|
. st4,dst4,dlwdtg,rainlsp,raincon,snowfall,iras,nlwcld, |
151 |
molod |
1.5 |
. cldtot_lw,clras_lw,cldlsp_lw,nlwlz,lwlz,nswcld,cldtot_sw, |
152 |
|
|
. clras_sw,cldlsp_sw,nswlz,swlz,imstturbsw,imstturblw,qliqavesw, |
153 |
|
|
. qliqavelw,fccavesw,fccavelw,qq,u2m,v2m,t2m,q2m,u10m,v10m,t10m, |
154 |
molod |
1.10 |
. q10m,gwet,snow) |
155 |
molod |
1.12 |
|
156 |
|
|
do L = 1,Nrphys |
157 |
|
|
do j = jm1,jm2 |
158 |
|
|
do i = im1,im2 |
159 |
|
|
duphys(i,j,L,bi,bj) = moistu(i,j,L) + turbu(i,j,L) |
160 |
|
|
dvphys(i,j,L,bi,bj) = moistv(i,j,L) + turbv(i,j,L) |
161 |
|
|
dthphys(i,j,L,bi,bj) = ( ( moistt(i,j,L) + turbt(i,j,L) + |
162 |
|
|
. lwdt(i,j,L) + dlwdtg(i,j,L) * (tgz(i,j)-tg0(i,j)) + |
163 |
|
|
. swdt(i,j,L) * radswt(i,j) ) * p0kappa ) / p(i,j) |
164 |
|
|
dsphys(i,j,L,bi,bj) = (moistq(i,j,L,1) + turbq(i,j,L,1))/p(i,j) |
165 |
|
|
enddo |
166 |
|
|
enddo |
167 |
|
|
enddo |
168 |
molod |
1.5 |
|
169 |
|
|
return |
170 |
|
|
end |