爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 28944|回复: 15

用NCL画副高脊线

[复制链接]

新浪微博达人勋

发表于 2018-10-4 10:07:23 | 显示全部楼层 |阅读模式

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

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

x
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 "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"
begin
  f     = addfile ("/home/shuai/paper/data/hgt.mon.mean.nc","r")
  u     = addfile ("/home/shuai/paper/data/uwnd.mon.mean.nc","r")
  lat   = f->lat
  lon   = f->lon

   p82   = f->hgt(413:415,5,:,:)   
   p97   = f->hgt(593:595,5,:,:)
   p15   = f->hgt(809:811,5,:,:)  

   u82   = u->uwnd(413:415,5,:,:)   
   u97   = u->uwnd(593:595,5,:,:)
   u15   = u->uwnd(809:811,5,:,:)               

  ; p82   = f->hgt(425:427,5,:,:)
  ; p97   = f->hgt(605:607,5,:,:)
  ; p15   = f->hgt(821:823,5,:,:)
  ; u82   = u->uwnd(425:427,5,:,:)
  ; u97   = u->uwnd(605:607,5,:,:)
  ; u15   = u->uwnd(821:823,5,:,:)



     m82 = dim_avg_n_Wrap(p82, 0)
     m97 = dim_avg_n_Wrap(p97, 0)
     m15 = dim_avg_n_Wrap(p15, 0)

     um82 = dim_avg_n_Wrap(u82, 0)
     um97 = dim_avg_n_Wrap(u97, 0)
     um15 = dim_avg_n_Wrap(u15, 0)

     h82 = m82/10
     h97 = m97/10
     h15 = m15/10

     copy_VarMeta(m82, h82)
     copy_VarMeta(m97, h97)
     copy_VarMeta(m15, h15)
;==============================================
; create color plot
;=============================================
  wks   = gsn_open_wks ("eps", "/home/shuai/paper/plot/jixian1" )           ; send graphics to PNG file
  plot  = new(3,graphic)
  base  = new(3,graphic)
  ploth = new(3,graphic)
  res                            = True
  res@gsnMaximize                = True
  res@gsnDraw                    = False                ; do not draw the plot
  res@gsnFrame                   = False                ; do not advance the frame
  res@gsnAddCyclic               = False
  res@mpOutlineOn                = True
  res@mpFillOn                   = False
  res@mpMinLatF                  = 0.                   ; zoom in on a subregion
  res@mpMaxLatF                  = 60.
  res@mpMinLonF                  = 60.
  res@mpMaxLonF                  = 180.
  ;res@mpGeophysicalLineThicknessF= 2

  res@tmXTOn                      = False
  res@tmYROn                      = False
  res@tmXBLabelFontHeightF        = 0.02
  res@tmYLLabelFontHeightF        = 0.02  

  res@cnLevelSelectionMode       = "ExplicitLevels" ; Explicit contour levels
  res@cnLevels                   = (/560,565,570,575,580,585,590/)             ; One contour level to plot
  res@cnLineThicknessF           = 1.5               ; Thickness of contour line
  res@cnLineLabelsOn             = True                  ; do not use line labels
  res@cnInfoLabelOn              = False
  res@cnFillOn                   = False                  ; color fill
  res@cnLinesOn                  = True                 ; do not draw contour lines
  res@gsnRightString             = "dagpm"

  ;res@gsnLeftStringOrthogonalPosF = 0.01   
  res@gsnLeftStringFontHeightF    = 0.025
  res@gsnRightStringFontHeightF   = 0.025

  res@gsnLeftString        = "1982"
  plot(0) = gsn_csm_contour_map(wks,h82,res)  ; create the overlay plot

   res@gsnLeftString       = "1997"
  plot(1) = gsn_csm_contour_map(wks,h97,res)

   res@gsnLeftString       = "2015"
  plot(2) = gsn_csm_contour_map(wks,h15,res)

  ;;;; 突出588线
  vres                            = True
  vres@gsnFrame                   = False
  vres@gsnDraw                    = False
  vres@gsnAddCyclic               = False
  vres@cnLevelSelectionMode       = "ExplicitLevels" ; Explicit contour levels
  vres@cnLevels                   = (/588/)             ; One contour level to plot
  vres@cnLineThicknessF           = 2                ; Thickness of contour line
  vres@cnLineColor                = "black"
  vres@gsnLeftString              = ""
  vres@gsnRightString             = ""
  vres@cnInfoLabelOn              = False
  vres@cnLineLabelsOn             = True                  ; do not use line labels
  base(0) = gsn_csm_contour(wks,h82,vres)  ; create the overlay plot
  base(1) = gsn_csm_contour(wks,h97,vres)  ; create the overlay plot
  base(2) = gsn_csm_contour(wks,h15,vres)  ; create the overlay plot

  overlay(plot(0), base(0))
  overlay(plot(1), base(1))
  overlay(plot(2), base(2))

