爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3038|回复: 1

[图形美化] 一个ctl文件描述多个grd文件中的疑问

[复制链接]

新浪微博达人勋

发表于 2016-3-4 17:01:57 | 显示全部楼层 |阅读模式

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

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

x
我的目的是想用一个ctl文件描述20个grd文件,手动过于麻烦,还是批量更省心哇。参考了论坛http://bbs.06climate.com/forum.php?mod=viewthread&tid=6663&extra=&page=1的贴子,我自己试着写了一下,但还是有一些问题:
dset %d1%mc %y2.dat 中系统是如何自动识别d ,mc,y的,靠后面的字符数吗(红色),我自己的文件名是:01.grd,02.grd......20.grd,可不可以任意就写成  dset%d2dset%y2?
tdef 22631 linear 00Z01jan1948 1dy  中,22631=62*365+1也就是所有文件中的总时次,那一个grd中时次为338,那20个的话就是338*20=6760,也没啥问题吧?
error5.jpg
③当所有这些都设置完毕了,我们暂且将这个批量ctl文件命名为grd.ctl,那么是在grads命令窗口中输入open grd.ctl??那屏幕会有啥显示??我的显示如下,那我的那些01 02 03文件的ctl都哪儿去了啊,直接输入01.ctl打开报错啊。。。
error6.jpg
求指点!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-3-4 19:21:02 | 显示全部楼层
第一个问题,自己看官方文档
http://cola.gmu.edu/grads/gadoc/gadocindex.html
Using Templates

GrADS allows you use a single data descriptor file to aggregate multiple data files and handle them as if they were one individual file. The individual data files must be identical in the X, Y, and Z dimensions and have the same list of variables. The time range of each individual file must be indicated it its filename. Beginning with version 2.0, data files may also be aggregated in the ensemble dimension.

First, the DSET entry has a substitution template instead of a filename. See below for a description of all the possible components of the template. Second, the OPTIONS entry contains the template keyword. Third, the TDEF entry describes the time range for the entire set of data files.

Templating works on any GrADS data type for which you can write a descriptor file. If you specify any additional OPTIONS keywords in the data descriptor file, make sure the options apply equally to each file included in the template.

You can use the set misswarn command to alert you if any of the data files in the templated set is missing.

Templating over TIME

Valid components of the substitution template for the TIME axis are as follows:

%x1   1 digit decade
%x3   3 digit decade
%y2   2 digit year
%y4   4 digit year
%m1   1 or 2 digit month
%m2   2 digit month (leading zero if needed)
%mc   3 character month abbreviation
%d1   1 or 2 digit day
%d2   2 digit day (leading zero if needed)
%h1   1 or 2 digit hour
%h2   2 digit hour
%h3   3 digit hour (e.g., 120 or 012)
%n2   2 digit minute; leading zero if needed
%f2   2 digit forecast hour; leading zero if needed; more digits added for hours >99; hour values increase indefinitely
%f3   3 digit forecast hour; leading zeros if needed; more digits added for hours >999; hour values increase indefinitely
%fn2  2 digit forecast minute; leading zero if needed; more digits added for minutes > 99; minute values increase indefinitely (2.0.a9+)
%fhn  forecast time expressed in hours and minutes (hhnn) where minute value (nn) is always <=59
      and hour value (hh) increases indefinitely. If hh or nn are <=9, they are padded with a 0
      so they are always at least 2 digits; more digits added for hours >99. (2.0.a9+)
%fdhn forecast time expressed in days, hours, and minutes (ddhhnn) where minute value (nn) is always <=59,
      hour value (hh) is always <=23 and day value (dd) increases indefinitely. If dd, hh, or nn are <=9,
      they are padded with a 0 so they are always at least 2 digits; more digits added for days >99. (2.0.a9+)
%j3   3 digit julian day (day of year) (2.0.a7+)
%t1   1 or 2 digit time index (file names contain number sequences that begin with 1 or 01) (2.0.a7+)
%t2   2 digit time index (file names contain number sequences that begin with 01) (2.0.a7+)
%t3   3 digit time index (file names contain number sequences that begin with 001) (2.0.a7+)
%t4   4 digit time index (file names contain number sequences that begin with 0001) (2.0.a8+)
%t5   5 digit time index (file names contain number sequences that begin with 00001) (2.0.a8+)
%t6   6 digit time index (file names contain number sequences that begin with 000001) (2.0.a8+)
%tm1  1 or 2 digit time index (file names contain number sequences that begin with 0 or 00) (2.0.a7+)
%tm2  2 digit time index (file names contain number sequences that begin with 00) (2.0.a7+)
%tm3  3

第二个问题,你自己原来的ctl 该在哪还在哪,打不开你自己去看路径、文件名之类的对不对
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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