- 积分
- 297
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2020-9-15
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我现在用ArcGIS制作一份灌溉面积比例数据,是ASCII码,现在想用脚本把ASCII转换为WRF模型能读取的二进制格式,就是地理静态数据的格式,现在有份用Gfortran语言转换土地利用类型的脚本,但用于灌溉面积比例数据转换出现错误,还请大佬指点,跪谢!附上用Gfortran语言有份土地利用类型转换的脚本,如果用于灌溉面积比例,是怎么改这个脚本呢?
脚本:
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 = 'irrigation.txt')
!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
这是灌溉面积百分比的index:
type=continuous
projection=regular_ll
dx=0.0833333
dy=0.0833333
known_x=1.0
known_y=1.0
known_lat=-89.95833
known_lon=-179.95833
wordsize=1
tile_x=4320
tile_y=2160
tile_z = 1
scale_factor=0.5
units="percent"
description="irrigated land percentage" |
|