[WRF]wrf_user_getvar 函数的使用

function wrf_user_getvar (nc_file, fld, it) 
     Usage: ter = wrf_user_getvar (a, “HGT”, 0)

nc_file:wrfout的nc文件名称

fld:变量名

it:时间设置。假如it=-1,则所有时间均输出。

例如:tc=wrf_user_getvar(f,"tc",-1)

======================================================

;*******************************************************************
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;*******************************************************************

begin

  f= addfile("wrfout_d01_2007-09-02_00_00_00.nc","r")
  tc=wrf_user_getvar(f,"tc",-1)
  printVarSummary(tc)

  system("/bin/rm -f tc_wrfout_d01_2007-09-02.nc") 
  nf  = addfile("tc_wrfout_d01_2007-09-02.nc","c")
  nf->tc=tc

  wks= gsn_open_wks("x11","t_wrf")
  gsn_define_colormap(wks,"BlRe")
  res                      = True
  plot = gsn_csm_contour(wks, tc(0,0,:,:), res)
end

======================================================

Get fields from a netCDF file for any given time, or all times in a file, by setting it = -1
Any field available in the nerCDF file can be extracted.
fld is case sensitive. The policy adapted during development was to set all diagnostic variables calculated by NCL to lower-case to distinguish them from fields directly available from the netCDF files.

List of available diagnostics:(可以输出诊断量)

avo: Absolute Vorticity [10-5 s-1]
cape_2d: Returns 2D fields mcape/mcin/lcl/lfc
cape_3d: Returns 3D fields cape/cin
dbz: Reflectivity [dBZ]
mdbz: Maximum Reflectivity [dBZ]
geopt/geopotential: Full Model Geopotential [m2 s-2]
lat: Latitude (will return either XLAT or XLAT_M, depending on which is available)
lon: Longitude (will return either XLONG or XLONG_M, depending on which is available)
p/pres: Full Model Pressure [Pa]
pressure: Full Model Pressure [hPa]
pvo: Potential Vorticity [PVU]
rh2: 2m Relative Humidity [%]
rh: Relative Humidity [%]
slp: Sea Level Pressure [hPa]
ter: Model Terrain Height [m] (will return either HGT or HGT_M, depending on which is available)
td2: 2m Dew Point Temperature [C]
td: Dew Point Temperature [C]
tc: Temperature [C]
th/theta: Potential Temperature [K]
tk: Temperature [K]
ua: U component of wind on mass points
va: V component of wind on mass points
wa: W component of wind on mass points
uvmet10: 10m U and V components of wind rotated to earth coordinates
uvmet: U and V components of wind rotated to earth coordinates
z/height: Full Model Height [m]

转载于:https://www.cnblogs.com/jjww/archive/2013/04/03/2997211.html

  • 3
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值