/[MITgcm]/MITgcm/pkg/fizhi/fizhi_init_veg.F
ViewVC logotype

Contents of /MITgcm/pkg/fizhi/fizhi_init_veg.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Jun 4 20:19:26 2004 UTC (20 years ago) by molod
Branch: MAIN
Routine to read vegetation dataset and define vegetation tile space

1 C $Header: $
2 C $Name: $
3
4 subroutine fizhi_init_veg ( mythid, im,jm,vegdata,
5 . maxtyp,nchp,outlons,outlats,
6 . flwi,nchplnd,surftype,tilefrac,
7 . igrd,ityp,chfr )
8 C***********************************************************************
9 C Subroutine mkwrld - routine to read in the land surface types,
10 C interpolate to the models grid,
11 C and set up tile space for use by the
12 C land surface model and the albedo calculation
13 C and the surface roughness calculation.
14 C
15 C INPUT:
16 C
17 C mythid - thread number (processor number)
18 C im - model grid longitude dimension
19 C jm - model grid latitude dimension (number of lat. points)
20 C vegdata - Character*40 Vegetation Dataset name
21 C maxtyp - maximum allowable number of land surface types per grid box
22 C nchp - integer actual number of tiles in tile space
23 C outlons - longitude value in degrees at model grid points
24 C outlats - latitude value in degrees at model grid points
25 C flwi - land-water mask from the old boundary conditions dataset
26 C (for the temporary!! compatibility check)
27 C
28 C OUTPUT:
29 C
30 C surftype - integer array of land surface types [im,jm,maxtyp]
31 C tilefrac - real array of corresponding land surface type fractions
32 C [im,jm,maxtyp]
33 C igrd - integer array in tile space of grid point number for each
34 C tile [nchp]
35 C ityp - integer array in tile space of land surface type for each
36 C tile [nchp]
37 C chfr - real array in tile space of land surface type fraction for
38 C each tile [nchp]
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
55 implicit none
56
57 integer exist
58 real zero,one
59 parameter (zero = 0.)
60 parameter (one = 1.)
61 parameter (exist=11)
62
63 integer mythid,im,imdata,jm,jmdata,maxtyp,nchp,nchplnd
64 real chfr(1)
65 integer surftype(im,jm,maxtyp),igrd(1),ityp(1)
66 real tilefrac(im,jm,maxtyp)
67 real outlons(im,jm),outlats(im,jm),flwi(im,jm)
68 character*40 vegdata
69 character*40 veg1x1
70 data veg1x1 /'veg360181.data'/
71
72 integer*4 im_32, jm_32
73 integer*4 iveg_32(360*181*10)
74 real*4 veg_32(360*181*10)
75 real vegf (360*181*10)
76 integer ivegt (360*181*10)
77
78 real locfracin(360,181,exist),locfracout(im,jm,exist)
79 real inlons(360*181),inlats(360*181)
80 integer i,ii,iii,iindex,j,jindex,k,kk,kkk,kbig,numtypes
81 real fract(maxtyp),undef,found,biggest
82 integer stype(maxtyp), ierr1, ierr2
83 logical okay,ordered
84 integer whichtypes(exist)
85 integer kveg
86
87 real dummy(im,jm)
88
89 real getcon
90 undef = getcon('UNDEF')
91
92 IF (myThid.eq.1) THEN
93 call mdsfindunit( kveg, myThid )
94 close (kveg)
95 open (kveg, file=vegdata, form='unformatted', access='sequential', iostat=ierr1)
96 if( ierr1.eq.0 ) then
97 read (kveg) im_32,jm_32, (IVEG_32(i),i=1,im_32*jm_32*maxtyp),
98 . (VEG_32(i),i=1,im_32*jm_32*maxtyp)
99 else
100 print *
101 print *, 'Veg Dataset: ',vegdata,' not found!'
102 print *
103 call exit (101)
104 endif
105 close (kveg)
106 ENDIF
107
108 imdata = im_32
109 jmdata = jm_32
110 do i = 1,im_32*jm_32*maxtyp
111 ivegt(i) = iveg_32(i)
112 vegf(i) = veg_32(i)
113 enddo
114
115 do iii = 1,im*jm*maxtyp
116 tilefrac(iii,1,1) = vegf(iii)
117 surftype(iii,1,1) = ivegt(iii)
118 enddo
119
120 c create chip arrays for :
121 c igrd : grid index
122 c ityp : veg. type
123 c chfr : vegetation fraction
124
125 c nchplnd<=nchp is the actual number of land chips
126
127 c land points
128 c -----------
129 nchplnd = 0
130 do k=1,maxtyp
131 do j=1,jm
132 do i=1,im
133 if(surftype(i,j,k).lt.100 .and. tilefrac(i,j,k).gt.0.) then
134 nchplnd = nchplnd + 1
135 igrd (nchplnd) = i + (j-1)*im
136 ityp (nchplnd) = surftype(i,j,k)
137 chfr (nchplnd) = tilefrac(i,j,k)
138 endif
139 enddo
140 enddo
141 enddo
142
143 c ocean points
144 c ------------
145 nchp = nchplnd
146
147 do k=1,maxtyp
148 do j=1,jm
149 do i=1,im
150 if(surftype(i,j,k).ge.100 .and. tilefrac(i,j,k).gt.0. ) then
151 nchp = nchp + 1
152 igrd (nchp) = i + (j-1)*im
153 ityp (nchp) = surftype(i,j,k)
154 chfr (nchp) = tilefrac(i,j,k)
155 endif
156 enddo
157 enddo
158 enddo
159
160 print *, 'Number of Total Tiles: ',nchp
161 print *, 'Number of Land Tiles: ',nchplnd
162 print *
163
164 RETURN
165 END

  ViewVC Help
Powered by ViewVC 1.1.22