/[MITgcm]/MITgcm/verification/fizhi-cs-aqualev20/code/fizhi_init_veg.F
ViewVC logotype

Contents of /MITgcm/verification/fizhi-cs-aqualev20/code/fizhi_init_veg.F

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


Revision 1.2 - (show annotations) (download)
Thu Mar 22 14:24:21 2012 UTC (12 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.1: +99 -88 lines
initialise igrd index array to 1 to avoid out-of-bounds indices in other S/R

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

  ViewVC Help
Powered by ViewVC 1.1.22