WRF新手 {:cry:}跪求赐教!!!可私聊,必有重谢!!! WRF已经运行完成,想要将运行结果与模拟区域某站点数据进行对比以评估模拟准确性。目前,对于如何将数据提取出来仍有很多问题。下面是写关于提取数据的脚本(整理官网脚本等所得),运行脚本存在错误,看了大家的帖子n久,仍然不知道如何下手,求高手指教!!!!! ;*********************************************** 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 ;*********************************************** DATADir ="/lustre/home/esechzh/models/WRFV3.7/run/" FILES = systemfunc (" ls -1 " +DATADir + "wrfout_d03* ") numFILES = dimsizes(FILES) print("numFILES = " + numFILES) print(FILES) print (" ") a =addfiles(FILES+".nc","r") ; What times and how many time steps are inthe data set? times =wrf_user_getvar(a,"times",-1) ; get all times in the file ntimes = dimsizes(times) ; number of times in the file ; The specific height levels that we wantthe data interpolated to. height_levels = (/ 10., 20./) ; height levels to plot - in meter nlevels = dimsizes(height_levels) ; number of height levels ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; First get the variables we will need
tc = wrf_user_getvar(a,"tc",-1) ; T in C u =wrf_user_getvar(a,"ua",-1) ; u averaged to mass points v =wrf_user_getvar(a,"va",-1) ; v averaged to mass points p = wrf_user_getvar(a,"pressure",-1) ; pressure is our vertical coordinate rh = wrf_user_getvar(a,"rh",-1) ;relative humidity z = wrf_user_getvar(a,"z",-1) ; grid pointheight ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Find the ij location for the point ifinterest lat= 31 lon= 121 llres = True llres@ReturnInt = True ; Returninteger values locij = wrf_user_ll_to_ij(a, lon, lat, llres) locij = locij - 1 ; arraypointers in NCL space locX = locij(0) locY = locij(1) tc_point = tc(:,:,locY,locX);extract a time series at a point ;rh_point = rh(:,:,locY,locX) dolevel = 0,nlevels-1 ;LOOP OVER LEVELS
height = height_levels(level)
p_plane = wrf_user_intrp3d(p,z,"h",height,0.,False) tc_plane = wrf_user_intrp3d(tc_point,z,"h",height,0.,False) rh_plane = wrf_user_intrp3d(rh_point,z,"h",height,0.,False) u_plane = wrf_user_intrp3d(u,z,"h",height,0.,False) v_plane = wrf_user_intrp3d(v,z,"h",height,0.,False) enddo
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alist = [/times, tc_plane, p_plane,rh_plane, u_plane, v_plane/] write_table("data.csv","w", alist, "%d%16.2f%s%d%ld") end
|