/[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.1 - (show annotations) (download)
Wed May 4 22:16:04 2005 UTC (19 years, 2 months ago) by molod
Branch: MAIN
Routine to read initial land state

1 C $Header: $
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 print *,' Opening ',fn
62 open(iUnit,file=fn,status='old',access='direct',recl=recl)
63 read(iunit,rec=1) globalarr
64 close( iunit )
65 _END_MASTER( myThid )
66
67
68 #ifdef _BYTESWAPIO
69 call MDS_BYTESWAPR8( Nx*Ny*8, globalarr )
70 #endif
71
72 DO bj = myByLo(myThid), myByHi(myThid)
73 DO bi = myBxLo(myThid), myBxHi(myThid)
74
75 #if defined(ALLOW_EXCH2)
76 bislot = exch2_txglobalo(W2_myTileList(bi))-1
77 bjslot = exch2_tyglobalo(W2_myTileList(bi))-1
78 #else
79 bislot = myXGlobalLo-1+(bi-1)*sNx
80 bjslot = myYGlobalLo-1+(bj-1)*sNy
81 #endif /* ALLOW_EXCH2 */
82
83 do j = 1,sNx
84 do i = 1,sNx
85 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,1)
86 enddo
87 enddo
88 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
89 do n = 1,nchp
90 tcanopy(n,bi,bj) = temptile(n)
91 enddo
92
93 do j = 1,sNx
94 do i = 1,sNx
95 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,2)
96 enddo
97 enddo
98 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
99 do n = 1,nchp
100 tdeep(n,bi,bj) = temptile(n)
101 enddo
102
103 do j = 1,sNx
104 do i = 1,sNx
105 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,3)
106 enddo
107 enddo
108 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
109 do n = 1,nchp
110 ecanopy(n,bi,bj) = temptile(n)
111 enddo
112
113 do j = 1,sNx
114 do i = 1,sNx
115 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,4)
116 enddo
117 enddo
118 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
119 do n = 1,nchp
120 swetshal(n,bi,bj) = temptile(n)
121 enddo
122
123 do j = 1,sNx
124 do i = 1,sNx
125 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,5)
126 enddo
127 enddo
128 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
129 do n = 1,nchp
130 swetroot(n,bi,bj) = temptile(n)
131 enddo
132
133 do j = 1,sNx
134 do i = 1,sNx
135 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,6)
136 enddo
137 enddo
138 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
139 do n = 1,nchp
140 swetdeep(n,bi,bj) = temptile(n)
141 enddo
142
143 do j = 1,sNx
144 do i = 1,sNx
145 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,7)
146 enddo
147 enddo
148 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
149 do n = 1,nchp
150 snodep(n,bi,bj) = temptile(n)
151 enddo
152
153 do j = 1,sNx
154 do i = 1,sNx
155 tempgrid(i,j) = globalarr(i+bislot,j+bjslot,8)
156 enddo
157 enddo
158 call grd2msc(tempgrid,sNx,sNy,igrd,temptile,nchp,nchptot(bi,bj))
159 do n = 1,nchp
160 capac(n,bi,bj) = temptile(n)
161 enddo
162
163 close(iunit)
164
165 C End of bi bj loop
166 enddo
167 enddo
168
169 RETURN
170 END

  ViewVC Help
Powered by ViewVC 1.1.22