- 积分
- 2473
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-3-27
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 东风急流 于 2015-11-20 10:52 编辑
现在想用卫星资料的地表温度二进制数据(TSK1.dat)去替换wrfrst中的地表温度TSK,TSK1.dat数据是我们自己写入的300*400数组,用绘图如下
这里的边界在差值的时候出现了一些小值,因此想在替换的时候做一个判断:小于250K的不错替换
我的ncl程序如下:
;======================================================
; This script is used to read a binary file and write the var to the netCDF file.
;======================================================
begin
nx=300
ny=400
a=addfile("/home/lw/soil/TSK/wrfrst_d01_2013-07-02_12:30:00.nc","w")
tsk=new((/1,nx,ny/),"float")
tsk=a->TSK
print(tsk(0,160,20)) ;打印替换前的变量值
;delete(tsk@_FillValue)
tsk1=new((/nx,ny/),"float")
tsk1=fbindirread("/home/lw/soil/TSK/TSK1.dat",0,(/nx,ny/),"float")
print(tskl(160,20)) 打印要去做替换的值
delete(tsk1@_FillValue)
;-----------------------
; change the field
;-----------------------
do i=1,300,1
do j=1,400,1
if(tsk1(i-1,j-1).gt.250) then
tsk(0,i-1,j-1)=tsk1(i-1,j-1)
end if
enddo
end do
print(tsk(0,160,20))打印替换后的变量值
;-----------------------
;write the field
;-----------------------
a->TSK=tsk
end
运行后最后显示数据没有被替换:
Copyright (C) 1995-2013 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.1.2
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
Variable: tsk (subsection)
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 7
_FillValue : 9.96921e+36
FieldType : 104
MemoryOrder : XY
description : SURFACE SKIN TEMPERATURE
units : K
stagger :
coordinates : XLONG XLAT
(0) 9.96921e+36
Variable: tskl (subsection)
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
(0) 313.9202
Variable: tsk (subsection)
Type: float
Total Size: 4 bytes
1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:
Number Of Attributes: 7
_FillValue : 9.96921e+36
FieldType : 104
MemoryOrder : XY
description : SURFACE SKIN TEMPERATURE
units : K
stagger :
coordinates : XLONG XLAT
(0) 9.96921e+36
大家帮帮忙吧~~
|
|