爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 10010|回复: 4

获取了WRFout结果文件之后如何求取可降水量

[复制链接]
发表于 2015-3-13 16:27:56 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 janweis 于 2015-3-14 10:22 编辑

  各位大神好,实属新手,翻阅了很多文献之后发现都没有详细的教程,也没有一个切入点,在此特广发英雄帖,请求各路大神指点!(金钱不多,只能奖励1块了。谢谢)
问题:
  跟据WRF-ARW的wrf.exe获取了WRFout结果文件,如何利用后处理获取某个地点某一时刻的可降水量。
以往资料总结:
  1、在ARW的guide文档中只在两个地方提到了Precipitable water,一个实在讲NCL的wrf_user_getvar (nc_file, fld, it)工具时讲到了这一点,似乎只要将fld设为PW就好了,但是没有测试,主要是由于,不知道如何使用这个函数,文中有提到编写script,说明是可以使用的,求大神指导,
  2、在guide文档中另一处也提到了precipitable water ,是在讲GrADS的unipost中提到,这个比NCL中的似乎还要难得理解,但是很多帖子上都是使用的GrADS,在无敌泡《[脚本编辑]GRADS 计算大气可降水量》中提到了可以使用脚本的方法计算可降水量,hustlh的《关于可降水量单位问题》中讲解的更为详细,总结两帖都使用了'.nc'文件并采用了一个质量加权垂直积分函数vint,但是我并没有他们的.nc文件,这应当如何处理(这个已经解决在处理wrfout文件时,直接加上后缀就好)
求助:
  1、我想实现的东西应该很简单,我先用wrf作出了大范围的格网数据,而后利用格网数据获取某个地方的可降水量,这个思路不知道对不对,望指导。
      2、到底是选择使用NCL还是使用GrADS,反正这两个我都不会,哪一个都是从头开始,不过,我暂时只装了NCL(因为比较容易安装),望指导
  3、选择软件后,如何使用,谢谢感激不尽,这一点非常需要指导{:soso_e183:}(忘了,我不是想绘图,只是想获得一个数值)
       4、在NCL的介绍中出现了一个list of available diagnostics.如下,我的理解是,“这些diagnostics是小写的来与可直接从netCDF文件中的变量做区分”,他的fld是大小写敏感的,那么也就是说diagnostics对于我们来说是直接可以利用的,那么应该在wrfout文件中就应该已经有了这些diagnostics,还望大神指导,这是如何做到的?如何让wrfout文件中直接拥有这些diagnostic。在某帖中我看到有说修改registry的,可以直接在生成wrfout文件中获取,不知道是不是这样?{:soso_e183:}
function wrf_user_getvar (nc_file, fld, it)
      Usage: ter = wrf_user_getvar (a, “HGT”, 0)      
Get fields from a netCDF file for
        1. Any given time by setting it to the time required.
        2. For all times in the input(投入) file(s), by setting it = -1
        3. A list of times from the input file(s), by setting it to (/start_time,end_time,interval/) ( e.g. (/0,10,2/) ).
        4. A list of times from the         input(投入) file(s), by setting it to the list required ( e.g. (/1,3,7,10/) ).
        
        Any field available in the netCDF file can be extracted(萃取的).
        fld is case sensitive(敏感的). The policy(政策) adapted(适应) during development was to set all diagnostic(诊断的) variables(变量) calculated(计算) by NCL to lower-case(小写字母的) to distinguish(区分) them from fields directly available from the netCDF files.
List of available diagnostics:
      
avo: Absolute(绝对的) Vorticity [10-5 s-1]
        eth: Equivalent(等价的) PotentialTtemperature [K]
        cape_2d: Returns 2D fields mcape/mcin/lcl/lfc
              cape_3d
: Returns 3D fields cape(海角)/cin
              dbz
: Reflectivity [dBZ]
              mdbz
: Maximum Reflectivity [dBZ]
          geopt/geopotential
: Full Model Geopotential [m2 s-2]
          helicity: Storm Relative Helicity [m-2/s-2]
          lat
: Latitude  (will return either XLAT or XLAT_M, depending on which is available)
          lon
: Longitude (will return either XLONG or XLONG_M, depending on which is available)
          p/pres
: Full Model Pressure [Pa]
          pressure
