爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 7000|回复: 2

ncl 提取wrf数据

[复制链接]
发表于 2015-10-9 20:20:29 | 显示全部楼层 |阅读模式

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

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

x
运行下面的scripts, 出现错误 fatal:syntax error: line -1 before or near  求助该如何解决,新手求帮助
;***********************************************
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
;***********************************************


a = addfile("./lustre/home/esechzh/models/WRFV3.7/run/wrfout_d03_2015-04-10_07:00:00","r")
; What times and how many time steps are in the 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 want the data interpolated to.
height_levels = (/ 500., 2000./)   ; 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

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    do level = 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,z,"h",height,0.,False)
      rh_plane = wrf_user_intrp3d(rh,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)
   end do

; Find the ij location for the point if interest
  lat = 31
  lon = 121
  llres = True
  llres@ReturnInt = True   ; Return integer values
  locij = wrf_user_ll_to_ij(a, lon, lat, llres)
  locij = locij - 1        ; array pointers in NCL space
  locX = locij(0)
  locY = locij(1)
密码修改失败请联系微信:mofangbao
发表于 2015-10-9 21:56:35 | 显示全部楼层
少一个end
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2015-10-18 15:31:11 | 显示全部楼层
有begin就要有end,加在最后一行
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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