;;;;  画副高脊线
  hres                            = True
  hres@gsnDraw                    = False
  hres@gsnFrame                   = False
  hres@gsnAddCyclic               = False
  hres@cnLevelSelectionMode       = "ExplicitLevels" ; Explicit contour levels
  hres@cnLevels                   = (/0/)             ; One contour level to plot
  hres@cnLineThicknessF           = 2                ; Thickness of contour line
  hres@cnLineColor                = "red"
  hres@gsnLeftString              = ""
  hres@gsnRightString             = ""
  hres@cnInfoLabelOn              = False
  hres@cnLineLabelsOn             = False                  ; do not use line labels
  ploth(0) = gsn_csm_contour(wks, um82({19:30},{102:180}), hres)  ;; 相当于GrADS中的maskout命令 um82({19:30},{102:180}
  ploth(1) = gsn_csm_contour(wks, um97({15:30},{110:180}), hres)
  ploth(2) = gsn_csm_contour(wks, um15({17:30},{103:180}), hres)


  overlay(plot(0), ploth(0))
  overlay(plot(1), ploth(1))
  overlay(plot(2), ploth(2))



  resP                                  = True
  resP@gsnPanelLabelBar                 = False
  resP@gsnFrame                         = False
  resP@gsnPanelLabelBar                 = False                ; add common colorbar
  resP@gsnPanelFigureStrings            = (/"(a)","(b)","(c)"/)
  resP@gsnPanelFigureStringsFontHeightF = 0.011
  resP@gsnPanelYWhiteSpacePercent       = 2
  resP@gsnPanelXWhiteSpacePercent       = 1
  resP@amResizeNotify                   = True
  resP@gsnPanelRowSpec                  = True                           ; 指定每行绘制子图的个数
  gsn_panel(wks,plot,(/2,1/),resP)

end
图形如下:
1111.png
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-10-10 13:38:50 | 显示全部楼层
请问下你这个是怎么定义的副高脊点呢?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2018-10-11 08:52:14 | 显示全部楼层
yeah... 发表于 2018-10-10 13:38
请问下你这个是怎么定义的副高脊点呢?

副高脊线:副高内东西风分界线。在副高脊线上,东西风速为0.
如果你要画副高西伸脊点,请参考:
http://bbs.06climate.com/forum.php?mod=viewthread&tid=56412
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-12-27 10:42:10 | 显示全部楼层
你好,请问副高的数据从哪里下载啊?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2018-12-27 14:58:41 | 显示全部楼层
学习了大佬
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2019-1-3 23:25:13 | 显示全部楼层
感谢楼主辛苦付出!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2019-1-4 00:07:07 | 显示全部楼层
天生我才 发表于 2018-12-27 10:42
你好,请问副高的数据从哪里下载啊?

NCEP的再分析资料
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2020-2-28 22:19:03 | 显示全部楼层
感谢分享!学习到了!!!
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-10-14 12:29:37 | 显示全部楼层
学习了,正有需要
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2020-11-10 10:53:32 | 显示全部楼层
谢谢楼主!学习了
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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