/[MITgcm]/MITgcm/pkg/fizhi/fizhi_init_vegsurftiles.F
ViewVC logotype

Contents of /MITgcm/pkg/fizhi/fizhi_init_vegsurftiles.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.10 - (show annotations) (download)
Mon Jul 9 15:07:14 2007 UTC (16 years, 11 months ago) by molod
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59g, checkpoint59f, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i
Changes since 1.9: +5 -3 lines
Truncate line to 72 characters

1 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_init_vegsurftiles.F,v 1.9 2007/06/23 14:53:24 molod Exp $
2 C $Name: $
3
4 #include "FIZHI_OPTIONS.h"
5 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
6 CBOP
7 C !ROUTINE: FIZHI_INIT_VEGSURFTILES
8 C !INTERFACE:
9 subroutine fizhi_init_vegsurftiles(nymd,nhms,prec,myThid)
10
11 C !DESCRIPTION:
12 C Read in grid space values of the land state
13 C and then convert to vegetation tile space
14
15 C !USES:
16 C Calls routine grd2msc to do grid to tile space for each bi bj
17 implicit none
18 #include "SIZE.h"
19 #include "fizhi_SIZE.h"
20 #include "fizhi_land_SIZE.h"
21 #include "fizhi_coms.h"
22 #include "fizhi_land_coms.h"
23 #include "fizhi_earth_coms.h"
24 #include "EEPARAMS.h"
25 #include "PARAMS.h"
26 #ifdef ALLOW_EXCH2
27 #include "W2_EXCH2_TOPOLOGY.h"
28 #include "W2_EXCH2_PARAMS.h"
29 #endif /* ALLOW_EXCH2 */
30
31 C !INPUT/OUTPUT PARAMETERS:
32 CHARACTER*1 prec
33 INTEGER nhms,nymd
34 INTEGER myThid
35
36 EXTERNAL ILNBLNK
37 INTEGER ILNBLNK
38 INTEGER MDS_RECLEN
39 CEOP
40 C !LOCAL VARIABLES:
41 CHARACTER*80 fn
42 integer ihour
43 integer i,j,n
44 integer bislot,bjslot,iunit
45 integer recl
46 integer bi,bj,fileprec
47 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)
57 _RL temptile(nchp)
58 _RL fracland(sNx,sNy,Nsx,Nsy)
59
60 ihour = nhms/10000
61 if(xsize.eq.192) then
62 WRITE(fn,'(a,I8,a,I2.2,a)')
63 . 'vegtiles_cs32.d',nymd,'z',ihour,'.bin'
64 elseif(xsize.eq.612) then
65 WRITE(fn,'(a,I8,a,I2.2,a)')
66 . 'vegtiles_cs102.d',nymd,'z',ihour,'.bin'
67 else
68 print *,' xsize is ',xsize
69 stop 'do not seem to have correct vegtiles data '
70 endif
71 fileprec = 64
72
73 call MDSFINDUNIT( iunit, mythid )
74 recl=MDS_RECLEN( fileprec, Nx*Ny*8, mythid )
75
76 C Only do I/O if I am the master thread
77 _BEGIN_MASTER( myThid )
78
79 open(iUnit,file=fn,status='old',access='direct',recl=recl)
80 read(iunit,rec=1) globalarr
81 close( iunit )
82 _END_MASTER( myThid )
83
84
85 #ifdef _BYTESWAPIO
86 call MDS_BYTESWAPR8( Nx*Ny*8, globalarr )
87 #endif
88
89 DO bj = myByLo(myThid), myByHi(myThid)
90 DO bi = myBxLo(myThid), myBxHi(myThid)
91
92 #if defined(ALLOW_EXCH2)
93 bislot = exch2_txglobalo(W2_myTileList(bi))-1
94 bjslot = exch2_tyglobalo(W2_myTileList(bi))-1
95 #else
96 bislot = myXGlobalLo-1+(bi-1)*sNx
97 bjslot = myYGlobalLo-1+(bj-1)*sNy
98 #endif /* ALLOW_EXCH2 */
99
100 call get_landfrac(sNx,sNy,Nsx,Nsy,bi,bj,maxtyp,
101 . surftype,tilefrac,fracland(1,1,bi,bj))
102
103 do j = 1,sNy
104 do i = 1,sNx
105 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1)
106 enddo
107 enddo
108 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
109 . temptile,nchp,nchptot(bi,bj))
110 do n = 1,nchp
111 tcanopy(n,bi,bj) = temptile(n)
112 enddo
113
114 do j = 1,sNy
115 do i = 1,sNx
116 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,2)
117 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
118 . tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1) - 0.5
119 enddo
120 enddo
121 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
122 . temptile,nchp,nchptot(bi,bj))
123 do n = 1,nchp
124 tdeep(n,bi,bj) = temptile(n)
125 enddo
126
127 do j = 1,sNy
128 do i = 1,sNx
129 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,3)
130 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
131 . tempgrid(i,j) = 0.01
132 enddo
133 enddo
134 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
135 . temptile,nchp,nchptot(bi,bj))
136 do n = 1,nchp
137 ecanopy(n,bi,bj) = temptile(n)
138 enddo
139
140 do j = 1,sNy
141 do i = 1,sNx
142 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,4)
143 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
144 . tempgrid(i,j) = 0.7
145 enddo
146 enddo
147 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
148 . temptile,nchp,nchptot(bi,bj))
149 do n = 1,nchp
150 swetshal(n,bi,bj) = temptile(n)
151 enddo
152
153 do j = 1,sNy
154 do i = 1,sNx
155 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,5)
156 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
157 . tempgrid(i,j) = 0.5
158 enddo
159 enddo
160 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
161 . temptile,nchp,nchptot(bi,bj))
162 do n = 1,nchp
163 swetroot(n,bi,bj) = temptile(n)
164 enddo
165
166 do j = 1,sNy
167 do i = 1,sNx
168 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,6)
169 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
170 . tempgrid(i,j) = 0.3
171 enddo
172 enddo
173 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
174 . temptile,nchp,nchptot(bi,bj))
175 do n = 1,nchp
176 swetdeep(n,bi,bj) = temptile(n)
177 enddo
178
179 do j = 1,sNy
180 do i = 1,sNx
181 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,7)
182 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
183 . tempgrid(i,j) = 0.
184 enddo
185 enddo
186 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
187 . temptile,nchp,nchptot(bi,bj))
188 do n = 1,nchp
189 snodep(n,bi,bj) = temptile(n)
190 enddo
191
192 do j = 1,sNy
193 do i = 1,sNx
194 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,8)
195 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
196 . tempgrid(i,j) = 0.
197 enddo
198 enddo
199 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
200 . temptile,nchp,nchptot(bi,bj))
201 do n = 1,nchp
202 capac(n,bi,bj) = temptile(n)
203 enddo
204
205 close(iunit)
206
207 C End of bi bj loop
208 enddo
209 enddo
210
211 RETURN
212 END

  ViewVC Help
Powered by ViewVC 1.1.22