[ncl-talk] Help with wrf_user_intrp3d

Bill Ladwig ladwig at ucar.edu
Tue Feb 16 09:36:39 MST 2016


Your "loc" argument is incorrect (4th argument).  This variable can only
contain up to 4 values if doing a vertical cross section, but in your case
you are doing horizontal interpolation, so this variable should just be a
single scalar.  That argument should be the value 2.0.  If I'm reading your
example correctly, it looks to me like you're trying to get the pressure
values at 2m AGL.  To do this, you would want to subtract the terrain from
your z values to get z in AGL.  Then, use that variable as your vertical
coordinate argument.

For example,

z_agl = z - Zter

pat2m = wrf_user_interp3d(p, z_agl, "h", 2.0, 0, False)

However, WRF already contains the surface pressure variable "PSFC", so you
can just use that if you are trying to get the surface pressure.

Hope this helps,

Bill

On Sat, Feb 13, 2016 at 1:25 AM, Krishna C <chandrakrishna.90 at gmail.com>
wrote:

> Hi all,
>
> Following script  i used to get pressure at 2m height from wrf out file
> Its throwing some error .
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *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/WRF_contributed.ncl"   load
> "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"begin a =
> addfile("input.nc <http://input.nc>","r")Zter = wrf_user_getvar(a,"ter" ,
> 0) ;m Terrain Heighttime = 0p = wrf_user_getvar(a,"pressure",time)    z  =
> wrf_user_getvar(a,"z",time)   height = Zter + 2.0 ; 2m height pat2m =
> wrf_user_intrp3d(p,z,"h",height,0.,False)end*
> Error message:
>  Copyright (C) 1995-2014 - All Rights Reserved
>  University Corporation for Atmospheric Research
>  NCAR Command Language Version 6.2.1
>  The use of this software is governed by a License Agreement.
>  See http://www.ncl.ucar.edu/ for more details.
> fatal:_NclBuildArray: each element of a literal array must have the same
> dimension sizes, at least one item doesn't
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 235 in
> file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 17 in
> file p2m.ncl
>
>
> Regards
> -Krishna-
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160216/e72eaa9e/attachment.html 


More information about the ncl-talk mailing list