[ncl-talk] zonal_mpsi

Adam Phillips asphilli at ucar.edu
Fri Sep 9 10:10:01 MDT 2016


Hi Ipshita,
You are altering the order of your level dimension here:
v1=v_jan_1948(::-1,:,:)
and that is completely fine. However, you are then flipping the level
dimension again here when you specify v1&level:
zmpsi = zonal_mpsi(v1,v1&lat,v1&level(::-1),PsPa)

Try changing this:
zmpsi = zonal_mpsi(v1,v1&lat,v1&level(::-1),PsPa)
to this:
zmpsi = zonal_mpsi(v1,v1&lat,v1&level,PsPa)

If that does not fix the issue please add printVarSummary and print
statements to your script and examine the output. The end of your script
should look like this:
v1=v_jan_1948(::-1,:,:)
PsPa=ps_jan_1948*100
printVarSummary(v1)
print(v1&level)
zmpsi = zonal_mpsi(v1,v1&lat,v1&level,PsPa)

If you still are having trouble please respond to the ncl-talk email list
with the printVarSummary and print output.
Adam


On Thu, Sep 8, 2016 at 5:02 PM, Ipshita Majhi <ipmajhi at alaska.edu> wrote:

>
> Dear Users,
>
> I want to plot stream function of wind (v) and I am using zonal_mpsi to
> calculate the stream function. I keep getting error messages.
>
> fatal:zonal_mpsi: The pressure array must be between the values of 500 and
> 100500 (exclusive), and monotonically increasing.
>
> I am not sure how to fix this problem.
>
> I am attaching my code.
>
> I read in the V wind and surface pressure
>
> v-wind has 4 dimensions (time,lev,lat,lon)
>
> Surface pressure has 3 dimensions (time,lat,lon)
>
> Here is the code I wrote
>
> ;**************************************************************
> ;*******************************************
> 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"
> ;*******************************************
>
> ;********************************************
> ;This is to read wind speed and wind direction
> ;from 1948-2016
> ;********************************************
>
> a=addfile("/Users/ipshita/Documents/grads_NCL/wspd.mon.mean.nc","r")
> b=addfile("/Users/ipshita/Documents/grads_NCL/uwnd.mon.mean.nc","r")
> c=addfile("/Users/ipshita/Documents/grads_NCL/vwnd.mon.mean.nc","r")
> d=addfile("/Users/ipshita/Documents/grads_NCL/omega.mon.mean.nc","r")
> e=addfile("/Users/ipshita/Documents/grads_NCL/pres.sfc.mon.mean.nc","r")
>
> v=c->vwnd   ;Wind in horizontal direction in m/s
>
> level=c->level ;Pressure level from 1000hpa to 10 hpa
>
> lat=c->lat
>
> lon=c->lon
>
> ps=e->pres
>
> ps_jan_1948=ps(0,:,:)
>
> printMinMax(ps_1948_2015,False)
>
> v_jan_1948=v(0,:,:,:)
> ;*********************************************
> ;Going from low to high in terms of level
> ;*********************************************
>
> v1=v_jan_1948(::-1,:,:)
> ;*********************************************
> ;Converting Pressure into Pascals
> ;*********************************************
>
> PsPa=ps_jan_1948*100
>
> printMinMax(PsPa,False)
>
> ;*********************************************
> zmpsi = zonal_mpsi(v1,v1&lat,v1&level(::-1),PsPa)
> ;*******************************************************************
>
> I will be grateful if you can help me resolve this issue.
>
> Best Regards
> Ipshita
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160909/9139319d/attachment.html 


More information about the ncl-talk mailing list