爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 6037|回复: 1

ncl

[复制链接]
气象家园蒙面人  发表于 2019-12-17 19:52:18 |阅读模式
NCL
系统平台:
问题截图: -
问题概况: 改变脚本出图的经纬度,默认出图为26°N-34°N,100°E-112°E,想缩小范围28°N-32°N,104°E-110°E
我看过提问的智慧: 看过
自己思考时长(天): 3

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

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

x
begin
  idomain =  2   ; 3,3

  f0 = addfile("D:\ck\20180821\mp_7\wrfout_d01_2018-08-21_mp7.nc","r")
  Times = f0->Times
  dims = dimsizes(Times)
  RAINC = f0->RAINC(0,:,:)
  RAINNC = f0->RAINNC(0,:,:)
  RainTotal = RAINC(:,:)
  fmap = addfile("D:\ck\20180821\mp_7\wrfout_d01_2018-08-21_mp7.nc","r")
  HGT = fmap->HGT(0,:,:)
  HGT =(/HGT/1000./)

  wks = gsn_open_wks("png","/cygdrive/d/ck/out")

  res_ter                       = True            
  res_ter@gsnFrame              = False
  res_ter@gsnDraw               = False
  res_ter@cnFillOn              = True            
  res_ter@cnFillPalette         = "gsltod"         
  res_ter@cnLinesOn             = False            
  res_ter@cnLineLabelsOn        = False           
  res_ter@cnFillMode            = "RasterFill"
  res_ter@cnFillOpacityF        = 1.
  res_ter@lbLabelBarOn          = False
  res_ter@gsnRightString        =  ""
  
  res_ter = wrf_map_resources(fmap, res_ter)      
     
  res_ter@tfDoNDCOverlay        = True
  res_ter@mpOutlineBoundarySets = "AllBoundaries"
  res_ter@mpDataSetName         = "Earth..4"      
  res_ter@mpGeophysicalLineThicknessF = 1.5      
  res_ter@mpProvincialLineThicknessF  = 2.
  res_ter@mpProvincialLineColor       = "black"
  
  res_ter@pmTickMarkDisplayMode = "Always"         
  res_ter@tmXBLabelFontHeightF  = 0.018
  res_ter@tmYLLabelFontHeightF  = 0.018
  res_ter@tmYLLabelStride       = 2              
  res_ter@tmXBLabelStride       = 2

  res_ter@tmYRMajorOutwardLengthF = 0
  res_ter@tmYLMajorOutwardLengthF = 0
  res_ter@tmXBMajorOutwardLengthF = 0
  res_ter@tmXBMinorOutwardLengthF = 0
  res_ter@tmXTOn                  = True
  res_ter@tmYROn                  = True
  res_ter@tmYRLabelsOn            = False
  res_ter@tmXTLabelsOn            = False
  
  res_tot                       = True
  res_tot@gsnFrame              = False
  res_tot@gsnDraw               = False
  cmap     := read_colormap_file("BlAqGrYeOrReVi200")
  cmap(0,:) = (/0,0,0,0/)   
  
  
  res_tot@cnFillOn             = True
  res_tot@cnFillMode           = "RasterFill"
  res_tot@cnFillPalette        = cmap
  res_tot@cnLinesOn            = False            
  res_tot@cnLineLabelsOn       = False            
  res_tot@cnFillOpacityF       = 1.               

  res_tot@tfDoNDCOverlay        = True
  res_tot@cnLevelSelectionMode = "ManualLevels"
  res_tot@cnMaxLevelValF       = 90
  res_tot@cnMinLevelValF       =  5
  res_tot@cnLevelSpacingF      =  10
  
  res_tot@pmLabelBarHeightF    = 0.08      
  res_tot@lbLabelFontHeightF   = 0.014
  res_tot@pmLabelBarOrthogonalPosF = -0.008
  res_tot@cnInfoLabelOn        = True
  res_tot@cnInfoLabelString    = "Min= $ZMN$ Max= $ZMX$"
  res_tot@cnInfoLabelOrthogonalPosF = -0.104        
  
  res_tot@tiMainFont           = "Helvetica-bold"
  res_tot@tiMainFontHeightF    = 0.018
  res_tot@gsnRightString       = "RAIN, mm"
  res_tot@gsnLeftString        =  ""
  
  
  
    RainTotal = (/(f0->RAINC(30,:,:) + f0->RAINNC(30,:,:) - \
                  (f0->RAINC(6,:,:) + f0->RAINNC(6,:,:)))/1. /)
    res_tot@tiMainString = ("RAINC+RAINNC " +chartostring(f0->Times(6,:)) +"-" +chartostring(f0->Times(30,:)))
    plot_terrain = gsn_csm_contour_map(wks,HGT,res_ter)
    plot_raintot =  gsn_csm_contour(wks,RainTotal,res_tot)
    overlay(plot_terrain, plot_raintot)

    draw(plot_terrain)

    frame(wks)
end

密码修改失败请联系微信:mofangbao
发表于 2019-12-31 10:13:30 | 显示全部楼层
http://www.ncl.ucar.edu/Document/Graphics/Resources/mp.shtml
MaxLatF/MinLatF/MaxLonF/MinLonF四个res楼主可以试一下
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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