<div dir="ltr">Hi Ipshita,<div>You are altering the order of your level dimension here:</div><div><span style="font-size:12.8px">v1=v_jan_1948(::-1,:,:) </span><br></div><div><span style="font-size:12.8px">and that is completely fine. However, you are </span><span style="font-size:12.8px">then flipping the level dimension again here when you specify v1&level:</span></div><div><span style="font-size:12.8px">zmpsi = zonal_mpsi(v1,v1&lat,v1&level(</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">::-1),PsPa)</span><span style="font-size:12.8px"><br></span></div><div><br></div><div>Try changing this:</div><div><span style="font-size:12.8px">zmpsi = zonal_mpsi(v1,v1&lat,v1&level(</span><wbr style="font-size:12.8px"><span style="font-size:12.8px">::-1),PsPa)</span><br></div><div><span style="font-size:12.8px">to this:</span></div><div><span style="font-size:12.8px">zmpsi = zonal_mpsi(v1,v1&lat,v1&level</span><span style="font-size:12.8px">,PsPa)</span><span style="font-size:12.8px"><br></span></div><div><br></div><div>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:</div><div><span style="font-size:12.8px">v1=v_jan_1948(::-1,:,:)</span><br></div><div><span style="font-size:12.8px">PsPa=ps_jan_1948*100</span><span style="font-size:12.8px"><br></span></div><div><div>printVarSummary(v1)</div><div>print(v1&level)</div></div><div><span style="font-size:12.8px">zmpsi = zonal_mpsi(v1,v1&lat,v1&level</span><span style="font-size:12.8px">,PsPa)</span><br></div><div><br></div><div>If you still are having trouble please respond to the ncl-talk email list with the printVarSummary and print output.</div><div>Adam</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 8, 2016 at 5:02 PM, Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div>Dear Users,</div><div><br></div><div>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.</div><div><br></div><div>fatal:zonal_mpsi: The pressure array must be between the values of 500 and 100500 (exclusive), and monotonically increasing.<br></div><div><br></div><div>I am not sure how to fix this problem.</div><div><br></div><div>I am attaching my code.</div><div><br></div><div>I read in the V wind and surface pressure</div><div><br></div><div>v-wind has 4 dimensions (time,lev,lat,lon)</div><div><br></div><div>Surface pressure has 3 dimensions (time,lat,lon)</div><div><br></div><div>Here is the code I wrote</div><div><br></div><div>;*****************************<wbr>******************************<wbr>***</div><div><div>;*****************************<wbr>**************</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"</div><div>load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"</div><div>;*****************************<wbr>**************</div><div><br></div><div>;*****************************<wbr>***************</div><div>;This is to read wind speed and wind direction</div><div>;from 1948-2016</div><div>;*****************************<wbr>***************</div><div><br></div><div>a=addfile("/Users/ipshita/<wbr>Documents/grads_NCL/<a href="http://wspd.mon.mean.nc" target="_blank">wspd.mon.<wbr>mean.nc</a>","r")</div><div>b=addfile("/Users/ipshita/<wbr>Documents/grads_NCL/<a href="http://uwnd.mon.mean.nc" target="_blank">uwnd.mon.<wbr>mean.nc</a>","r")</div><div>c=addfile("/Users/ipshita/<wbr>Documents/grads_NCL/<a href="http://vwnd.mon.mean.nc" target="_blank">vwnd.mon.<wbr>mean.nc</a>","r")</div><div>d=addfile("/Users/ipshita/<wbr>Documents/grads_NCL/<a href="http://omega.mon.mean.nc" target="_blank">omega.mon.<wbr>mean.nc</a>","r")</div><div>e=addfile("/Users/ipshita/<wbr>Documents/grads_NCL/<a href="http://pres.sfc.mon.mean.nc" target="_blank">pres.sfc.<wbr>mon.mean.nc</a>","r")</div><div><br></div><div>v=c->vwnd ;Wind in horizontal direction in m/s</div><div><br></div><div>level=c->level ;Pressure level from 1000hpa to 10 hpa</div><div><br></div><div>lat=c->lat</div><div><br></div><div>lon=c->lon</div><div><br></div><div>ps=e->pres</div><div><br></div><div>ps_jan_1948=ps(0,:,:)</div><div><br></div><div>printMinMax(ps_1948_2015,<wbr>False)</div><div><br></div><div>v_jan_1948=v(0,:,:,:)</div><div>;*****************************<wbr>****************</div><div>;Going from low to high in terms of level</div><div>;*****************************<wbr>****************</div><div><br></div><div>v1=v_jan_1948(::-1,:,:)</div><div>;*****************************<wbr>****************</div><div>;Converting Pressure into Pascals</div><div>;*****************************<wbr>****************</div><div><br></div><div>PsPa=ps_jan_1948*100</div><div><br></div><div>printMinMax(PsPa,False)</div><div><br></div><div>;*****************************<wbr>****************</div><div>zmpsi = zonal_mpsi(v1,v1&lat,v1&level(<wbr>::-1),PsPa)</div></div><div>;*****************************<wbr>******************************<wbr>********</div><div><br></div><div>I will be grateful if you can help me resolve this issue.</div><div><br></div><div>Best Regards</div><span class="HOEnZb"><font color="#888888"><div>Ipshita</div><div><div dir="ltr"><br></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><font color="#888888">Adam Phillips <br></font></span></div><span><font color="#888888">Associate Scientist, </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br></font></span></div></div><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </font></span></div><span><font color="#888888"></font></span><div><div><span><font color="#888888"><br></font></span><div><span><font color="#888888"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>