[ncl-talk] Problems about output netCDF

Li Qi liqi123sh at qq.com
Sat Aug 23 19:21:12 MDT 2014


Dear all, 


I'd like to create a netCDF file with the selected variables read off WRF output data, but I can't make it.


Here's my code:


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


begin
	in = addfile("wrfout_d03_2011-06-13_18_00_00.nc","r")
	out = addfile("eth850_1.nc","c")
  
; First get the variables we will need  


  it = 1
  lat = wrf_user_getvar(in,"lat",it) ; Equivalent PotentialTtemperature [K] 
  lon = wrf_user_getvar(in, "lon",it) ; total pressure
  


  eth = wrf_user_getvar(in,"eth",it) ; Equivalent PotentialTtemperature [K] 
  p = wrf_user_getvar(in, "pressure",it) ; total pressure


  ; Horizontally interpolate to pressure coordinates ("p")
  pressure = 850.   ; 850 hPa
  eth_plane = wrf_user_intrp3d(eth,p,"h",pressure,0.,False) 




  
	out->lon = lon
	out->lat = lat
	out->eth850 = eth_plane
	
end‍
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140824/5c9c14a4/attachment.html 


More information about the ncl-talk mailing list