# [ncl-talk] zonal_mpsi

Thu Sep 8 17:02:04 MDT 2016

```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

;**************************************************************
;*******************************************
;*******************************************

;********************************************
;This is to read wind speed and wind direction
;from 1948-2016
;********************************************

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160908/78b1a0a2/attachment.html
```