爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5169|回复: 2

line-1 报错,但是end do,end if都补全了,为什么还是有这个问题

[复制链接]

新浪微博达人勋

发表于 2017-10-2 09:17:16 | 显示全部楼层 |阅读模式

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

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

x
;----------------------------------------------------------------------
; vector_2.ncl
;
; Concepts illustrated:
;   - Overlaying line contours, vectors, and filled contours on a map
;   - Manually attaching lat/lon coordinate arrays to a variable
;   - Changing the length of the smallest vector as a fraction of the reference vector
;   - Drawing curly vectors
;   - Setting the color for vectors
;   - Moving the vector reference annotation to the top right of the plot
;   - Making the labelbar be vertical
;   - Increasing the thickness of vectors
;----------------------------------------------------------------------
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/csm/contributed.ncl"
load "/home/wangl/public/cnmap/cnmap.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;---Open netCDF file   begin

raintot = conform_dims((/440,700/), 0.0 , -1)

do i = 0818,0823

name=i
       if(isfilepresent("/home/wangl/pkn/station/SEVP_CLI_CHN_MERGE_CMP_PRE_HOUR_GRID_0.10-201607"+name+".grd.nc")) then
       a=addfile("/home/wangl/pkn/station/SEVP_CLI_CHN_MERGE_CMP_PRE_HOUR_GRID_0.10-201607"+name+".grd.nc","r")

; Read in Sea Surface Temperature Anomalies
; Read in U and V at 1000 mb [subscript 0]
; Determine the subscripts corresponding to Jan 88
;
  h      = f->HGT_GDS1_ISBL
  u        = f->U_GRD_GDS1_ISBL
  v        = f->V_GRD_GDS1_ISBL
  lat   = f->g1_lat_0
  lon   = f->g1_lon_1
  lev=f->lv_ISBL2
  speed    = sqrt(u^2+v^2)
  speed@long_name = "Wind Speed"
  speed!1  = "lat"
  speed!2  = "lon"
  speed&lat= lat
  speed&lon= lon
  ind_uv=19
  print(lev(ind_uv))
   end if
end do
;---Create plot
  wks = gsn_open_wks("pdf","1712_circulation_500")         
    gsn_define_colormap (wks,"precip3_16lev")
  res                      = True               ; plot mods desired
  res@cnFillOn             = True               ; turn on color for contours
  res@cnLinesOn            = False              ; turn off contour lines
  res@cnLineLabelsOn       = False              ; turn off contour line labels
  res@gsnScalarContour     = True               ; contours desired
  res@gsnAddCyclic     = False
  res@mpFillOn = False
  ;res@mpLandFillColor       = "gray"            ; set land to be gray
  res@mpMinLonF            =  min(min(lon))               ; select a subregion
  res@mpMaxLonF            =  max(max(lon))
  res@mpMinLatF            =   min(min(lat))
  res@mpMaxLatF            =  max(max(lat))
  res@lbOrientation            = "Vertical"     ; vertical label bar
  res@pmLabelBarOrthogonalPosF = -0.01          ; move label bar closer
; note, when doing a subregion, NCL determines the range of the data from
; the full domain. If you wish to just consider the domain you are plotting,
; you must manually set those levels.
  res@cnLevelSelectionMode = "ManualLevels"     ; set manual contour levels
  res@cnMinLevelValF       = 10.0               ; set min contour level
  res@cnMaxLevelValF       = 30                ; set max contour level
  res@cnLevelSpacingF      = 2.               ; set contour spacing
; res@tiMainString         = "Sea Surface Temperatures and 1000 mb Winds"
  res@vcRefMagnitudeF           = 20.0             ; define vector ref mag
  res@vcRefLengthF              = 0.045           ; define length of vec ref
  res@vcRefAnnoOrthogonalPosF   = -1.0            ; move ref vector
  res@vcRefAnnoArrowLineColor   = "black"         ; change ref vector color
  res@vcGlyphStyle            = "LineArrow"     ; turn on curley vectors
  res@vcLineArrowColor        = "black"           ; change vector color
  res@vcLineArrowThicknessF   = 1.5               ; change vector thickness
  res@vcVectorDrawOrder       = "PostDraw"        ; draw vectors last
   res@gsnLeftString   = ""
  res@gsnDraw          = False                    ; turn off draw and frame
  res@gsnFrame         = False                    ; b/c this is an overlay plot
   printVarSummary(u)
   printVarSummary(v)
  plot=gsn_csm_vector_scalar_map_ce(wks,u(ind_uv,::10,::10),v(ind_uv,::10,::10),speed(ind_uv,:,:),res)

;---Add contours of wind speed to plot
  delete(res)
  res                 = True
  res@gsnDraw         = False
  res@gsnFrame        = False
  res@gsnAddCyclic = False
  res@gsnLeftString   = ""
  res@gsnRightString  = ""
  res@gsnCenterString = ""
  res@cnLineThicknessF  = 3.0
  res@cnInfoLabelOrthogonalPosF = 0.15  ; move info label down
  cplot = gsn_csm_contour(wks,h(ind_uv,:,:),res)
  overlay(plot,cplot)
  ;draw(plot)
  ;frame(wks)
;######   ADD MAP OF CHINA   #############

  cnres           = True
  cnres@china     = True       ;draw china map or not
  cnres@river     = True       ;draw changjiang&huanghe or not
  cnres@province  = True       ;draw province boundary or not
  cnres@nanhai    = True       ;draw nanhai or not
  cnres@diqu      = True     ;draw diqujie or not   

  plot = add_china_map(wks,map,cnres)

;************************************************************************************
draw(map)
frame(wks)
end
;**************************************************************************************
以上是我的脚本,希望能帮忙看看是什么语法错误,谢谢

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-10-2 10:45:02 | 显示全部楼层
已解决,谢谢
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-5-22 17:53:57 | 显示全部楼层

是什么问题
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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