加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

[转]从GrADS中输出文本的办法 

(2014-10-30 13:59:09)
标签:

股票

分类: 毛妈感悟
资源一:


下面引用由sunny2008在 2008/01/10 10:13am 发表的内容:
请问该怎么输出文本的数据文件呢?比如我想输出变量U10m的值到文本文件u.dat, 我在gs文件里用rc=write(‘u.dat’,U10m), 可是写出的u.dat文件里只有变量名U10m,没有具体的数据,不知是怎么回事啊?哪位好心 ...

 

file="out.txt"
'set gxout print'
*'set prnopts %f 10 1'
'd U10m'
rc=write(file,result,append)

资源二:

file='*.txt' 
'set gxout print' 
'set prnopts *' 
'd var' 
'a=write(file,result) '

资源三:

set prnopts 

set prnopts format numl numb  

Controls the way values are printed when set gxout print is used. 


format   a C language template for formatting ascii output. Default is %g. 
numl     number of values to print per record. Default is 8. 
numb     number of blanks to insert between values. Default is 1. 
u        print 'Undef' instead of the numerical value for missing data. 

Usage Notes 
The first line of the ascii output will tell the user how many data values are being printed as well as the missing data value. 

Examples 
This example will print all the values in exponential notation: 

set gxout print 
set prnopts .3e 5 1 
d t 


The output might look like this: 

Printing Grid -- 30 Values -- Undef = -2.56e+33 
-2.560e+33 -2.560e+33  3.014e+02  3.011e+02  3.001e+02 
-2.560e+33 -2.560e+33  3.010e+02 -2.560e+33 -2.560e+33 
-2.560e+33 -2.560e+33 -2.560e+33 -2.560e+33 -2.560e+33 
-2.560e+33 -2.560e+33 -2.560e+33  2.993e+02  2.995e+02 
-2.560e+33 -2.560e+33  3.004e+02  3.008e+02  3.010e+02 
-2.560e+33 -2.560e+33  2.999e+02  3.010e+02  3.012e+02 

0

阅读 收藏 喜欢 打印举报/Report
前一篇:复查141008
后一篇:复查141118
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有