/[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.3 - (show annotations) (download)
Sat May 7 14:15:09 2005 UTC (19 years, 2 months ago) by molod
Branch: MAIN
Changes since 1.2: +9 -10 lines
Syntax correction

1 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_init_vegsurftiles.F,v 1.2 2005/05/05 21:23:27 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 Real*8 globalarr(Nx,Ny,8)
48 _RL tempgrid(sNx,sNy)
49 _RL temptile(nchp)
50
51 ihour = nhms/10000
52 WRITE(fn,'(a,I8,a,I2.2,a)')'vegtiles_cs32.d',nymd,'z',ihour,'.bin'
53 fileprec = 64
54
55 call MDSFINDUNIT( iunit, mythid )
56 recl=MDS_RECLEN( fileprec, Nx*Ny*8, mythid )
57
58 C Only do I/O if I am the master thread
59 _BEGIN_MASTER( myThid )
60
61 open(iUnit,file=fn,status='old',access='direct',recl=recl)
62 read(iunit,rec=1) globalarr
63 close( iunit )
64 _END_MASTER( myThid )
65
66
67 #ifdef _BYTESWAPIO
68 call MDS_BYTESWAPR8( Nx*Ny*8, globalarr )
69 #endif
70
71 DO bj = myByLo(myThid), myByHi(myThid)
72 DO bi = myBxLo(myThid), myBxHi(myThid)
73
74 #if defined(ALLOW_EXCH2)
75 bislot = exch2_txglobalo(W2_myTileList(bi))-1
76 bjslot = exch2_tyglobalo(W2_myTileList(bi))-1
77 #else
78 bislot = myXGlobalLo-1+(bi-1)*sNx
79 bjslot = myYGlobalLo-1+(bj-1)*sNy
80 #endif /* ALLOW_EXCH2 */
81
82 do j = 1,sNy
83 do i = 1,sNx
84 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1)
85 enddo
86 enddo
87 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
88 do n = 1,nchp
89 tcanopy(n,bi,bj) = temptile(n)
90 enddo
91
92 do j = 1,sNy
93 do i = 1,sNx
94 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,2)
95 enddo
96 enddo
97 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
98 do n = 1,nchp
99 tdeep(n,bi,bj) = temptile(n)
100 enddo
101
102 do j = 1,sNy
103 do i = 1,sNx
104 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,3)
105 enddo
106 enddo
107 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
108 do n = 1,nchp
109 ecanopy(n,bi,bj) = temptile(n)
110 enddo
111
112 do j = 1,sNy
113 do i = 1,sNx
114 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,4)
115 enddo
116 enddo
117 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
118 do n = 1,nchp
119 swetshal(n,bi,bj) = temptile(n)
120 enddo
121
122 do j = 1,sNy
123 do i = 1,sNx
124 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,5)
125 enddo
126 enddo
127 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
128 do n = 1,nchp
129 swetroot(n,bi,bj) = temptile(n)
130 enddo
131
132 do j = 1,sNy
133 do i = 1,sNx
134 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,6)
135 enddo
136 enddo
137 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
138 do n = 1,nchp
139 swetdeep(n,bi,bj) = temptile(n)
140 enddo
141
142 do j = 1,sNy
143 do i = 1,sNx
144 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,7)
145 enddo
146 enddo
147 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
148 do n = 1,nchp
149 snodep(n,bi,bj) = temptile(n)
150 enddo
151
152 do j = 1,sNy
153 do i = 1,sNx
154 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,8)
155 enddo
156 enddo
157 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
158 do n = 1,nchp
159 capac(n,bi,bj) = temptile(n)
160 enddo
161
162 close(iunit)
163
164 C End of bi bj loop
165 enddo
166 enddo
167
168 RETURN
169 END

  ViewVC Help
Powered by ViewVC 1.1.22