: Full Model Pressure [hPa]
        pvo: Potential(潜能) Vorticity [PVU]
        pw: Precipitable Water
        rh2: 2m Relative Humidity [%]
        rh: Relative Humidity [%]
        slp
: Sea Level Pressure [hPa]
        ter: Model Terrain Height [m] (will return either HGT or HGT_M, depending on which is available)
        td2: 2m Dew Point Temperature [C]
        td: Dew Point Temperature [C]
        tc: Temperature [C]
        th/theta
: Potential(潜能) Temperature [K]
        tk: Temperature [K]
        times: Times in file (note this return   strings - recommended)
        Times: Times in file (note this return characters)
        updraft_helicity: Updraft Helicity [m-2/s-2]
        ua
: U component(成分) of wind on mass points
        va
: V component of wind on mass points
        wa
: W component of wind on mass points
        uvmet10: 10m U and V components of wind rotated(旋转的) to earth coordinates(坐标)
        uvmet
: U and V components of wind rotated to earth coordinates
        z/height
: Full Model Height [m]


密码修改失败请联系微信:mofangbao
 楼主| 发表于 2015-3-15 09:29:22 | 显示全部楼层
对于第四个问题,我在官网上找到了答案,他的dignogistic是可以直接使用的
wrf_user_getvar is modifiable by the user, if you want to add your own diagnostics. To add your own diagnostics:

    Copy the file "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" to your own directory.

    Edit this file with any UNIX editor and look for the lines:

    undef("wrf_user_getvar")
    function wrf_user_getvar( file_handle, varin
  • :string, time:integer )

        Before the final lines in this function:

          return(var)

        end

        Add these lines, replacing newvar as appropriate:

          if( variable .eq. "newvar" ) then
            . . . fill in code here . . .
          end if

        To use the new version of this function, you can do one of two things:

            Copy your modified script over "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" and use the new "wrf_user_getvar" with your new entry:

            load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
            xxx = wrf_usr_getvar(f,"XXX",0)

            Remove all but the modified "wrf_user_getvar" function from your copy, rename the function ("wrf_user_getvar2"), and rename the file ("my_new_script.ncl"). You will need to load the above script and your new script to use the new function:

            load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
            load "my_new_script.ncl"
            xxx = wrf_usr_getvar2(f,"XXX",0)

    wrf_user_getvar is part of a library of functions and procedures in WRFUserARW.ncl written to help users plot ARW WRF model data.

    Questions on this function should be sent to wrfhelp@ucar.edu.

    See Also

    wrf_user_getvar, wrf_user_ij_to_ll, wrf_user_intrp2d, wrf_user_intrp3d, wrf_user_list_times, wrf_user_ll_to_ij, wrf_user_unstagger

    See the full list of WRF functions.
    Examples

    Example 1

    Get variables from a single WRF ARW file:

      load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
      load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

      a = addfile("wrfout_d01_2000-01-24_12:00:00.nc","r")

      time = 1
      slp = wrf_user_getvar(a,"slp",time)  ; slp
      tc2 = wrf_user_getvar(a,"T2",time)   ; T2 in Kelvin
      u10 = wrf_user_getvar(a,"U10",time)  ; u at 10 m
      v10 = wrf_user_getvar(a,"V10",time)  ; v at 10 m

      ua  = wrf_user_getvar(a,"ua",time)   ; u on mass points
      va  = wrf_user_getvar(a,"va",time)   ; v on mass points

      avo = wrf_user_getvar(a,"avo",-1)    ; calculate avo for all times in file

    Example 2

    As of NCL V6.0.0, you can get a variable from a list of WRF ARW NetCDF files:

      load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
      load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

      files = systemfunc("ls -1 wrfout_d01_2000*") + ".nc"
      a = addfiles(files,"r")

      slp = wrf_user_getvar(a,"slp",-1)

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

    使用道具 举报

    发表于 2017-7-21 17:35:51 | 显示全部楼层
    我也看不懂……
    密码修改失败请联系微信:mofangbao
    发表于 2017-7-22 03:57:52 | 显示全部楼层
    RAINC+RAINNC
    密码修改失败请联系微信:mofangbao
    发表于 2018-2-25 02:55:37 | 显示全部楼层
    pwp=vint(surface pressure, qvapor, pressure top)
    密码修改失败请联系微信:mofangbao
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

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

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

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