1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
subroutine fizhi_init_veg(mythid,vegdata,im,jm,maxbi,maxbj,maxtyp, |
subroutine fizhi_init_veg(mythid,vegdata,im,jm,Nsx,Nsy,maxtyp, |
5 |
. surftype,tilefrac,igrd,ityp,chfr ) |
. surftype,tilefrac,igrd,ityp,chfr ) |
6 |
C*********************************************************************** |
C*********************************************************************** |
7 |
C Subroutine fizhi_init_veg - routine to read in the land surface types, |
C Subroutine fizhi_init_veg - routine to read in the land surface types, |
15 |
C vegdata - Character*40 Vegetation Dataset name |
C vegdata - Character*40 Vegetation Dataset name |
16 |
C im - model grid longitude dimension |
C im - model grid longitude dimension |
17 |
C jm - model grid latitude dimension (number of lat. points) |
C jm - model grid latitude dimension (number of lat. points) |
18 |
C maxbi - Number of processors in x-direction |
C Nsx - Number of processors in x-direction |
19 |
C maxbj - Number of processors in y-direction |
C Nsy - Number of processors in y-direction |
20 |
C maxtyp - maximum allowable number of land surface types per grid box |
C maxtyp - maximum allowable number of land surface types per grid box |
21 |
C nchpmax - integer maximum per-processor number of tiles in tile space |
C nchpmax - integer maximum per-processor number of tiles in tile space |
22 |
C |
C |
23 |
C OUTPUT: |
C OUTPUT: |
24 |
C |
C |
25 |
C surftype - integer array of land surface types [im,jm,maxtyp,bi,bj] |
C surftype - integer array of land surface types [im,jm,maxtyp,Nsx,Nsy] |
26 |
C tilefrac - real array of corresponding land surface type fractions |
C tilefrac - real array of corresponding land surface type fractions |
27 |
C [im,jm,maxtyp,bi,bj] |
C [im,jm,maxtyp,Nsx,Nsy] |
28 |
C igrd - integer array in tile space of grid point number for each |
C igrd - integer array in tile space of grid point number for each |
29 |
C tile [nchp,bi,bj] |
C tile [nchp,Nsx,Nsy] |
30 |
C ityp - integer array in tile space of land surface type for each |
C ityp - integer array in tile space of land surface type for each |
31 |
C tile [nchp,bi,bj] |
C tile [nchp,Nsx,Nsy] |
32 |
C chfr - real array in tile space of land surface type fraction for |
C chfr - real array in tile space of land surface type fraction for |
33 |
C each tile [nchp,bi,bj] |
C each tile [nchp,Nsx,Nsy] |
34 |
C |
C |
35 |
C NOTES: |
C NOTES: |
36 |
C Vegetation type as follows: |
C Vegetation type as follows: |
47 |
C 100: OCEAN |
C 100: OCEAN |
48 |
C*********************************************************************** |
C*********************************************************************** |
49 |
implicit none |
implicit none |
|
#include "EEPARAMS.h" |
|
50 |
|
|
51 |
integer mythid,im,jm,maxtyp,nchpmax,maxbi,maxbj |
integer mythid,im,jm,maxtyp,nchpmax,Nsx,Nsy |
52 |
integer surftype(im,jm,maxtyp,maxbi,maxbj) |
integer surftype(im,jm,maxtyp,Nsx,Nsy) |
53 |
integer igrd(nchpmax,bi,bj),ityp(nchpmax,maxbi,maxbj) |
integer igrd(nchpmax,Nsx,Nsy),ityp(nchpmax,Nsx,Nsy) |
54 |
real tilefrac(im,jm,maxtyp,maxbi,maxbj) |
real tilefrac(im,jm,maxtyp,Nsx,Nsy) |
55 |
real chfr(nchpmax,maxbi,maxbj) |
real chfr(nchpmax,Nsx,Nsy) |
56 |
character*40 vegdata |
character*40 vegdata |
57 |
integer imdata,jmdata,bidata,bjdata |
integer imdata,jmdata,Nsxdata,Nsydata |
58 |
integer nchp,nchpland |
integer nchp,nchpland |
59 |
|
|
60 |
integer*4 im_32, jm_32, bi_32, bj_32 |
integer*4 im_32, jm_32, Nsx_32, Nsy_32 |
61 |
integer*4 iveg_32(im,jm,maxtyp,bi,bj) |
integer*4 iveg_32(im,jm,maxtyp,Nsx,Nsy) |
62 |
real*4 veg_32(im,jm,maxtyp,bi,bj) |
real*4 veg_32(im,jm,maxtyp,Nsx,Nsy) |
63 |
|
|
64 |
integer i,j,k,bi,bj,ierr1,kveg |
integer i,j,k,bi,bj,ierr1,kveg |
65 |
|
|
68 |
open(kveg,file=vegdata,form='unformatted',access='sequential', |
open(kveg,file=vegdata,form='unformatted',access='sequential', |
69 |
. iostat=ierr1) |
. iostat=ierr1) |
70 |
if( ierr1.eq.0 ) then |
if( ierr1.eq.0 ) then |
71 |
read(kveg)im_32,jm_32,bi_32,bj_32,IVEG_32,VEG_32 |
read(kveg)im_32,jm_32,Nsx_32,Nsy_32,IVEG_32,VEG_32 |
72 |
else |
else |
73 |
print * |
print * |
74 |
print *, 'Veg Dataset: ',vegdata,' not found!' |
print *, 'Veg Dataset: ',vegdata,' not found!' |
79 |
IF (myThid.eq.1) THEN |
IF (myThid.eq.1) THEN |
80 |
imdata = im_32 |
imdata = im_32 |
81 |
jmdata = jm_32 |
jmdata = jm_32 |
82 |
bidata = bi_32 |
Nsxdata = Nsx_32 |
83 |
bjdata = bj_32 |
Nsydata = Nsy_32 |
84 |
if( (imdata.ne.im) .or. (jmdata.ne.jm) .or. |
if( (imdata.ne.im) .or. (jmdata.ne.jm) .or. |
85 |
. (bi.ne.bidata) .or. (bjdata.ne.bj) ) then |
. (Nsxdata.ne.Nsx) .or. (Nsydata.ne.Nsy) ) then |
86 |
print * |
print * |
87 |
print *, 'Veg Data Resolution is Incorrect! ' |
print *, 'Veg Data Resolution is Incorrect! ' |
88 |
print *,' Model Res: ',im,'x',jm,' Data Res: ',imdata,'x',jmdata |
print *,' Model Res: ',im,'x',jm,' Data Res: ',imdata,'x',jmdata |
89 |
print *,' Model Bij: ',bi,'x',bj,' Data Bij: ',bidata,'x',bjdata |
print *,' Model Nsx Nsy: ',Nsx,' ',Nsy,' Data Nsx Nsy: ',Nsxdata, |
90 |
|
. ' ',Nsydata |
91 |
print * |
print * |
92 |
call exit(102) |
call exit(102) |
93 |
ENDIF |
ENDIF |
94 |
|
|
95 |
imdata = im_32 |
DO BJ = 1,Nsx |
96 |
jmdata = jm_32 |
DO BI = 1,Nsy |
|
bidata = bi_32 |
|
|
bjdata = bj_32 |
|
|
|
|
|
DO BJ = myByLo(myThid), myByHi(myThid) |
|
|
DO BI = myBxLo(myThid), myBxHi(myThid) |
|
97 |
|
|
98 |
do k = 1,maxtyp |
do k = 1,maxtyp |
99 |
do j = 1,jm_32 |
do j = 1,jm |
100 |
do i = 1,im_32 |
do i = 1,im |
101 |
surftype(i,j,k,bi,bj) = iveg_32(i,j,k,bi,bj) |
surftype(i,j,k,bi,bj) = iveg_32(i,j,k,bi,bj) |
102 |
tilefrac(i,j,k,bi,bj) = veg_32(i,j,k,bi,bj) |
tilefrac(i,j,k,bi,bj) = veg_32(i,j,k,bi,bj) |
103 |
enddo |
enddo |