爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5429|回复: 0

求助:ncl如何批量出图

[复制链接]
回帖奖励 3 金钱 回复本帖可获得 3 金钱奖励! 每人限 1 次

新浪微博达人勋

发表于 2017-9-5 09:45:42 | 显示全部楼层 |阅读模式

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

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

x
我用ncl把wrf_out文件的每个时刻的气压图都画出来,每出一个图就要修改一次脚本,这样很费时间,请问有没有什么命令可以批量出图呢,求大神指导如何修改下脚本,不胜感激。以下是我的脚本(每出一张图就要修改脚本的那两行红色字体,有没有什么改进方法):
; load functions and procedures
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
; WRF ARW input file (NOTE, your wrfout file does not need the .nc,
; but NCL needs it so make sure to add it in the line below)
a = addfile("wrfout_d01_1999-09-17_00:00:00.nc","r")
; Output on screen (type="x11"). Output will be called "plt_Surface1"
type = "png"
wks = gsn_open_wks(type,"1700")
; Set basic resources
res = True
res@MainTitle = "REAL-TIME WRF"          ; Give plot a main title
res@Footer = False                              ; Set Footers off
pltres = True                                ; Plotting resources
mpres = True                                      ; Map resources
;---------------------------------------------------------------
times = wrf_user_getvar(a,"times",-1) ; get all times in the file
ntimes = dimsizes(times)            ; number of times in the file
it = 0                            ; only interested in first time
res@TimeLabel = times(it)            ; keep some time information
   
;---------------------------------------------------------------
; Get variables
slp = wrf_user_getvar(a,"slp",it)                         ;Get slp
   wrf_smooth_2d( slp, 3 )                           ; Smooth slp

; Plotting options for SLP
opts = res                                  ; Add basic resources
opts@cnLineColor = "Blue"                        ; Set line color
opts@cnHighLabelsOn = True                           ; Set labels
opts@cnLowLabelsOn = True
opts@ContourParameters = (/ 900.,1100.,4./)   ; Contour intervals
contour_psl = wrf_contour(a,wks,slp,opts)           ; Create plot
delete(opts)


plot = wrf_map_overlays(a,wks,  \
      (/contour_psl/),pltres,mpres)
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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