爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 17606|回复: 8

修改土地利用数据/下垫面

[复制链接]
发表于 2021-3-18 22:46:41 | 显示全部楼层 |阅读模式

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

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

x
我查询到修改土地利用数据的步骤是:
第一步:arcgis完成重分类重投影等步骤,得到ascii文件
第二步:在wps/geogrid/src    gcc -D_UNDERSCORE -DBYTESWAP -DLINUX -DIO_NETCDF-DIO_BINARY-DIO_GRIB1  -D_GEOGRID -O -c              write_geogrid.c   生成write_geogrid.o
第三步:gfortran 脚本.f90 write_geogrid.o  生成 a out 文件
第四步:运行a.out文件
第五步:添加index
但是现在第三步 出现错误:
[root@localhost src]# gfortran zwclanduse.f90 write_geogrid.o
zwclanduse.f90:39:

banks
1
Error: Unclassifiable statement at (1)
请问有大神给以指点,谢谢!
密码修改失败请联系微信:mofangbao
发表于 2021-5-24 10:54:43 | 显示全部楼层
banks删掉就好了
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2021-10-28 16:00:59 | 显示全部楼层
在第二步的时候,gcc运行时出现一堆警告,但是能生成生成write_geogrid.o,最后运行geogrid.exe时有错误,请问一下gcc这里出现这么多警告有没有影响呢,运行write_geogrid.c是不是要重新编译WPS呢?
出现的警告:
<command-line>:0:6: warning: ISO C99 requires whitespace after the macro name
write_geogrid.c:27:0: warning: "BIG_ENDIAN" redefined
#define BIG_ENDIAN    0

In file included from /usr/include/bits/waitstatus.h:64:0,
                 from /usr/include/stdlib.h:42,
                 from write_geogrid.c:16:
/usr/include/endian.h:46:0: note: this is the location of the previous definition
# define BIG_ENDIAN __BIG_ENDIAN

write_geogrid.c:28:0: warning: "LITTLE_ENDIAN" redefined
#define LITTLE_ENDIAN 1

In file included from /usr/include/bits/waitstatus.h:64:0,
                 from /usr/include/stdlib.h:42,
                 from write_geogrid.c:16:
/usr/include/endian.h:45:0: note: this is the location of the previous definition
# define LITTLE_ENDIAN __LITTLE_ENDIAN

write_geogrid.c: In function ‘write_geogrid_’:
write_geogrid.c:102:60: warning: left shift count >= width of type [-Wshift-count-overflow]
             if (iarray[i] < 0 && *isigned) iarray[i] += (1 << 32);
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2021-11-13 20:44:20 | 显示全部楼层
师兄您好,我最近再做WRF方面的土地利用数据更新,已经得到了write_geogrid.o文件,但是找不到生成a.out的脚本。请问您方便分享一下吗?  不胜感激。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2021-11-19 16:57:39 | 显示全部楼层
Sushaoh 发表于 2021-11-13 20:44
师兄您好,我最近再做WRF方面的土地利用数据更新,已经得到了write_geogrid.o文件,但是找不到生成a.out的 ...

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) = 0 ! set negative terrain to be zero since those are near coastalor river
banks
end if
end do
end do
call write_geogrid(rarray, nx, ny, nz, isigned, endian, scalefactor, wordsize)
end program
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2021-12-5 14:26:29 | 显示全部楼层
opeveu 发表于 2021-11-19 16:57
program geogrid_clc
implicit none
integer :: i,j

感谢您的回复
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2021-12-8 21:15:14 | 显示全部楼层
oyp123 发表于 2021-10-28 16:00
在第二步的时候,gcc运行时出现一堆警告,但是能生成生成write_geogrid.o,最后运行geogrid.exe时有错误, ...

你好,请问你这个问题解决了吗 ,我也出现了同样的问题
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2023-3-1 15:05:07 | 显示全部楼层
你好 想问一下楼主的这个问题解决了吗?我最近也在做ASCII转为二进制文件,实在是没有找到write_geogrid.c的用法 可以加您QQ了解一下吗 我的号是:3316611573
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 2023-9-2 18:26:48 | 显示全部楼层
oyp123 发表于 2021-10-28 16:00
在第二步的时候,gcc运行时出现一堆警告,但是能生成生成write_geogrid.o,最后运行geogrid.exe时有错误, ...

我也遇到了相同的情况,不知道您是如何处理的?
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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