Re: Moisture flux convergence

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Jun 11 2014 - 08:41:06 MDT

The 'uv2dvG_Wrap' etc functions/procedures use spherical harmonics. The
spherical harmonic based functions do not allow for missing values. Check
your data input data for _FillValue. [The values do not need to be -999.]
My speculation is that the level at which you are doing the interpolation
(eg: 850 mb) has _FillValue over areas of high terrain (Rockies, Himalayas,
etc)



On Wed, Jun 11, 2014 at 8:27 AM, Melissa Lazenby <M.Lazenby@sussex.ac.uk>
wrote:

> Hi all
>
> I am trying to look at the moisture flux convergence by using the example
> from http://www.ncl.ucar.edu/Applications/wind.shtml wind_3.ncl
>
> I have got the following errors and do not know how to correct for them.
>
> warning:uv2dvG: 1872 2-dimensional input array(s) contained missing
> values. No interpolation performed on these arrays
> warning:ilapsG: 1872 2-dimensional input array(s) contained missing
> values. No interpolation performed on these arrays
> warning:dv2uvg: 1872 2-dimensional input array(s) contained missing
> values. No interpolation performed on these arrays
> warning:VectorPlotInitialize: no valid values in vector field; VectorPlot
> not possible:[errno=1101]
> warning:ContourPlotInitialize: no valid values in scalar field;
> ContourPlot not possible:[errno=1101]
> warning:VectorPlotSetValues: no valid values in vector field; VectorPlot
> not possible:[errno=1101]
> warning:ContourPlotSetValues: no valid values in scalar field; ContourPlot
> not possible:[errno=1101]
> warning:StreamlinePlotInitialize: no valid values in vector field;
> StreamlinePlot not possible:[errno=1101]
>
> I just want to make sure I have the correct input. I have used ua and va
> winds.
>
> Below is my code,
>
> Many thanks!
>
> Kind Regards
> Melissa
>
> ;*************************************************
> ; wind_3.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/csm/contributed.ncl"
> ;*************************************************
> begin
> ;*************************************************
> ; open file and read in data: data are on a gaussian grid
> ;*************************************************
> f = addfile
> ("/research/geog/data2/DATA/ipcc/monthly/ar5/pcmdi/historical/ua/ua_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc",
> "r")
>
> g = addfile
> ("/research/geog/data2/DATA/ipcc/monthly/ar5/pcmdi/historical/va/va_Amon_ACCESS1-0_historical_r1i1p1_185001-200512.nc",
> "r")
>
> u1 = f->ua ; (time,lat,lon)
> v1 = g->va
>
> u1@_FillValue = -999
> v1@_FillValue = -999
>
> u = u1(:,2,:,:)
> v = v1(:,2,:,:)
>
>
>
> printVarSummary(u)
> printVarSummary(v)
>
> ;*************************************************
> ; calculate divergence on a gaussian grid
> ;*************************************************
> div = uv2dvG_Wrap(u,v) ; u,v ==> divergence
>
> ;*************************************************
> ; calculate velocity potential
> ;*************************************************
> chi = ilapsG_Wrap ( div , 0)
> chi = (/chi/1e6/) ; arbitrary scale
> chi@long_name = "velocity potential"
> chi@units = "m/s"
> ;*************************************************
> ; calculate divergent wind component
> ; --
> ; note: the calculation uses a procedure, so memory
> ; must be preallocated.
> ;*************************************************
> ud = new ( dimsizes(u), typeof(u), u@_FillValue )
> vd = new ( dimsizes(v), typeof(v), v@_FillValue )
>
> dv2uvg(div,ud,vd) ; div ==> divergent wind components
>
> copy_VarCoords(u, ud )
> copy_VarCoords(u, vd )
> ud@long_name = "Zonal Divergent Wind"
> ud@units = u@units
> vd@long_name = "Meridional Divergent Wind"
> vd@units = v@units
> ;*************************************************
> ; plot results
> ;*************************************************
> wks = gsn_open_wks("X11","wind") ; open a workstation
>
> gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; choose colormap
> res = True
>
>
> res@cnFillOn = True ; color on
> res@cnLinesOn = False ; turn off contour lines
> res@gsnScalarContour = True ; vectors over contours
> res@gsnSpreadColors = True ; use full colormap
> res@gsnSpreadColorEnd = -4 ; last color used
>
>
> res@vcRefMagnitudeF = 3. ; make vectors larger
> res@vcRefLengthF = 0.050 ; ref vector length
> res@vcGlyphStyle = "CurlyVector" ; turn on curly vectors
> res@vcMinDistanceF = 0.012 ; thin the vectors
> res@vcRefAnnoOrthogonalPosF = -0.13 ; Move ref anno into plot
> ;
> ; This is not necessary in V6.1.0 and later. Named colors can
> ; be used without having to first add them to the color map.
> ;
> i = NhlNewColor(wks,0.7,0.7,0.7) ; add gray to colormap
> res@mpLandFillColor = "gray" ; change continent color
>
> res@tiMainString = "Velocity Potential via Spherical Harmonics"
> res@gsnCenterString = "Chi scaled by 1e6"
> res@gsnLeftString = "Divergent Wind"
>
> plot=gsn_csm_vector_scalar_map_ce(wks,ud(0,:,:),vd(0,:,:),chi(0,:,:),res)
> end
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

Received on Wed Jun 11 02:41:17 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT