[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]


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM