Dear Arlindo,<br> I herewith attach another script from my archives which compute velocity potential and stream function over indian region. Just try it and may be useful. Best of Luck.<br><br><br><b>* Srean fn and vel potential at 700 hPa over ME and Indian region<br>
'reinit'<br>'sdfopen /media/JKPRMUSIC/JKPR/DATA/ncep/d/uvw/<a href="http://uwnd.2002.nc">uwnd.2002.nc</a>'<br><br>'sdfopen /media/JKPRMUSIC/JKPR/DATA/ncep/d/uvw/<a href="http://vwnd.2002.nc">vwnd.2002.nc</a>'<br>
<br>'set lev 700'<br>'define u1=ave(uwnd,time=1jan02,time=28feb02)'<br><br>'define v1=ave(vwnd.2,time=1jan02,time=28feb02)'<br><br><br>vars = '(u1,v1)'<br>*****************************************************<br>
* Divervenge: enlarge x-domain to avoid grid undefs<br>* -------------------------------------------------<br> xyrange()<br> xmin = _xmin - 1; xmax = _xmax + 1<br> 'set x ' xmin ' ' xmax <br> 'vort = hcurl'vars<br>
'div = hdivg'vars<br>* Reset x domain so that it is not x-wrapped<br>* ------------------------------------------<br> xmin = _xmin; xmax = _xmax <br> 'set x ' xmin ' ' xmax <br>*<br>* Stream Function<br>
* ------------------<br>'psi1 = fish(vort)'<br>'psi=psi1-aave(psi1,global)'<br>* Velocity Potential<br>* ------------------<br>'chi1 = fish(div)'<br>'chi=chi1-aave(chi1,global)'<br>'rad=3.14159/180'<br>
'dx=cdiff(lon,x)*rad*6.37e6*cos(lat*rad)'<br>'dy=cdiff(lat,y)*rad*6.37e6'<br>'uchi=cdiff(chi,x)/dx'<br>'vchi=cdiff(chi,y)/dy'<br>**********************************************<br>* Plotting<br>
* .........<br>'set vpage 0 11 0 8.5'<br>'set parea 1 10 1 4.5'<br>'set mproj scaled'<br>'set map 1 1 7'<br>'set lon 0 70'<br>'set lat -10 50'<br>'set xlab on'<br>'set ylab on'<br>
'set arrlab off'<br>'set gxout contour'<br>'set cint 5'<br>*'set ccolor 1'<br>'set grads off'<br>'d -1.e-5*psi'<br>* Plotting<br>* .........<br>'set grads off'<br>'set vpage 0 11 0 8.5'<br>
'set parea 1 10 4.5 8'<br>'set mproj scaled'<br>'set map 1 1 7'<br>'set lon 0 70'<br>'set lat -10 50'<br>'set xlab off'<br>'set ylab on'<br>'set arrlab off'<br>
'set gxout vector'<br>'set arrscl 0.5 5'<br>'set arrlab off'<br>*'set ccolor 1'<br>'set grads off'<br>'d uchi;vchi'<br>'set gxout contour'<br>'set cint 5'<br>
'set grads off'<br>'d -1.e-5*chi'<br>'printim vpo2002_jf_1.png white'<br>'printim vpo2002_jf_1.eps white'<br><br>*****************************************************************<br>function xyrange()<br>
'q file'<br> tmp = sublin ( result, 5 )<br> _xmin = 1<br> _xmax = subwrd(tmp,3)<br> _ymin = 1<br> _ymax = subwrd(tmp,6)<br>return</b><br><br><br>-- <br>Sincerely<br>***********************************************<br>
Jayakrishnan.P.R<br>Teaching Associate (Atmospheric Science)<br>Academy of Climate Change Education and Research<br>Kerala Agricultural University<br>Vellanikkara-680 656<br><br>and also<br><br>Research Fellow (Part Time)<br>
Department of Atmospheric Sciences<br>CUSAT, Cochin-682 016<br>Kerala, India.<br>Mob: 09496026547<br><br>***********************************************