- 积分
- 10593
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-10
- 最后登录
- 1970-1-1
|
发表于 2014-4-23 16:18:58
|
显示全部楼层
wmax = max(qi)就一个值么,每次都写这个值到同一个文件。
要输出什么?是要把每个时次QICE的最大值输出到一个文件中吗?如果是,代码应该如下:
ascii_file = "data.txt"
str = new(ntimes, "string")
do it =0, ntimes-1,1 ; TIME LOOP
print("Working on time: " + times(it) )
res@TimeLabel = times(it) ; Set Valid time to use on plots
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; First get the variables we will need
if(isfilevar(a,"QICE"))
qi = wrf_user_getvar(a,"QICE",it)
qi = qi*1000.
qi@units = "g/kg"
end if
wmax = max(qi)
str(it) = sprintf("%12.8f", wmax)
end do
asciiwrite(ascii_file, str) |
|