爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 36444|回复: 33

[其他] ncl计算整层水汽通量

[复制链接]
发表于 2015-4-16 21:35:38 | 显示全部楼层 |阅读模式

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

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

x
ncl绘制整层水汽通量的例子较少,特把写的代码贴出来,请大家帮助完善或者是指出问题,共同进步



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/wrf/WRFUserARW.ncl"
  load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

  begin
  a = addfile("/public3/home/interior/careeri/huser037/WRF/WRFV3S/run/wrfout_d02_2010-06-29_00:00:00","r")
   wks = gsn_open_wks("pdf","test1")

   au = wrf_user_getvar(a,"ua",(/47,263,1/))   ; U component of the wind at 10m
  av = wrf_user_getvar(a,"va",(/47,263,1/))   ; V component of the wind at 10m
  at = wrf_user_getvar(a,"tk",(/47,263,1/))   ; tk component of the wind at 10m
  arh = wrf_user_getvar(a,"rh",(/47,263,1/))   ; rh component of the wind at 10m
  ap  = wrf_user_getvar(a,"pressure",(/47,263,1/))
  p  = wrf_user_getvar(a,"pressure",48)
  sap  = wrf_user_getvar(a,"slp",(/48/))
  linlog=1
  pbot=1001

  printVarSummary(ap)
  printVarSummary(sap)
  sq=mixhum_ptrh(ap,at,arh,-2)
  mflux=sqrt(au^2+av^2)*sq/9.8
  printVarSummary(mflux)
  avg_flux=dim_avg_n_Wrap(mflux,0)
  avg_flux!0="lev"
  avg_flux!1="lat"
  avg_flux!2="lon"
  p!0="lev"
  p!1="lat"
  p!2="lon"
  printVarSummary(avg_flux)
  printVarSummary(p)
  ptop=min(p)
  psfc=sap
  ;csap=conform(p,sap,(/1,2/))
  ;printVarSummary(csap)
  vint = vibeta(p(lat|:,lon|:,lev|:),avg_flux(lat|:,lon|:,lev|:),linlog,psfc,pbot,ptop)
  printVarSummary(vint)
      
      res=True                  
      opts = res                          
      opts@cnFillOn = True  
      opts@pmLabelBarOrthogonalPosF = -0.1
      ;opts@ContourParameters = (/ 10., 90., 10./)
      opts@cnFillColors = (/"White","White","White", \
                              "Chartreuse","Chartreuse2","Green",\
                              "Green3","Green4", \
                              "ForestGreen","PaleGreen4"/)
      contour_psl = wrf_contour(a,wks,vint,opts)
      delete(opts)
  
     pltres = True                              ; Set plot options
     mpres = True                               ; Set map options
     mpres@mpDataBaseVersion="MediumRes"
     mpres@mpDataSetName="Earth..4"
     mpres@mpOutlineSpecifiers=(/"China:states"/)
   
   
    ; MAKE PLOTS                                       
      plot = wrf_map_overlays(a,wks,(/contour_psl/),pltres,mpres)
  


  end    希望大家指出问题,帮忙改正,此程序是绘制整层水汽通量
密码修改失败请联系微信:mofangbao
发表于 2015-4-16 22:27:49 | 显示全部楼层
谢谢楼主分享
密码修改失败请联系微信:mofangbao
发表于 2015-4-21 10:51:05 | 显示全部楼层
请问楼主,这个数组是什么意思(/47,263,1/))  。
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-4-21 15:51:22 | 显示全部楼层
随便选择的几个时间
密码修改失败请联系微信:mofangbao
发表于 2015-5-12 10:30:47 | 显示全部楼层
楼主为啥要做通量的平均值呢?
密码修改失败请联系微信:mofangbao
发表于 2015-9-29 11:18:48 | 显示全部楼层
感谢分享学习
密码修改失败请联系微信:mofangbao
发表于 2015-9-30 14:28:26 | 显示全部楼层
为什么用的是10m的UV分量
密码修改失败请联系微信:mofangbao
发表于 2015-12-23 16:41:26 | 显示全部楼层
感谢分享,学习学习
密码修改失败请联系微信:mofangbao
发表于 2015-12-31 15:38:19 | 显示全部楼层
{:5_235:}{:5_235:}{:5_235:}{:5_235:}
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

发表于 2015-12-31 15:40:43 | 显示全部楼层
楼主请问rh是从wrfout读出的吗,不记得wrfout可以输出这个量啊
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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