/[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.10 - (hide 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 molod 1.10 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_init_vegsurftiles.F,v 1.9 2007/06/23 14:53:24 molod 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     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 molod 1.6 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 molod 1.1 _RL tempgrid(sNx,sNy)
57     _RL temptile(nchp)
58 molod 1.4 _RL fracland(sNx,sNy,Nsx,Nsy)
59 molod 1.1
60     ihour = nhms/10000
61 molod 1.8 if(xsize.eq.192) then
62 molod 1.10 WRITE(fn,'(a,I8,a,I2.2,a)')
63     . 'vegtiles_cs32.d',nymd,'z',ihour,'.bin'
64 molod 1.8 elseif(xsize.eq.612) then
65 molod 1.10 WRITE(fn,'(a,I8,a,I2.2,a)')
66     . 'vegtiles_cs102.d',nymd,'z',ihour,'.bin'
67 molod 1.8 else
68     print *,' xsize is ',xsize
69     stop 'do not seem to have correct vegtiles data '
70     endif
71 molod 1.1 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 molod 1.4 call get_landfrac(sNx,sNy,Nsx,Nsy,bi,bj,maxtyp,
101 jmc 1.5 . surftype,tilefrac,fracland(1,1,bi,bj))
102 molod 1.4
103 molod 1.3 do j = 1,sNy
104 molod 1.1 do i = 1,sNx
105     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1)
106     enddo
107     enddo
108 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
109     . temptile,nchp,nchptot(bi,bj))
110 molod 1.1 do n = 1,nchp
111     tcanopy(n,bi,bj) = temptile(n)
112     enddo
113    
114 molod 1.3 do j = 1,sNy
115 molod 1.1 do i = 1,sNx
116     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,2)
117 molod 1.4 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 molod 1.1 enddo
120     enddo
121 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
122     . temptile,nchp,nchptot(bi,bj))
123 molod 1.1 do n = 1,nchp
124     tdeep(n,bi,bj) = temptile(n)
125     enddo
126    
127 molod 1.3 do j = 1,sNy
128 molod 1.1 do i = 1,sNx
129     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,3)
130 molod 1.4 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
131     . tempgrid(i,j) = 0.01
132 molod 1.1 enddo
133     enddo
134 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
135     . temptile,nchp,nchptot(bi,bj))
136 molod 1.1 do n = 1,nchp
137     ecanopy(n,bi,bj) = temptile(n)
138     enddo
139    
140 molod 1.3 do j = 1,sNy
141 molod 1.1 do i = 1,sNx
142     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,4)
143 molod 1.4 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
144     . tempgrid(i,j) = 0.7
145 molod 1.1 enddo
146     enddo
147 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
148     . temptile,nchp,nchptot(bi,bj))
149 molod 1.1 do n = 1,nchp
150     swetshal(n,bi,bj) = temptile(n)
151     enddo
152    
153 molod 1.3 do j = 1,sNy
154 molod 1.1 do i = 1,sNx
155     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,5)
156 molod 1.4 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
157     . tempgrid(i,j) = 0.5
158 molod 1.1 enddo
159     enddo
160 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
161     . temptile,nchp,nchptot(bi,bj))
162 molod 1.1 do n = 1,nchp
163     swetroot(n,bi,bj) = temptile(n)
164     enddo
165    
166 molod 1.3 do j = 1,sNy
167 molod 1.1 do i = 1,sNx
168     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,6)
169 molod 1.4 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
170     . tempgrid(i,j) = 0.3
171 molod 1.1 enddo
172     enddo
173 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
174     . temptile,nchp,nchptot(bi,bj))
175 molod 1.1 do n = 1,nchp
176     swetdeep(n,bi,bj) = temptile(n)
177     enddo
178    
179 molod 1.3 do j = 1,sNy
180 molod 1.1 do i = 1,sNx
181     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,7)
182 molod 1.4 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
183     . tempgrid(i,j) = 0.
184 molod 1.1 enddo
185     enddo
186 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
187     . temptile,nchp,nchptot(bi,bj))
188 molod 1.1 do n = 1,nchp
189     snodep(n,bi,bj) = temptile(n)
190     enddo
191    
192 molod 1.3 do j = 1,sNy
193 molod 1.1 do i = 1,sNx
194     tempgrid(i,j) = globalarr(i+bislot,j+bjslot,8)
195 molod 1.4 if (tempgrid(i,j).gt.1.e14 .and. fracland(i,j,bi,bj).gt.0.0001)
196     . tempgrid(i,j) = 0.
197 molod 1.1 enddo
198     enddo
199 molod 1.7 call grd2msc(tempgrid,sNx,sNy,igrd(1,bi,bj),
200     . temptile,nchp,nchptot(bi,bj))
201 molod 1.1 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