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. |
8 |
c |
c |
9 |
c Input: myThid - Process number calling this routine |
c Input: myThid - Process number calling this routine |
10 |
c |
c |
11 |
c Notes: |
c Notes: |
12 |
c 1) For a Cold Start - |
c 1) For a Cold Start - |
13 |
c This routine takes the initial condition on the dynamics grid |
c This routine takes the initial condition on the dynamics grid |
14 |
c and interpolates to the physics grid to initialize the state |
c and interpolates to the physics grid to initialize the state |
15 |
c variables that are on both grids. It initializes the variables |
c variables that are on both grids. It initializes the variables |
34 |
#include "SURFACE.h" |
#include "SURFACE.h" |
35 |
#include "PARAMS.h" |
#include "PARAMS.h" |
36 |
#include "chronos.h" |
#include "chronos.h" |
37 |
|
#ifdef ALLOW_EXCH2 |
38 |
|
#include "W2_EXCH2_TOPOLOGY.h" |
39 |
|
#include "W2_EXCH2_PARAMS.h" |
40 |
|
#endif /* ALLOW_EXCH2 */ |
41 |
|
|
42 |
integer myThid |
integer myThid |
43 |
|
|
44 |
|
INTEGER xySize |
45 |
|
#if defined(ALLOW_EXCH2) |
46 |
|
PARAMETER ( xySize = W2_ioBufferSize ) |
47 |
|
#else |
48 |
|
PARAMETER ( xySize = Nx*Ny ) |
49 |
|
#endif |
50 |
|
Real*8 globalArr( xySize*8 ) |
51 |
|
|
52 |
c pe on dynamics and physics grid refers to bottom edge |
c pe on dynamics and physics grid refers to bottom edge |
53 |
_RL pephy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys+1,nSx,nSy) |
_RL pephy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys+1,nSx,nSy) |
54 |
_RL pedyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr+1,nSx,nSy) |
_RL pedyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr+1,nSx,nSy) |
59 |
|
|
60 |
integer i, j, L, bi, bj, Lbotij |
integer i, j, L, bi, bj, Lbotij |
61 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
62 |
|
integer xsize, ysize |
63 |
logical alarm |
logical alarm |
64 |
external alarm |
external alarm |
65 |
|
|
66 |
|
#if defined(ALLOW_EXCH2) |
67 |
|
xsize = exch2_global_Nx |
68 |
|
ysize = exch2_global_Ny |
69 |
|
#else |
70 |
|
xsize = Nx |
71 |
|
ysize = Ny |
72 |
|
#endif |
73 |
im1 = 1-OLx |
im1 = 1-OLx |
74 |
im2 = sNx+OLx |
im2 = sNx+OLx |
75 |
jm1 = 1-OLy |
jm1 = 1-OLy |
84 |
|
|
85 |
if( .not.alarm('moist') .or. .not.alarm('turb') .or. |
if( .not.alarm('moist') .or. .not.alarm('turb') .or. |
86 |
. .not.alarm('radsw') .or. .not.alarm('radlw') ) then |
. .not.alarm('radsw') .or. .not.alarm('radlw') ) then |
87 |
print *,' Cant Start Fizhi experiment at ',nymd,' ',nhms |
write(15,*) ' Cant Start Fizhi experiment at ',nymd,' ',nhms |
88 |
stop |
stop |
89 |
endif |
endif |
90 |
|
|
91 |
C Deal Here with Variables that are on a Fizhi Pickup or need Initialization |
C Deal Here with Variables that are on a Fizhi Pickup or need Initialization |
92 |
|
|
93 |
IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN |
IF ( startTime.EQ.baseTime .AND. nIter0.EQ.0 ) THEN |
94 |
print *,' In fizhi_init_vars: Beginning of New Experiment ' |
print *,' In fizhi_init_vars: Beginning of New Experiment ' |
95 |
|
|
96 |
do bj = myByLo(myThid), myByHi(myThid) |
do bj = myByLo(myThid), myByHi(myThid) |
107 |
do j = 1,sNy |
do j = 1,sNy |
108 |
do i = 1,sNx |
do i = 1,sNx |
109 |
Lbotij = ksurfC(i,j,bi,bj) |
Lbotij = ksurfC(i,j,bi,bj) |
110 |
if(Lbotij.ne.0.) |
if(Lbotij.ne.0.) |
111 |
. pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj) |
. pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj) |
112 |
enddo |
enddo |
113 |
enddo |
enddo |
150 |
|
|
151 |
enddo |
enddo |
152 |
enddo |
enddo |
153 |
|
|
154 |
c Create initial fields on phys. grid - Move Dynamics u and v to A-Grid |
c Create initial fields on phys. grid - Move Dynamics u and v to A-Grid |
155 |
call CtoA(myThid,uvel,vvel,maskW,maskS,im1,im2,jm1,jm2,Nr, |
call CtoA(myThid,uvel,vvel,maskW,maskS,im1,im2,jm1,jm2,Nr, |
156 |
. Nsx,Nsy,1,sNx,1,sNy,udyntemp,vdyntemp) |
. Nsx,Nsy,1,sNx,1,sNy,udyntemp,vdyntemp) |
180 |
enddo |
enddo |
181 |
enddo |
enddo |
182 |
call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
183 |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,2,tempphy) |
184 |
do L = 1,Nrphys |
do L = 1,Nrphys |
185 |
do j = 1,sNy |
do j = 1,sNy |
186 |
do i = 1,sNx |
do i = 1,sNx |
188 |
enddo |
enddo |
189 |
enddo |
enddo |
190 |
enddo |
enddo |
|
|
|
191 |
call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
192 |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) |
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy) |
193 |
do L = 1,Nrphys |
do L = 1,Nrphys |
222 |
enddo |
enddo |
223 |
enddo |
enddo |
224 |
|
|
225 |
c Initialize tke, xlmt, khmt, xxmt, yymt, ctmt, zetamt, |
c Initialize vegetation tile tke, xlmt, khmt, xxmt, yymt, ctmt, zetamt, |
226 |
if( (nhms.eq.nhms0) .and. (nymd.eq.nymd0) ) then |
if( (nhms.eq.nhms0) .and. (nymd.eq.nymd0) ) then |
227 |
print *,' Cold Start: Zero out Turb second moments ' |
print *,' Cold Start: Zero out Turb second moments ' |
228 |
do i = 1,nchp |
do i = 1,nchp |
243 |
stop |
stop |
244 |
endif |
endif |
245 |
|
|
246 |
c Now initialize land state too - tcanopy, etc... SET FOR NOW, |
c Now initialize vegetation tile land state too - tcanopy, etc... |
247 |
c READ CLIM FOR REAL |
call fizhi_init_vegsurftiles( globalArr, xsize, ysize, |
248 |
do i = 1,nchp |
& nymd,nhms, 'D', myThid ) |
|
tcanopy(i,bi,bj) = 283. |
|
|
tdeep(i,bi,bj) = 282.5 |
|
|
ecanopy(i,bi,bj) = 2.e-2 |
|
|
swetshal(i,bi,bj) = 0.6 |
|
|
swetroot(i,bi,bj) = 0.5 |
|
|
swetdeep(i,bi,bj) = 0.5 |
|
|
capac(i,bi,bj) = 0. |
|
|
snodep(i,bi,bj) = 0. |
|
|
enddo |
|
249 |
|
|
250 |
|
c Now initialize fizhi arrays that will be on a pickup |
251 |
print *,' Initialize fizhi arrays that will be on pickup ' |
print *,' Initialize fizhi arrays that will be on pickup ' |
252 |
imstturblw(bi,bj) = 0 |
imstturblw(bi,bj) = 0 |
253 |
imstturbsw(bi,bj) = 0 |
imstturbsw(bi,bj) = 0 |
287 |
|
|
288 |
ELSE |
ELSE |
289 |
print *,' In fizhi_init_vars: Read from restart ' |
print *,' In fizhi_init_vars: Read from restart ' |
290 |
|
|
291 |
C-- Read fizhi package state variables from pickup file |
C-- Read fizhi package state variables from pickup file |
292 |
|
|
293 |
call fizhi_read_pickup( nIter0, myThid ) |
call fizhi_read_pickup( nIter0, myThid ) |