<div dir="ltr"><div><div><div>Hi ncl-talk,<br><br></div>I&#39;m having issues with my script.  I&#39;m trying to plot a cross-sectional slice with a north to south latitude 36 to 40 at longitude -119.5.  When I run the script before ur_plane (where I specify the slice at -119.5) I do not get any errors.  PS.  This is a re-gridded wrf script. I have to re-grid it in order to plot the ageostrophic winds using the z2goeuv function.  Thank you very much in advance for your help.  It will be greatly appreciated.<br><br></div>I&#39;m trying to do an ageostrophic circulation cross-section;<br><br>I&#39;m getting the following error/s:<br><br>fatal:The result of the conditional expression yields a missing value. NCL can not determine branch, see ismissing function<br>fatal:[&quot;Execute.c&quot;:8578]:Execute: Error occurred at or near line 347 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl<br><br></div><div>My Script: <br>;======================================================================<br>; ESMF_regrid.ncl<br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl&quot;<br><br>;---Specify method to be used<br>    InterpMethod= &quot;patch&quot;<br><br>;---Input file<br>    srcDirName  = &quot;./&quot;<br>    srcFileName = &quot;wrfout_d01_2014-01-11_13:00:<a href="http://00.nc">00.nc</a>&quot;<br>    srcFilePath =  srcDirName + srcFileName<br>    <br>;---Wgt File: WRF to Rectilinear<br>    wgtDirName  = &quot;./&quot;<br>    wgtFileName = &quot;WRF_to_Rect.WgtFile_&quot;+InterpMethod+&quot;.nc&quot;<br>    wgtFilePath =  wgtDirName + wgtFileName<br><br>;---Retrieve either one level, or all levels. Use &#39;-1&#39; for all.<br>    sfile = addfile(srcFilePath,&quot;r&quot;)<br><br>    ua   = wrf_user_getvar(sfile,&quot;ua&quot;,0)    ; On mass grid <br>    va   = wrf_user_getvar(sfile,&quot;va&quot;,0)<br>    z    = wrf_user_getvar(sfile,&quot;z&quot;, 0)<br>    p    = wrf_user_getvar(sfile,&quot;pressure&quot;, 0)<br> <br>    printVarSummary(ua)                      ; (Time,bottom_top,south_north,west_east)<br>    printVarSummary(va)                      ; (Time,bottom_top,south_north,west_east)<br>    printVarSummary(z)<br>    printVarSummary(p)    <br><br>;---Regrid the wind components to a rectilinear grid<br>    ur   = ESMF_regrid_with_weights(ua,wgtFilePath,False)<br>    vr   = ESMF_regrid_with_weights(va,wgtFilePath,False)<br>    zr   = ESMF_regrid_with_weights(z,wgtFilePath, False)<br>    press   = ESMF_regrid_with_weights(p,wgtFilePath,False)<br> <br>    printVarSummary(ur)<br>    printVarSummary(vr)<br>    printVarSummary(zr)<br>    printVarSummary(press)<br>  <br><br>;---Compute the geostrophic winds  on the rectilinear grid<br>    lat2d = sfile-&gt;XLAT(0,:,:)               ; (south_north,west_east)<br>    lon2d = sfile-&gt;XLONG(0,:,:)<br><br>;---Generate the same rectilinear grid used to generate the weight file<br>    dims  = dimsizes(lat2d)<br>    nlat  = dims(0)<br>    nlon  = dims(1)<br><br>    lat = fspan(min(lat2d), max(lat2d) ,nlat)<br>    lon = fspan(min(lon2d), max(lon2d) ,nlon)<br><br>;---Calculate the geostrophic winds on a rectilinear grid<br>    uv = z2geouv(zr, lat, lon, 1)<br>    printVarSummary(uv)<br>    print(&quot;uv: min=&quot;+min(uv)+&quot;   max=&quot;+max(uv))<br><br>;----Calculate the geostrophic u wind component on a rectilinear grid<br>    u = uv(0,:,:,:)<br>    printVarSummary(u)<br>    print(&quot;u: min=&quot;+min(u)+&quot;   max=&quot;+max(u))<br><br>;----Calculate the geostrophic v wind component on a rectinlinear grid<br>   v = uv(1,:,:,:) <br>   printVarSummary(v)<br>   print(&quot;v:min=&quot;+min(v)+&quot;    max=&quot;+max(v))          <br><br>;---Calculate the u real wind comonent<br>;----------------------------------------------------------------------<br>  opt = True <br> plane = (/-119.5, 40.0 , -119.5, 36.0/)<br>  ur_plane = wrf_user_intrp3d(ur, press, &quot;v&quot;, plane, 0., opt)<br> ; vr_plane = wrf_user_intrp3d(vr, press, &quot;v&quot;, plane, 0., opt)<br> ; u_plane  = wrf_user_intrp3d(u, press,  &quot;v&quot;, plane, 0., opt)<br> ; v_plane  = wrf_user_intrp3d(v, press,  &quot;v&quot;, plane, 0., opt)<br><br>;uageo = ur_plane - u_plane<br>;vageo = vr_plane - v_plane<br><br>; create plots: Note some defaults chaanged in NCL v6.1.0<br>;************************************************<br>    wks_type = &quot;png&quot;<br>    wks_type@wkWidth = 2500<br>    wks_type@wkHeight = 2500  <br>   wks = gsn_open_wks(&quot;png&quot;,&quot;ESMF&quot;)<br>            <br>  gsn_define_colormap(wks,&quot;matlab_jet&quot;)     ; this is the default v6.1.0 onward<br><br>    <br>    res                      = True<br>    res@gsnDraw              = False           ; don&#39;t draw<br>    res@gsnFrame             = False           ; don&#39;t advance frame<br>    res@gsnAddCyclic         = False           ; regional data<br>  <br>   ; res@cnInfoLabelOn        = False           ; turn off cn info label<br>     res@cnFillOn             = False            ; turn on color<br>   ;res@cnFillMode           = &quot;RasterFill&quot;<br>    res@cnLinesOn            = False<br>    res@cnLineLabelsOn       = False<br>    res@lbLabelBarOn         = False           ; turn off individual cb&#39;s<br>    res@vcLineArrowThicknessF = 7.0<br>    res@vcRefMagnitudeF       = 10<br>    res@vcRefLengthF          = 0.018<br>    res@gsnLeftString         = &quot;&quot;<br>    res@gsnRightSting         = &quot;&quot;<br>    res@vcGlyphStyle          = &quot;LineArrow&quot;<br>    res@vcMinDistanceF        = 0.05<br>    res@vcRefAnnoOn           = False    <br><br><br><br><br>   ; res@cnLevelSelectionMode =  &quot;ManualLevels&quot;   <br>   ; res@cnMinLevelValF       = <br>   ; res@cnMaxLevelValF       =  <br>   ; res@cnLevelSpacingF      =   <br>    <br>   ; res@mpMinLatF            = min(lat2d)      ; range to zoom in on<br>   ; res@mpMaxLatF            = max(lat2d)<br>   ; res@mpMinLonF            = min(lon2d)<br>   ; res@mpMaxLonF            = max(lon2d)<br>    <br>;ageo = gsn_csm_vector(wks, uageo, vageo, res);<br><br>;draw(ageo)<br><br>;frame(wks)       <br><br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<br>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  <br><br><br></div>Variables outputs: <br><br>Variable: ua<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates:<br>Number Of Attributes: 6<br>  FieldType :   104<br>  MemoryOrder : XYZ<br>  description : x-wind component<br>  units :       m s-1<br>  stagger :<br>  coordinates : XLONG XLAT<br><br>Variable: va<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates:<br>Number Of Attributes: 6<br>  FieldType :   104<br>  MemoryOrder : XYZ<br>  description : y-wind component<br>  units :       m s-1<br>  stagger :<br>  coordinates : XLONG XLAT<br><br>Variable: z<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates:<br>Number Of Attributes: 6<br>  FieldType :   104<br>  MemoryOrder : XYZ<br>  description : Height<br>  units :       m<br>  stagger :<br>  coordinates : XLONG XLAT<br><br>Variable: p<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [south_north | 118] x [west_east | 114]<br>Coordinates:<br>Number Of Attributes: 6<br>  coordinates : XLONG XLAT<br>  stagger :<br>  units :       hPa<br>  description : Pressure<br>  MemoryOrder : XYZ<br>  FieldType :   104<br><br>Variable: ur<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates:<br>            lat: [17.94702911376953..57.1823844909668]<br>            lon: [-150.7183532714844..-89.28164672851562]<br>Number Of Attributes: 8<br>  _FillValue :  9.96921e+36<br>  FieldType :   104<br>  MemoryOrder : XYZ<br>  description : x-wind component<br>  units :       m s-1<br>  stagger :<br>  remap :       remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :       9.96921e+36<br><br>Variable: vr<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates:<br>            lat: [17.94702911376953..57.1823844909668]<br>            lon: [-150.7183532714844..-89.28164672851562]<br>Number Of Attributes: 8<br>  _FillValue :  9.96921e+36<br>  FieldType :   104<br>  MemoryOrder : XYZ<br>  description : y-wind component<br>  units :       m s-1<br>  stagger :<br>  remap :       remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :       9.96921e+36<br><br>Variable: zr<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates:<br>            lat: [17.94702911376953..57.1823844909668]<br>            lon: [-150.7183532714844..-89.28164672851562]<br>Number Of Attributes: 8<br>  _FillValue :  9.96921e+36<br>  FieldType :   104<br>  MemoryOrder : XYZ<br>  description : Height<br>  units :       m<br>  stagger :<br>  remap :       remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :       9.96921e+36<br><br>Variable: press<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [bottom_top | 50] x [lat | 118] x [lon | 114]<br>Coordinates:<br>            lat: [17.94702911376953..57.1823844909668]<br>            lon: [-150.7183532714844..-89.28164672851562]<br>Number Of Attributes: 8<br>  _FillValue :  9.96921e+36<br>  stagger :<br>  units :       hPa<br>  description : Pressure<br>  MemoryOrder : XYZ<br>  FieldType :   104<br>  remap :       remapped via ESMF_regrid_with_weights: Bilinear remapping<br>  missing_value :       9.96921e+36<br><br>Variable: uv<br>Type: float<br>Total Size: 5380800 bytes<br>            1345200 values<br>Number of Dimensions: 4<br>Dimensions and sizes:   [2] x [50] x [118] x [114]<br>Coordinates:<br>Number Of Attributes: 1<br>  _FillValue :  9.96921e+36<br>(0)     uv: min=-69.4722   max=81.5316<br><br>Variable: u<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [50] x [118] x [114]<br>Coordinates:<br>Number Of Attributes: 1<br>  _FillValue :  9.96921e+36<br>(0)     u: min=-27.5434   max=81.5316<br><br>Variable: v<br>Type: float<br>Total Size: 2690400 bytes<br>            672600 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [50] x [118] x [114]<br>Coordinates:<br>Number Of Attributes: 1<br>  _FillValue :  9.96921e+36<br>(0)     v:min=-69.4722    max=75.5611<br><br><br><br></div>