爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5965|回复: 2

ncl运行wrfout提取数据脚本出错

[复制链接]
回帖奖励 1 金钱 回复本帖可获得 1 金钱奖励! 每人限 1 次(中奖概率 20%)

新浪微博达人勋

发表于 2019-11-14 16:51:31 | 显示全部楼层 |阅读模式

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

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

x
我用ncl提取wrfout文件脚本时出现如下错误:
[~/ssx/wrf3.8.1/WRFV3/run]$ncl zhandian.ncl
Copyright (C) 1995-2017 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.4.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:syntax error: line 1 in file zhandian.ncl before or near

^

fatal:error in statement

脚本内容如下:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
  a=addfile("/gpfshome/chenq/ssx/wrf3.8.1/WRFV3/run/wrfout_d02_2018-01-01_00_00_00","r")

  d1=wrf_user_getvar(a,"U10",-1)
  d2=wrf_user_getvar(a,"V10",-1)
  d=sqrt((d1)*(d1)+(d2)*(d2))
; RH=wrf_user_getvar(a,"RH",-1)
  T2=wrf_user_getvar(a,"T2",-1)
  ;d1=wrf_user_getvar(a,"DUST_1",-1)
  ;d2=wrf_user_getvar(a,"DUST_2",-1)
  ;d3=wrf_user_getvar(a,"DUST_3",-1)
  ;d4=wrf_user_getvar(a,"DUST_4",-1)
  ;d5=wrf_user_getvar(a,"DUST_5",-1)
  ;d=d1+d2+d3+d4+d5

; d=wrf_user_getvar(a,"O3",-1)
; d=d*1.96*1000  

  ;d=wrf_user_getvar(a,"PM2_5_DRY",-1)

  times = wrf_user_getvar(a,"times",-1)

  xlat=wrf_user_getvar(a,"XLAT",0)
  xlon=wrf_user_getvar(a,"XLONG",0)

  ;locationij=wrf_user_ll_to_ij(a,103.839462,36.039448,True);
  ;locationij=wrf_user_ll_to_ij(a,106.795478,39.668052,True) ;   
  ;locationij=wrf_user_ll_to_ij(a,106.822042,39.698685,True) ;   
  locationij=wrf_user_ll_to_ij(a,106.8,39.8,True) ;   

  ;print(locationij)
  lonlat=wrf_user_ij_to_ll(a,locationij(0),locationij(1),True);              
  ;print(lonlat)
  xx=xlat(locationij(1)-1,locationij(0)-1)                              
  ;print(xx)
  dust=d(:,locationij(1)-1,locationij(0)-1)
  T=T2(:,locationij(1)-1,locationij(0)-1)
;  R=RH(:,locationij(1)-1,locationij(0)-1)
;  print(dust)
asciiwrite("/gpfshome/chenq/ssx/result/Wuhai/V.xls", dust)
asciiwrite("/gpfshome/chenq/ssx/result/Wuhai/T.xls", T)
asciiwrite("/gpfshome/chenq/ssx/result/Wuhai/R.xls", R)
end

请问是哪里出了问题
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-11-15 08:00:54 | 显示全部楼层
a=addfile("/gpfshome/chenq/ssx/wrf3.8.1/WRFV3/run/wrfout_d02_2018-01-01_00_00_00.nc","r")
试试这样呢
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2019-11-18 08:39:39 | 显示全部楼层
小其其格 发表于 2019-11-15 08:00
a=addfile("/gpfshome/chenq/ssx/wrf3.8.1/WRFV3/run/wrfout_d02_2018-01-01_00_00_00.nc","r")
试试这样 ...

也没用,最后重新输了一遍代码发现好了,不知道哪里的问题
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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