爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5433|回复: 2

[图形美化] [已解决] GrADS出图,编写 gs 、ctl脚本的问题

[复制链接]

新浪微博达人勋

发表于 2015-10-22 16:11:52 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 David.刘 于 2015-10-22 16:11 编辑

最近在学习如何用GrADS出图,但在出图过程中遇到问题.现在不知道怎么解决了求教各位老师.
问题是:Grads的输出图形和Micaps输出的结果截然不同。Ctl 和GS脚本是自己参考《GrADS 用户手册》(LASG编)写的。个人觉得应该还是编写得可能有问题,但是找了很久不知道到底错在哪里,现在贴出来大家给帮忙看一下。

运行环境说明运行环境: 系统win7 、GrADS 2.0.2
执行数据格式:NC 格式

代码贴出来:
gh0500.nc文件的属性描述,是通过ucdump工具 直接输出到Txt文件的。
*---------------------------------------------------------------------------------------------------*
netcdf gh0500 {
dimensions:
        time = UNLIMITED ; // (52 currently)
        lat = 181 ;
        lon = 360 ;
variables:
        double time(time) ;
                time:calendar = "365_day" ;
                time:units = "hours since 1-1-1 00:00:0.0" ;
                time:bounds = "time_bnds" ;
                time:long_name = "time" ;
        float lat(lat) ;
                lat:units = "degrees_north" ;
                lat:long_name = "latitude" ;
                lat:_CoordinateAxisType = "Lat" ;
                lat:Latitude Resolution = 1.f ;
                lat:Unit Of Resolution = "degree" ;
                lat:actual_range = -90.f, 90.f 1
                lat:standard_name = "latitude" ;
                lat:axis = "Y" ;
                lat:_FillValue = 9.96921e+036f ;
        float lon(lon) ;
                lon:units = "degrees_east" ;
                lon:long_name = "longitude" ;
                lon:_CoordinateAxisType = "Lon" ;
                lon:Longitude Resolution = 1.f ;
                lon:Unit Of Resolution = "degree" ;
                lon:actual_range = 0.f, 359.f ;
                lon:standard_name = "longitude" ;
                lon:axis = "X" ;
                lon:_FillValue = 9.96921e+036f ;
        float gh(time, lat, lon) ;
                gh:level = 500.f ;
                gh:_FillValue = 9.96921e+036f ;
                gh:long_name = "Geopotential Height" ;
                gh:short_name = "gh" ;
                gh:units = "m" ;
                gh:actual_range = -890.2862f, 32243.89f ;
                gh:level_desc = "Multiple levels" ;
                gh:dataset = "NCC DERF 2.0" ;

// global attributes:
                :Conventions = "DERF 2.0" ;
                :title = "daily China NCC DERF 2.0 analysis (2015)" ;
                :history = "created 2011/12 by Hoop (netCDF2.3)" ;
                :description = "Data is from NCC initialized reanalysis\\n(4x/day).  It consists of most variables interpolated to\\npressure surfaces from model (sigma) sues." ;
                :platform = "DERF 2.0 Model" ;
                :creation_date = "Sun Jul 12 05:51:52 GMT 2015" ;

描述文件Ctl

*---------------------------------------------------------------------------------------------------*



DSET d:\mydat\gh0500.nc
TITLE NCC DERF 2.0
UNDEF 9.96921e+036
XDEF  360  linear 0 1.0
YDEF 181  linear -90 1.0
TDEF 52 LINEAR 00Z8Feb2014 1DY
ZDEF 1 levels 500
VARS 1
gh 0 99 air temperature at 2m (K)
ENDVARS


gs控制文件
*----------------------------------------------------------------------------------------------------*
'reinit'
'open d:\mydat\Z.ctl'
*-----------------------------------------------------------------*
'set mpdset lambert'
'set xlint 4'
'set ylint 4'
'set lon 72 140'
'set lat 15 55'
'set xlopts 1 5 0.15'
'set ylopts 1 5 0.15'
'set z 1 1'
'set t 3 3'
'set gxout contour'
'set mpdset cnworld '
*'cnriver'
*----------------------------------------------------------------*
*'define p1=sum(gh,t=2,t=2)'
*----------------------------------------------------------------*
*'enable print  201510-201608_rain.gmf'
'set grads off'
'set grid off'
*'set clevs  -890.2862 3000 5000 6000 7000 8000 10000 20000 32243.89'
*'set ccols  0 8 12 7 10 3 13 5 11 4 14 9'
*'cbarn'
*'print'
*'c'
'draw title t2latlon'
'd smth9(gh)'
'printim d:\testZ.gif white'
;

在GrADS中执行GS控制脚本得到如下结果
*------------------------------------------------------------------*


*--------------------------------------------------------------------------------------------------------*
nc数据附件 gh0500.nc (12.93 MB, 下载次数: 0)

图1

图1
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2015-10-22 16:26:31 | 显示全部楼层
谢谢楼主,楼主辛苦了
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2015-10-22 16:11:53 | 显示全部楼层
已解决。少加了一个参数
DTYPE NETCDF
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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