#将GrADS读取的数据写到ASCII文件(txt等)
(引用由sunny2008在 2008/01/10 10:13am 发表的内容)
使用到了'set gxout print' 将产生的ASCII变量输出到缓存,并用临时变量temp存储起来,接着使用write函数把临时 变量写到ASCII文件
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 %10.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