[gradsusr] How to calculate the velocity potential for a local domain ?

Jayakrishnan P.R prjayakrishnan at gmail.com
Fri Mar 1 05:20:50 EST 2013


Dear Arlindo,
                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.


** Srean fn and vel potential at 700 hPa over ME and Indian region
'reinit'
'sdfopen /media/JKPRMUSIC/JKPR/DATA/ncep/d/uvw/uwnd.2002.nc'

'sdfopen /media/JKPRMUSIC/JKPR/DATA/ncep/d/uvw/vwnd.2002.nc'

'set lev 700'
'define u1=ave(uwnd,time=1jan02,time=28feb02)'

'define v1=ave(vwnd.2,time=1jan02,time=28feb02)'


vars = '(u1,v1)'
*****************************************************
* Divervenge: enlarge x-domain to avoid grid undefs
* -------------------------------------------------
  xyrange()
  xmin = _xmin - 1;  xmax = _xmax + 1
  'set x ' xmin ' ' xmax
  'vort  = hcurl'vars
  'div  = hdivg'vars
* Reset x domain so that it is not x-wrapped
* ------------------------------------------
  xmin = _xmin;  xmax = _xmax
  'set x ' xmin ' ' xmax
*
* Stream Function
* ------------------
'psi1 = fish(vort)'
'psi=psi1-aave(psi1,global)'
* Velocity Potential
* ------------------
'chi1 = fish(div)'
'chi=chi1-aave(chi1,global)'
'rad=3.14159/180'
'dx=cdiff(lon,x)*rad*6.37e6*cos(lat*rad)'
'dy=cdiff(lat,y)*rad*6.37e6'
'uchi=cdiff(chi,x)/dx'
'vchi=cdiff(chi,y)/dy'
**********************************************
* Plotting
* .........
'set vpage 0 11 0 8.5'
'set parea 1 10 1 4.5'
'set mproj scaled'
'set map 1 1 7'
'set lon 0 70'
'set lat -10 50'
'set xlab on'
'set ylab on'
'set arrlab off'
'set gxout contour'
'set cint 5'
*'set ccolor 1'
'set grads off'
'd -1.e-5*psi'
* Plotting
* .........
'set grads off'
'set vpage 0 11 0 8.5'
'set parea 1 10 4.5 8'
'set mproj scaled'
'set map 1 1 7'
'set lon 0 70'
'set lat -10 50'
'set xlab off'
'set ylab on'
'set arrlab off'
'set gxout vector'
'set arrscl 0.5 5'
'set arrlab off'
*'set ccolor 1'
'set grads off'
'd uchi;vchi'
'set gxout contour'
'set cint 5'
'set grads off'
'd -1.e-5*chi'
'printim vpo2002_jf_1.png white'
'printim vpo2002_jf_1.eps white'

*****************************************************************
function xyrange()
      'q file'
      tmp = sublin ( result, 5 )
      _xmin = 1
      _xmax = subwrd(tmp,3)
      _ymin = 1
      _ymax = subwrd(tmp,6)
return*


-- 
Sincerely
***********************************************
Jayakrishnan.P.R
Teaching Associate (Atmospheric Science)
Academy of Climate Change Education and Research
Kerala Agricultural University
Vellanikkara-680 656

and also

Research Fellow (Part Time)
Department of Atmospheric Sciences
CUSAT, Cochin-682 016
Kerala, India.
Mob: 09496026547

***********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130301/b49b9c07/attachment-0003.html 


More information about the gradsusr mailing list