请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
12
返回列表 发新帖
楼主: tianmeng

画WRF的结果,使用wrf_map_overlays画图时如何调整经纬度的大小和间隔

[复制链接]

新浪微博达人勋

发表于 2018-12-20 11:09:33 | 显示全部楼层

回帖奖励 +10 金钱

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

新浪微博达人勋

 楼主| 发表于 2019-1-24 09:58:28 | 显示全部楼层
Soaring 发表于 2018-12-20 11:09
http://bbs.06climate.com/forum.php?mod=viewthread&tid=52976

谢谢,我搞出来了,把程序贴在后面以帮助遇到类似问题的人
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2019-1-24 10:00:46 | 显示全部楼层
      1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
      2 load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
      3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
      4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
      5 begin
      6   a = addfile("a.nc","r")
      7   lat2d = a->XLAT(0,:,:)
      8   lon2d = a->XLONG(0,:,:)
      9   lat1d = lat2d(:,0)
     10   lon1d = lon2d(0,:)
     11   tt = wrf_user_getvar(a,"T2",0)
     12   tt@lat2d = lat2d
     13   tt@lon2d = lon2d
     14   tt2 = rcm2rgrid_Wrap(lat2d,lon2d,tt,lat1d,lon1d,0)
     15
     16   wks = gsn_open_wks("png","sp_tmp")
     17   wks@wkWidth = 2500
     18   wks@wkHeight = 2500
     19   res = True
     20   res@gsnDraw = True
     21   res@gsnMaximize = True
     22   res@cnFillOn = True
     23   res@cnLinesOn = False
     24   res@gsnAddCyclic = False
     24   res@gsnAddCyclic = False
     25   res@mpMinLatF = 32.0
     26   res@mpMaxLatF = 44.0
     27   res@mpMinLonF = 110.0
     28   res@mpMaxLonF = 130.0
     29   res@mpDataBaseVersion="MediumRes"
     30   res@mpDataSetName="Earth..4"
     31   res@mpGeophysicalLineColor = "Black"
     32   res@mpNationalLineColor    = "Black"
     33   res@mpGridLineColor        = "Black"
     34   res@mpLimbLineColor        = "Black"
     35   res@mpPerimLineColor       = "Black"
     36   res@mpUSStateLineThicknessF     = 2
     37   res@mpNationalLineThicknessF    = 2
     38   res@mpUSStateLineColor="Black"
     39   res@mpOutlineSpecifiers="China:states"
     40 ;deal with x/y
     41   res@tmXBMode = "Explicit"
     42   res@tmXBValues = (/110,120,130/)
     43   res@tmYLMode = "Explicit"
     44   res@tmYLValues = (/35,40 /)
     45 ;adjst the fontsize of x/y
     46   res@tmXBLabelFontHeightF = 0.025
     47   res@tmYLLabelFontHeightF = 0.025
     48 ; adjust the fontsize of colorbar
     49   res@lbLabelFontHeightF  = 0.025
     50   plot = gsn_csm_contour_map(wks,tt,res)
     51 end
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2021-5-21 12:44:22 | 显示全部楼层

回帖奖励 +10 金钱

本帖最后由 green_tea789 于 2021-5-21 12:50 编辑
小其其格 发表于 2018-12-6 15:02
我在这个问题上卡了半个多月,最后发现是要先把经纬度插值到格点上

再选择绘图区域,就可以调整经纬度大 ...

可是我没用上面那段loc的,直接设置mapres的经纬度范围就可以了啊。
官网的例子也是不用设置的。
http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_map_overlays.shtml

密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2021-5-21 12:57:09 | 显示全部楼层
tianmeng 发表于 2019-1-24 10:00
1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
      2 load "$NCARG_ROOT/lib/ncar ...

用gsn画就每个变量都要设置@lat2d, 跟wrf_map_overlay相比,增加了很多代码量。
            tt@lat2d = lat2d
            tt@lon2d = lon2d
并且rcm2rgrid_Wrap那么复杂的操作其实是没有必要的。     
tt2 = rcm2rgrid_Wrap(lat2d,lon2d,tt,lat1d,lon1d,0)
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

新浪微博达人勋

发表于 2022-9-9 21:02:38 | 显示全部楼层
这个问题估计楼主早就解决了,前面的解决办法有点复杂
还是上来回复一下,免得自己忘记了
其实只要在脚本中加一句
mpres=wrf_map_resources(a,mpres);

plot0=gsn_csm_map(wks,mpres)
plot1=gsn_csm_contour(wks,XXX,res)
overlay(plot0,plot1)
画出来的图就可以了
不会是倒扇形
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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