爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7786|回复: 4

Convert to WPS-binary readable format

[复制链接]
发表于 2013-12-19 11:56:15 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

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里看不到输出到哪个目录,请指导,


密码修改失败请联系微信:mofangbao
发表于 2014-11-27 09:24:05 | 显示全部楼层
我也求解,请各位帮忙
密码修改失败请联系微信:mofangbao
发表于 2014-11-27 09:27:22 | 显示全部楼层
楼主问题解决了吗
密码修改失败请联系微信:mofangbao
发表于 2015-9-2 20:30:20 | 显示全部楼层
请问楼主问题解决了吗?./a.out产生binary文件后,运行geogrid.exe一直提醒:in the source tile 0001-01259.0001-00730,point(1073,705) has an invalid category of 0
密码修改失败请联系微信:mofangbao
发表于 2019-9-5 21:57:03 | 显示全部楼层
这个程序不能直接运行吧
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表