1 |
molod |
1.1 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_init_veg.F,v 1.14 2004/07/22 15:56:01 edhill Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "FIZHI_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
subroutine fizhi_init_veg(mythid,vegdata,im,jm,Nsx,Nsy,Nxg,Nyg, |
7 |
|
|
. maxtyp,nchp,nchptot,nchpland,lons,lats,surftype,tilefrac,igrd, |
8 |
|
|
. ityp,chfr,chlt,chlon) |
9 |
|
|
C*********************************************************************** |
10 |
|
|
C Subroutine fizhi_init_veg - routine to read in the land surface types, |
11 |
|
|
C interpolate to the models grid, and set up tile space for use by |
12 |
|
|
C the land surface model, the albedo calculation and the surface |
13 |
|
|
C roughness calculation. |
14 |
|
|
C |
15 |
|
|
C INPUT: |
16 |
|
|
C |
17 |
|
|
C mythid - thread number (processor number) |
18 |
|
|
C vegdata - Character*40 Vegetation Dataset name |
19 |
|
|
C im - longitude dimension |
20 |
|
|
C jm - latitude dimension (number of lat. points) |
21 |
|
|
C Nsx - Number of processors in x-direction |
22 |
|
|
C Nsy - Number of processors in y-direction |
23 |
|
|
C maxtyp - maximum allowable number of land surface types per grid box |
24 |
|
|
C nchp - integer per-processor number of tiles in tile space |
25 |
|
|
C lons - longitude in degrees [im,jm,nSx,nSy] |
26 |
|
|
C lats - latitude in degrees [im,jm,nSx,nSy] |
27 |
|
|
C |
28 |
|
|
C OUTPUT: |
29 |
|
|
C |
30 |
|
|
C surftype - integer array of land surface types [im,jm,maxtyp,Nsx,Nsy] |
31 |
|
|
C tilefrac - real array of corresponding land surface type fractions |
32 |
|
|
C [im,jm,maxtyp,Nsx,Nsy] |
33 |
|
|
C igrd - integer array in tile space of grid point number for each |
34 |
|
|
C tile [nchp,Nsx,Nsy] |
35 |
|
|
C ityp - integer array in tile space of land surface type for each |
36 |
|
|
C tile [nchp,Nsx,Nsy] |
37 |
|
|
C chfr - real array in tile space of land surface type fraction for |
38 |
|
|
C each tile [nchp,Nsx,Nsy] |
39 |
|
|
C |
40 |
|
|
C NOTES: |
41 |
|
|
C Vegetation type as follows: |
42 |
|
|
C 1: BROADLEAF EVERGREEN TREES |
43 |
|
|
C 2: BROADLEAF DECIDUOUS TREES |
44 |
|
|
C 3: NEEDLELEAF TREES |
45 |
|
|
C 4: GROUND COVER |
46 |
|
|
C 5: BROADLEAF SHRUBS |
47 |
|
|
C 6: DWARF TREES (TUNDRA) |
48 |
|
|
C 7: BARE SOIL |
49 |
|
|
C 8: DESERT |
50 |
|
|
C 9: GLACIER |
51 |
|
|
C 10: DARK DESERT |
52 |
|
|
C 100: OCEAN |
53 |
|
|
C*********************************************************************** |
54 |
|
|
implicit none |
55 |
|
|
#include "EEPARAMS.h" |
56 |
|
|
|
57 |
|
|
integer mythid,im,jm,maxtyp,nchp,Nsx,Nsy,Nxg,Nyg |
58 |
|
|
integer nchptot(Nsx,Nsy),nchpland(Nsx,Nsy) |
59 |
|
|
integer surftype(im,jm,maxtyp,Nsx,Nsy) |
60 |
|
|
integer igrd(nchp,Nsx,Nsy),ityp(nchp,Nsx,Nsy) |
61 |
|
|
_RL tilefrac(im,jm,maxtyp,Nsx,Nsy) |
62 |
|
|
_RL lats(im,jm,nSx,nSy), lons(im,jm,nSx,nSy) |
63 |
|
|
_RL chfr(nchp,Nsx,Nsy),chlt(nchp,Nsx,Nsy),chlon(nchp,Nsx,Nsy) |
64 |
|
|
character*40 vegdata |
65 |
|
|
|
66 |
|
|
integer i,j,k,bi,bj |
67 |
|
|
|
68 |
|
|
character *15 aim_landfile |
69 |
|
|
_RS aim_landFr(-1:34,-1:34,6,1) |
70 |
|
|
data aim_landfile /'landFrc.2f2.bin'/ |
71 |
|
|
CALL READ_REC_XY_RS(aim_LandFile,aim_landFr,1,0,myThid) |
72 |
|
|
|
73 |
|
|
DO BJ = myByLo(myThid), myByHi(myThid) |
74 |
|
|
DO BI = myBxLo(myThid), myBxHi(myThid) |
75 |
|
|
|
76 |
|
|
do j = 1,jm |
77 |
|
|
do i = 1,im |
78 |
|
|
if(aim_landfr(i,j,bi,bj).gt.0.1) then |
79 |
|
|
surftype(i,j,1,bi,bj) = 1 |
80 |
|
|
tilefrac(i,j,1,bi,bj) = 0.5 |
81 |
|
|
surftype(i,j,2,bi,bj) = 2 |
82 |
|
|
tilefrac(i,j,2,bi,bj) = 0.5 |
83 |
|
|
else |
84 |
|
|
surftype(i,j,1,bi,bj) = 100 |
85 |
|
|
tilefrac(i,j,1,bi,bj) = 0.99 |
86 |
|
|
surftype(i,j,2,bi,bj) = 100 |
87 |
|
|
tilefrac(i,j,2,bi,bj) = 0.01 |
88 |
|
|
endif |
89 |
|
|
enddo |
90 |
|
|
enddo |
91 |
|
|
do k = 3,maxtyp |
92 |
|
|
do j = 1,jm |
93 |
|
|
do i = 1,im |
94 |
|
|
surftype(i,j,k,bi,bj) = 0 |
95 |
|
|
tilefrac(i,j,k,bi,bj) = 0. |
96 |
|
|
enddo |
97 |
|
|
enddo |
98 |
|
|
enddo |
99 |
|
|
|
100 |
|
|
ENDDO |
101 |
|
|
ENDDO |
102 |
|
|
|
103 |
|
|
c create chip arrays for : |
104 |
|
|
c igrd : grid index |
105 |
|
|
c ityp : veg. type |
106 |
|
|
c chfr : vegetation fraction |
107 |
|
|
c chlon: chip longitude |
108 |
|
|
c chlt : chip latitude |
109 |
|
|
|
110 |
|
|
c nchpland<=nchptot is the actual number of land chips |
111 |
|
|
|
112 |
|
|
DO BJ = myByLo(myThid), myByHi(myThid) |
113 |
|
|
DO BI = myBxLo(myThid), myBxHi(myThid) |
114 |
|
|
|
115 |
|
|
c land points |
116 |
|
|
c ----------- |
117 |
|
|
nchpland(bi,bj) = 0 |
118 |
|
|
do k=1,maxtyp |
119 |
|
|
do j=1,jm |
120 |
|
|
do i=1,im |
121 |
|
|
if(surftype(i,j,k,bi,bj).lt.100 .and. |
122 |
|
|
. tilefrac(i,j,k,bi,bj).gt.0.) then |
123 |
|
|
nchpland(bi,bj) = nchpland(bi,bj) + 1 |
124 |
|
|
igrd (nchpland(bi,bj),bi,bj) = i + (j-1)*im |
125 |
|
|
ityp (nchpland(bi,bj),bi,bj) = surftype(i,j,k,bi,bj) |
126 |
|
|
chfr (nchpland(bi,bj),bi,bj) = tilefrac(i,j,k,bi,bj) |
127 |
|
|
chlon(nchpland(bi,bj),bi,bj) = lons(i,j,bi,bj) |
128 |
|
|
chlt (nchpland(bi,bj),bi,bj) = lats(i,j,bi,bj) |
129 |
|
|
endif |
130 |
|
|
enddo |
131 |
|
|
enddo |
132 |
|
|
enddo |
133 |
|
|
|
134 |
|
|
c ocean points |
135 |
|
|
c ------------ |
136 |
|
|
nchptot(bi,bj) = nchpland(bi,bj) |
137 |
|
|
|
138 |
|
|
do k=1,maxtyp |
139 |
|
|
do j=1,jm |
140 |
|
|
do i=1,im |
141 |
|
|
if(surftype(i,j,k,bi,bj).ge.100 .and. |
142 |
|
|
. tilefrac(i,j,k,bi,bj).gt.0.) then |
143 |
|
|
nchptot(bi,bj) = nchptot(bi,bj) + 1 |
144 |
|
|
igrd (nchptot(bi,bj),bi,bj) = i + (j-1)*im |
145 |
|
|
ityp (nchptot(bi,bj),bi,bj) = surftype(i,j,k,bi,bj) |
146 |
|
|
chfr (nchptot(bi,bj),bi,bj) = tilefrac(i,j,k,bi,bj) |
147 |
|
|
chlon(nchptot(bi,bj),bi,bj) = lons(i,j,bi,bj) |
148 |
|
|
chlt (nchptot(bi,bj),bi,bj) = lats(i,j,bi,bj) |
149 |
|
|
endif |
150 |
|
|
enddo |
151 |
|
|
enddo |
152 |
|
|
enddo |
153 |
|
|
|
154 |
|
|
print *,'Number of Total Tiles for bi=',bi,': ',nchptot(bi,bj) |
155 |
|
|
print *,'Number of Land Tiles for bi=',bi,': ',nchpland(bi,bj) |
156 |
|
|
|
157 |
|
|
ENDDO |
158 |
|
|
ENDDO |
159 |
|
|
|
160 |
|
|
|
161 |
|
|
RETURN |
162 |
|
|
END |