44 |
integer bislot,bjslot,iunit |
integer bislot,bjslot,iunit |
45 |
integer recl |
integer recl |
46 |
integer bi,bj,fileprec |
integer bi,bj,fileprec |
47 |
Real*8 globalarr(Nx,Ny,8) |
integer xsize, ysize |
48 |
|
#if defined(ALLOW_EXCH2) |
49 |
|
PARAMETER ( xsize = exch2_domain_nxt * sNx ) |
50 |
|
PARAMETER ( ysize = exch2_domain_nyt * sNy ) |
51 |
|
#else |
52 |
|
PARAMETER ( xsize = Nx ) |
53 |
|
PARAMETER ( ysize = Ny ) |
54 |
|
#endif |
55 |
|
Real*8 globalarr(xsize,ysize,8) |
56 |
_RL tempgrid(sNx,sNy) |
_RL tempgrid(sNx,sNy) |
57 |
_RL temptile(nchp) |
_RL temptile(nchp) |
58 |
|
_RL fracland(sNx,sNy,Nsx,Nsy) |
59 |
|
|
60 |
ihour = nhms/10000 |
ihour = nhms/10000 |
61 |
|
if(xsize.eq.192) then |
62 |
WRITE(fn,'(a,I8,a,I2.2,a)')'vegtiles_cs32.d',nymd,'z',ihour,'.bin' |
WRITE(fn,'(a,I8,a,I2.2,a)')'vegtiles_cs32.d',nymd,'z',ihour,'.bin' |
63 |
|
elseif(xsize.eq.612) then |
64 |
|
WRITE(fn,'(a,I8,a,I2.2,a)')'vegtiles_cs102.d',nymd,'z',ihour,'.bin' |
65 |
|
else |
66 |
|
print *,' xsize is ',xsize |
67 |
|
stop 'do not seem to have correct vegtiles data ' |
68 |
|
endif |
69 |
fileprec = 64 |
fileprec = 64 |
70 |
|
|
71 |
call MDSFINDUNIT( iunit, mythid ) |
call MDSFINDUNIT( iunit, mythid ) |
74 |
C Only do I/O if I am the master thread |
C Only do I/O if I am the master thread |
75 |
_BEGIN_MASTER( myThid ) |
_BEGIN_MASTER( myThid ) |
76 |
|
|
|
print *,' Opening ',fn |
|
77 |
open(iUnit,file=fn,status='old',access='direct',recl=recl) |
open(iUnit,file=fn,status='old',access='direct',recl=recl) |
78 |
read(iunit,rec=1) globalarr |
read(iunit,rec=1) globalarr |
79 |
close( iunit ) |
close( iunit ) |
95 |
bjslot = myYGlobalLo-1+(bj-1)*sNy |
bjslot = myYGlobalLo-1+(bj-1)*sNy |
96 |
#endif /* ALLOW_EXCH2 */ |
#endif /* ALLOW_EXCH2 */ |
97 |
|
|
98 |
do j = 1,sNx |
call get_landfrac(sNx,sNy,Nsx,Nsy,bi,bj,maxtyp, |
99 |
|
. surftype,tilefrac,fracland(1,1,bi,bj)) |
100 |
|
|
101 |
|
do j = 1,sNy |
102 |
do i = 1,sNx |
do i = 1,sNx |
103 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1) |
104 |
enddo |
enddo |
105 |
enddo |
enddo |
106 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
107 |
|
. temptile,nchp,nchptot(bi,bj)) |
108 |
do n = 1,nchp |
do n = 1,nchp |
109 |
tcanopy(n,bi,bj) = temptile(n) |
tcanopy(n,bi,bj) = temptile(n) |
110 |
enddo |
enddo |
111 |
|
|
112 |
do j = 1,sNx |
do j = 1,sNy |
113 |
do i = 1,sNx |
do i = 1,sNx |
114 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,2) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,2) |
115 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
116 |
|
. tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1) - 0.5 |
117 |
enddo |
enddo |
118 |
enddo |
enddo |
119 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
120 |
|
. temptile,nchp,nchptot(bi,bj)) |
121 |
do n = 1,nchp |
do n = 1,nchp |
122 |
tdeep(n,bi,bj) = temptile(n) |
tdeep(n,bi,bj) = temptile(n) |
123 |
enddo |
enddo |
124 |
|
|
125 |
do j = 1,sNx |
do j = 1,sNy |
126 |
do i = 1,sNx |
do i = 1,sNx |
127 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,3) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,3) |
128 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
129 |
|
. tempgrid(i,j) = 0.01 |
130 |
enddo |
enddo |
131 |
enddo |
enddo |
132 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
133 |
|
. temptile,nchp,nchptot(bi,bj)) |
134 |
do n = 1,nchp |
do n = 1,nchp |
135 |
ecanopy(n,bi,bj) = temptile(n) |
ecanopy(n,bi,bj) = temptile(n) |
136 |
enddo |
enddo |
137 |
|
|
138 |
do j = 1,sNx |
do j = 1,sNy |
139 |
do i = 1,sNx |
do i = 1,sNx |
140 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,4) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,4) |
141 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
142 |
|
. tempgrid(i,j) = 0.7 |
143 |
enddo |
enddo |
144 |
enddo |
enddo |
145 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
146 |
|
. temptile,nchp,nchptot(bi,bj)) |
147 |
do n = 1,nchp |
do n = 1,nchp |
148 |
swetshal(n,bi,bj) = temptile(n) |
swetshal(n,bi,bj) = temptile(n) |
149 |
enddo |
enddo |
150 |
|
|
151 |
do j = 1,sNx |
do j = 1,sNy |
152 |
do i = 1,sNx |
do i = 1,sNx |
153 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,5) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,5) |
154 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
155 |
|
. tempgrid(i,j) = 0.5 |
156 |
enddo |
enddo |
157 |
enddo |
enddo |
158 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
159 |
|
. temptile,nchp,nchptot(bi,bj)) |
160 |
do n = 1,nchp |
do n = 1,nchp |
161 |
swetroot(n,bi,bj) = temptile(n) |
swetroot(n,bi,bj) = temptile(n) |
162 |
enddo |
enddo |
163 |
|
|
164 |
do j = 1,sNx |
do j = 1,sNy |
165 |
do i = 1,sNx |
do i = 1,sNx |
166 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,6) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,6) |
167 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
168 |
|
. tempgrid(i,j) = 0.3 |
169 |
enddo |
enddo |
170 |
enddo |
enddo |
171 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
172 |
|
. temptile,nchp,nchptot(bi,bj)) |
173 |
do n = 1,nchp |
do n = 1,nchp |
174 |
swetdeep(n,bi,bj) = temptile(n) |
swetdeep(n,bi,bj) = temptile(n) |
175 |
enddo |
enddo |
176 |
|
|
177 |
do j = 1,sNx |
do j = 1,sNy |
178 |
do i = 1,sNx |
do i = 1,sNx |
179 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,7) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,7) |
180 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
181 |
|
. tempgrid(i,j) = 0. |
182 |
enddo |
enddo |
183 |
enddo |
enddo |
184 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
185 |
|
. temptile,nchp,nchptot(bi,bj)) |
186 |
do n = 1,nchp |
do n = 1,nchp |
187 |
snodep(n,bi,bj) = temptile(n) |
snodep(n,bi,bj) = temptile(n) |
188 |
enddo |
enddo |
189 |
|
|
190 |
do j = 1,sNx |
do j = 1,sNy |
191 |
do i = 1,sNx |
do i = 1,sNx |
192 |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,8) |
tempgrid(i,j) = globalarr(i+bislot,j+bjslot,8) |
193 |
|
if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001) |
194 |
|
. tempgrid(i,j) = 0. |
195 |
enddo |
enddo |
196 |
enddo |
enddo |
197 |
call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj)) |
call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj), |
198 |
|
. temptile,nchp,nchptot(bi,bj)) |
199 |
do n = 1,nchp |
do n = 1,nchp |
200 |
capac(n,bi,bj) = temptile(n) |
capac(n,bi,bj) = temptile(n) |
201 |
enddo |
enddo |