1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
#include "FIZHI_OPTIONS.h" |
5 |
subroutine fizhi_init_vars (myThid) |
subroutine fizhi_init_vars (myThid) |
6 |
c----------------------------------------------------------------------- |
c----------------------------------------------------------------------- |
7 |
c Routine to initialise the fizhi state. |
c Routine to initialise the fizhi state. |
21 |
c Calls: dyn2phys (x4) |
c Calls: dyn2phys (x4) |
22 |
c----------------------------------------------------------------------- |
c----------------------------------------------------------------------- |
23 |
implicit none |
implicit none |
|
#include "CPP_OPTIONS.h" |
|
24 |
#include "SIZE.h" |
#include "SIZE.h" |
25 |
#include "fizhi_SIZE.h" |
#include "fizhi_SIZE.h" |
26 |
#include "fizhi_land_SIZE.h" |
#include "fizhi_land_SIZE.h" |
29 |
#include "gridalt_mapping.h" |
#include "gridalt_mapping.h" |
30 |
#include "fizhi_coms.h" |
#include "fizhi_coms.h" |
31 |
#include "fizhi_land_coms.h" |
#include "fizhi_land_coms.h" |
32 |
|
#include "fizhi_earth_coms.h" |
33 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
34 |
#include "SURFACE.h" |
#include "SURFACE.h" |
35 |
#include "PARAMS.h" |
#include "PARAMS.h" |
36 |
|
#include "chronos.h" |
37 |
|
|
38 |
integer myThid |
integer myThid |
39 |
|
|
43 |
_RL windphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) |
_RL windphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) |
44 |
_RL udyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL udyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
45 |
_RL vdyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
_RL vdyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
46 |
|
_RL tempphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) |
47 |
|
|
48 |
integer i, j, L, bi, bj, Lbotij |
integer i, j, L, bi, bj, Lbotij |
49 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
57 |
jdim1 = 1 |
jdim1 = 1 |
58 |
jdim2 = sNy |
jdim2 = sNy |
59 |
|
|
60 |
|
C First Check to see if we can start a fizhi experiment at current time |
61 |
|
C All Fizhi alarms must be on for the first time step of a segment |
62 |
|
|
63 |
|
if( .not.alarm('moist') .or. .not.alarm('turb') .or. |
64 |
|
. .not.alarm('radsw') .or. .not.alarm('radlw') ) then |
65 |
|
print *,' Cant Start Fizhi experiment at ',nymd,' ',nhms |
66 |
|
stop |
67 |
|
endif |
68 |
|
|
69 |
|
C Deal Here with Variables that are on a Fizhi Pickup or need Initialization |
70 |
|
|
71 |
IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN |
IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN |
72 |
print *,' In fizhi_init_vars: Cold start ' |
print *,' In fizhi_init_vars: Beginning of New Experiment ' |
73 |
|
|
74 |
do bj = myByLo(myThid), myByHi(myThid) |
do bj = myByLo(myThid), myByHi(myThid) |
75 |
do bi = myBxLo(myThid), myBxHi(myThid) |
do bi = myBxLo(myThid), myBxHi(myThid) |
138 |
|
|
139 |
c Create initial fields on phys. grid - interpolate from dyn. grid |
c Create initial fields on phys. grid - interpolate from dyn. grid |
140 |
call dyn2phys(udyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
call dyn2phys(udyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
141 |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,uphy) |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,tempphy) |
142 |
|
c Note: Interpolation gives bottom-up arrays (level 1 is bottom), |
143 |
|
c Physics works top-down. so -> need to flip arrays |
144 |
|
do L = 1,Nrphys |
145 |
|
do j = 1,sNy |
146 |
|
do i = 1,sNx |
147 |
|
uphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj) |
148 |
|
enddo |
149 |
|
enddo |
150 |
|
enddo |
151 |
call dyn2phys(vdyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
call dyn2phys(vdyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
152 |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,vphy) |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,tempphy) |
153 |
|
do L = 1,Nrphys |
154 |
|
do j = 1,sNy |
155 |
|
do i = 1,sNx |
156 |
|
vphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj) |
157 |
|
enddo |
158 |
|
enddo |
159 |
|
enddo |
160 |
call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
161 |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,thphy) |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) |
162 |
|
do L = 1,Nrphys |
163 |
|
do j = 1,sNy |
164 |
|
do i = 1,sNx |
165 |
|
thphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj) |
166 |
|
enddo |
167 |
|
enddo |
168 |
|
enddo |
169 |
|
|
170 |
call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
171 |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,sphy) |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) |
172 |
|
do L = 1,Nrphys |
173 |
|
do j = 1,sNy |
174 |
|
do i = 1,sNx |
175 |
|
sphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj) |
176 |
|
enddo |
177 |
|
enddo |
178 |
|
enddo |
179 |
|
|
180 |
c Now initialize tke, xlmt, khmt, xxmt, yymt, ctmt, zetamt, |
c Zero out fizhi tendency arrays on the fizhi grid |
181 |
c Now initialize land state too - tcanopy, etc... |
do L = 1,Nrphys |
182 |
do L = 1,Nrphys |
do j = 1,sNy |
183 |
do i = 1,nchp |
do i = 1,sNx |
184 |
tke(i,L,bi,bj) = 0. |
duphy(i,j,L,bi,bj) = 0. |
185 |
xlmt(i,L,bi,bj) = 0. |
dvphy(i,j,L,bi,bj) = 0. |
186 |
khmt(i,L,bi,bj) = 0. |
dthphy(i,j,L,bi,bj) = 0. |
187 |
|
dsphy(i,j,L,bi,bj) = 0. |
188 |
enddo |
enddo |
189 |
enddo |
enddo |
190 |
c Now initialize land state too - tcanopy, etc... ZERO FOR NOW, |
enddo |
191 |
|
|
192 |
|
c Zero out fizhi tendency arrays on the dynamics grid |
193 |
|
do L = 1,Nr |
194 |
|
do j = jm1,jm2 |
195 |
|
do i = im1,im2 |
196 |
|
guphy(i,j,L,bi,bj) = 0. |
197 |
|
gvphy(i,j,L,bi,bj) = 0. |
198 |
|
gthphy(i,j,L,bi,bj) = 0. |
199 |
|
gsphy(i,j,L,bi,bj) = 0. |
200 |
|
enddo |
201 |
|
enddo |
202 |
|
enddo |
203 |
|
|
204 |
|
c Initialize tke, xlmt, khmt, xxmt, yymt, ctmt, zetamt, |
205 |
|
if( (nhms.eq.nhms0) .and. (nymd.eq.nymd0) ) then |
206 |
|
print *,' Cold Start: Zero out Turb second moments ' |
207 |
|
do i = 1,nchp |
208 |
|
ctmt(i,bi,bj) = 0. |
209 |
|
xxmt(i,bi,bj) = 0. |
210 |
|
yymt(i,bi,bj) = 0. |
211 |
|
zetamt(i,bi,bj) = 0. |
212 |
|
enddo |
213 |
|
do L = 1,Nrphys |
214 |
|
do i = 1,nchp |
215 |
|
tke(i,L,bi,bj) = 0. |
216 |
|
xlmt(i,L,bi,bj) = 0. |
217 |
|
khmt(i,L,bi,bj) = 0. |
218 |
|
enddo |
219 |
|
enddo |
220 |
|
else |
221 |
|
print *,' Need initial Values for TKE - dont have them! ' |
222 |
|
stop |
223 |
|
endif |
224 |
|
|
225 |
|
c Now initialize land state too - tcanopy, etc... SET FOR NOW, |
226 |
c READ CLIM FOR REAL |
c READ CLIM FOR REAL |
227 |
do i = 1,nchp |
do i = 1,nchp |
228 |
tcanopy(i) = 0. |
tcanopy(i,bi,bj) = 283. |
229 |
tdeep(i) = 0. |
tdeep(i,bi,bj) = 282.5 |
230 |
ecanopy(i) = 0. |
ecanopy(i,bi,bj) = 2.e-2 |
231 |
swetshal(i) = 0. |
swetshal(i,bi,bj) = 0.6 |
232 |
swetroot(i) = 0. |
swetroot(i,bi,bj) = 0.5 |
233 |
swetdeep(i) = 0. |
swetdeep(i,bi,bj) = 0.5 |
234 |
capac(i) = 0. |
capac(i,bi,bj) = 0. |
235 |
snodep(i) = 0. |
snodep(i,bi,bj) = 0. |
236 |
enddo |
enddo |
237 |
|
|
238 |
|
print *,' Initialize fizhi arrays that will be on pickup ' |
239 |
|
imstturblw(bi,bj) = 0 |
240 |
|
imstturbsw(bi,bj) = 0 |
241 |
|
iras(bi,bj) = 0 |
242 |
|
nlwcld(bi,bj) = 0 |
243 |
|
nlwlz(bi,bj) = 0 |
244 |
|
nswcld(bi,bj) = 0 |
245 |
|
nswlz(bi,bj) = 0 |
246 |
|
do L = 1,Nrphys |
247 |
|
do j = 1,sNy |
248 |
|
do i = 1,sNx |
249 |
|
swlz(i,j,L,bi,bj) = 0. |
250 |
|
lwlz(i,j,L,bi,bj) = 0. |
251 |
|
qliqavesw(i,j,L,bi,bj) = 0. |
252 |
|
qliqavelw(i,j,L,bi,bj) = 0. |
253 |
|
fccavesw(i,j,L,bi,bj) = 0. |
254 |
|
fccavelw(i,j,L,bi,bj) = 0. |
255 |
|
cldtot_sw(i,j,L,bi,bj) = 0. |
256 |
|
cldras_sw(i,j,L,bi,bj) = 0. |
257 |
|
cldlsp_sw(i,j,L,bi,bj) = 0. |
258 |
|
cldtot_lw(i,j,L,bi,bj) = 0. |
259 |
|
cldras_lw(i,j,L,bi,bj) = 0. |
260 |
|
cldlsp_lw(i,j,L,bi,bj) = 0. |
261 |
|
enddo |
262 |
|
enddo |
263 |
|
enddo |
264 |
|
do j = 1,sNy |
265 |
|
do i = 1,sNx |
266 |
|
rainlsp(i,j,bi,bj) = 0. |
267 |
|
raincon(i,j,bi,bj) = 0. |
268 |
|
snowfall(i,j,bi,bj) = 0. |
269 |
|
enddo |
270 |
|
enddo |
271 |
|
|
272 |
enddo |
enddo |
273 |
enddo |
enddo |
276 |
print *,' In fizhi_init_vars: Read from restart ' |
print *,' In fizhi_init_vars: Read from restart ' |
277 |
|
|
278 |
C-- Read fizhi package state variables from pickup file |
C-- Read fizhi package state variables from pickup file |
279 |
call fizhi_read_pickup( nIter0, myThid ) |
|
280 |
|
call fizhi_read_pickup( nIter0, myThid ) |
281 |
|
CALL FIZHI_READ_VEGTILES( nIter0, 'D', myThid ) |
282 |
|
|
283 |
ENDIF |
ENDIF |
284 |
|
|
285 |
return |
return |