1 |
C $Header: /u/gcmpack/MITgcm/verification/fizhi-gridalt-hs/code/fizhi_init_veg.F,v 1.1 2004/08/24 19:33:15 molod 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, |
8 |
& igrd,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 |
|
65 |
C- local variables: |
66 |
CHARACTER*40 vegdata |
67 |
INTEGER i,j,k,bi,bj |
68 |
|
69 |
WRITE(standardMessageUnit,'(2A)') ' FIZHI_INIT_VEG: ', |
70 |
& 'defining surface type and fraction: ----------------------' |
71 |
|
72 |
DO bj = myByLo(myThid), myByHi(myThid) |
73 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
74 |
|
75 |
do j = 1,jm |
76 |
do i = 1,im |
77 |
surftype(i,j,1,bi,bj) = 100 |
78 |
tilefrac(i,j,1,bi,bj) = 0.99 _d 0 |
79 |
surftype(i,j,2,bi,bj) = 100 |
80 |
tilefrac(i,j,2,bi,bj) = 0.01 _d 0 |
81 |
enddo |
82 |
enddo |
83 |
do k = 3,maxtyp |
84 |
do j = 1,jm |
85 |
do i = 1,im |
86 |
surftype(i,j,k,bi,bj) = 0 |
87 |
tilefrac(i,j,k,bi,bj) = 0. |
88 |
enddo |
89 |
enddo |
90 |
enddo |
91 |
|
92 |
ENDDO |
93 |
ENDDO |
94 |
|
95 |
C create chip arrays for : |
96 |
C igrd : grid index |
97 |
C ityp : veg. type |
98 |
C chfr : vegetation fraction |
99 |
C chlon: chip longitude |
100 |
C chlt : chip latitude |
101 |
|
102 |
C nchpland<=nchptot is the actual number of land chips |
103 |
WRITE(standardMessageUnit,'(2A)') ' FIZHI_INIT_VEG: ', |
104 |
& 'setting surface Tiles:' |
105 |
|
106 |
DO bj = myByLo(myThid), myByHi(myThid) |
107 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
108 |
|
109 |
C- initialise grid index array: |
110 |
do i=1,nchp |
111 |
igrd(i,bi,bj) = 1 |
112 |
enddo |
113 |
|
114 |
C- land points: |
115 |
nchpland(bi,bj) = 0 |
116 |
|
117 |
C- ocean points: |
118 |
nchptot(bi,bj) = nchpland(bi,bj) |
119 |
do k=1,maxtyp |
120 |
do j=1,jm |
121 |
do i=1,im |
122 |
if(surftype(i,j,k,bi,bj).ge.100 .and. |
123 |
& tilefrac(i,j,k,bi,bj).gt.0.) then |
124 |
nchptot(bi,bj) = nchptot(bi,bj) + 1 |
125 |
igrd (nchptot(bi,bj),bi,bj) = i + (j-1)*im |
126 |
ityp (nchptot(bi,bj),bi,bj) = surftype(i,j,k,bi,bj) |
127 |
chfr (nchptot(bi,bj),bi,bj) = tilefrac(i,j,k,bi,bj) |
128 |
chlon(nchptot(bi,bj),bi,bj) = lons(i,j,bi,bj) |
129 |
chlt (nchptot(bi,bj),bi,bj) = lats(i,j,bi,bj) |
130 |
endif |
131 |
enddo |
132 |
enddo |
133 |
enddo |
134 |
|
135 |
WRITE(standardMessageUnit,'(2(A,I4),2(A,I10))') ' bi=', bi, |
136 |
& ', bj=', bj, ', # of Land Tiles=', nchpland(bi,bj), |
137 |
& ', Total # of Tiles=', nchptot(bi,bj) |
138 |
|
139 |
ENDDO |
140 |
ENDDO |
141 |
|
142 |
WRITE(standardMessageUnit,'(2A)') ' FIZHI_INIT_VEG: done' |
143 |
|
144 |
RETURN |
145 |
END |