登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
program geogrid_clc implicit none
integer :: i,j integer :: isigned, endian, wordsize integer :: nx, ny, nz real :: scalefactor real*8 :: xllcorner, yllcorner, cellsize, missvalue character :: head12 real, allocatable :: rarray(:,:), iarray(:,:)
isigned = 1 endian = 0 wordsize = 2 scalefactor = 1.0 nz = 1
! read in the ascii new landuse data open (10, file = 'file.asc')
!read in the header read(10,*) head12, nx read(10,*) head12, ny read(10,*) head12, xllcorner read(10,*) head12, yllcorner read(10,*) head12, cellsize read(10,*) head12, missvalue
allocate(rarray(nx,ny)) allocate(iarray(nx,ny))
!read in the data do j = 1,ny read(10,*) iarray(:,j) end do
! reverse the data so that it begins at the lower-left corner do j = 1,ny rarray(:,j) = iarray(:,ny-(j-1)) enddo
!set the missing values do j = 1, ny do i = 1, nx if ( rarray(i,j) < 0 ) then rarray(i,j) = -99 ! set negative terrain to be zero since those are near coastal or river banks end if end do end do
call write_geogrid(rarray, nx, ny, nz, isigned, endian, scalefactor, wordsize)
end program 到这一步是怎么运行呢,把write_geogrid.c这个程序接在end program后面就好了吗,还是怎么弄得,程序write_geogrid.c里看不到输出到哪个目录,请指导,
|