- 积分
- 893
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-12-28
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 shirlyqiu 于 2016-12-9 11:50 编辑
最近用了ECMWF的reanalysis数据,为了方便一口气下了十几个变量,由于变量名自带小数点,grads识别不了,就写了个ctl(如下)来画图。
ctl:
dset …/surface_water_flux.nc
title surface water flux
undef -32767
options yrev
dtype netcdf
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 1 linear 0 1
tdef 416 linear 00Z01JAN1982 1mo
vars 15
p55.162=>p55 0 t,y,x Vertical integral of water vapour
p56.162=>p56 0 t,y,x Vertical integral of cloud liquid water
p57.162=>p57 0 t,y,x Vertical integral of cloud frozen water
p71.162=>p71 0 t,y,x Vertical integral of eastward water vapour flux
p72.162=>p72 0 t,y,x Vertical integral of northward water vapour flux
p79.162=>p79 0 t,y,x Vertical integral of divergence of cloud liquid water flux
p80.162=>p80 0 t,y,x Vertical integral of divergence of cloud frozen water flux
p84.162=>p84 0 t,y,x Vertical integral of divergence of moisture flux
p88.162=>p88 0 t,y,x Vertical integral of eastward cloud liquid water flux
p89.162=>p89 0 t,y,x Vertical integral of northward cloud liquid water flux
p90.162=>p90 0 t,y,x Vertical integral of eastward cloud frozen water flux
p91.162=>p91 0 t,y,x Vertical integral of northward cloud frozen water flux
tcw=>tcw 0 t,y,x Total column water
tcwv=>tcwv 0 t,y,x Total column water vapour
tclw=>tclw 0 t,y,x Total column liquid water
endvars
结果画出来图不对,用nc文件中可画图的tcw变量对比了一下,发现每个变量都有不同的scale_factor和add_offset。然后找到@river关于nc的描述文件帖nc资料(即NetCDF和HDF类的资料) 的描述文件-----升级版(可直接使用open命令),还是不知道怎么处理多变量的不同scale_factor和add_offset参数,在论坛里没找到相同的问题,然后我还试了下自己处理变量“真实数据=原始数据*scale_factor+add_offset”,结果误差还是蛮大,就自己去发了个提问帖,石沉大海…
急性子的我只好用最笨的办法又把每个变量单独下一个nc文件,每个nc文件分别写ctl,就可以写详细的unpack信息,这样做是完全没问题的,这是解决方法一。
我在river的帖子下留言,river提示我有其他童鞋有类似的情况,那位童鞋建议不写具体的scale_factor和add_offset,ctl如下:
dset …/surface_water_flux.nc
title surface water flux
undef -32767
unpack scale_factor add_offset
options yrev
dtype netcdf
xdef 144 linear 0 2.5
ydef 73 linear -90 2.5
zdef 1 linear 0 1
tdef 416 linear 00Z01JAN1982 1mo
vars 15
p55.162=>p55 0 t,y,x Vertical integral of water vapour
p56.162=>p56 0 t,y,x Vertical integral of cloud liquid water
p57.162=>p57 0 t,y,x Vertical integral of cloud frozen water
p71.162=>p71 0 t,y,x Vertical integral of eastward water vapour flux
p72.162=>p72 0 t,y,x Vertical integral of northward water vapour flux
p79.162=>p79 0 t,y,x Vertical integral of divergence of cloud liquid water flux
p80.162=>p80 0 t,y,x Vertical integral of divergence of cloud frozen water flux
p84.162=>p84 0 t,y,x Vertical integral of divergence of moisture flux
p88.162=>p88 0 t,y,x Vertical integral of eastward cloud liquid water flux
p89.162=>p89 0 t,y,x Vertical integral of northward cloud liquid water flux
p90.162=>p90 0 t,y,x Vertical integral of eastward cloud frozen water flux
p91.162=>p91 0 t,y,x Vertical integral of northward cloud frozen water flux
tcw=>tcw 0 t,y,x Total column water
tcwv=>tcwv 0 t,y,x Total column water vapour
tclw=>tclw 0 t,y,x Total column liquid water
endvars
然后运行grads时提示add_offset按默认赋值为0.0(这种情况下scale_factor可能是对的),画出来的图偏差比较大,感觉不能用这种方法来处理。
然后river又提供了一种思路,即在多变量情况下,要画某一变量时,给ctl提供该变量的具体unpack信息,譬如要画tcw变量时,直接给ctl的unpack项附上tcw变量的scale_factor和add_offset值,这样也能画出正确的tcw变量图,这是解决方法二。
总而言之,这两种方法都不是很方便,仅供需要的童鞋参考(木有附图,有需要的童鞋自己找个数据试试吧)。在此特别感谢river的帮助。科研不易,且行且珍惜。
|
|