! This is a function to read cligen and wingen spatial data from cligen and wingen grid file ! into cligen array 'cligenDIM' and wingen array called wingenDIM ! @ read from adm_soil.dat ! Updated version by change soilDim and landcov from 2-D into 4D ! updated on 11/12/10 subroutine read_cligen_wingenGIS() include 'p1werm.inc' include 'wpath.inc' include 'airpact/spatialGIS.inc' ! define the spatial variable. m as rows and n as columns integer m,n,cellsize character *125 cligenFile character *125 wingenFile real xllcorner, yllcorner character *2512 line real temp(401,500) integer i, lineNum, colNum integer s,t,temp1,temp2 ! soilFile = 'adm_soils.dat' cligenFile = '/data/wa_cligrid12.dat' wingenFile = '/data/wa_wingrid12.dat' lineNum = 1 temp1 = 1 temp2 = 1 call fopenk(47,rootp(1:len_trim(rootp))//cligenFile,'old') 100 read (47,'(a)',end=80) line if (line(1:1) .eq. '#') then goto 100 else if ((line(1:) .eq. 'EOF') .or. (line(1:).eq.'End')) then goto 200 end if 200 read(line,*) m,n,cellSize ! read in rows,colns,and cell size ! write(*,*) 'Size:',m,n, cellSize read (47,'(a)',err=80) line ! read the soil spatial data into soilDim do while (lineNum .le. m) read (47,'(a)',end=80) line read(line,*) (cligenidx(lineNum,i), i=1,n) lineNum =lineNum + 1 end do call fopenk(57,rootp(1:len_trim(rootp))//wingenFile,'old') 400 read (57,'(a)',end=90) line if (line(1:1) .eq. '#') then goto 400 else if ((line(1:) .eq. 'EOF') .or. (line(1:).eq.'End')) then goto 500 end if 500 read(line,*) m,n,cellSize ! read in rows,colns,and cell size read (57,'(a)',err=90) line ! read(line,*) m ! re ! read the soil spatial data into array lineNum = 1 ! read the soil spatial data into soilDim do while (lineNum .le. m) read (57,'(a)',end=90) line read(line,*) (wingenidx(lineNum,i), i=1,n) lineNum =lineNum + 1 end do 300 close(47) 600 close(57) 80 write (0,9001) 90 write (0,9002) 9001 format('Done to read the CligenGIS file!') 9002 format('Done to read the WingenGIS file!') ! 1001 format (3i6) ! 1002 format (2f16.8) end