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

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

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


Revision 1.13 - (hide annotations) (download)
Sun Jun 28 01:05:41 2009 UTC (14 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61s, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.12: +3 -3 lines
add bj in exch2 arrays and S/R

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

  ViewVC Help
Powered by ViewVC 1.1.22