<div>Dear GrADS-users,<BR>I am trying to write a script for calculating diabatic heating.<BR>Actually, it can be computed from the thermodynamic equation.<BR>It is consist of three following terms: <BR>''(dtheta/dt)+(u*dtheta/dx+v*dtheta/dy)-(omega*dtheta/dp)''<BR>I have written a script and it seems that I have succeeded to compute terms 1 and 2 but somthing is wrong with term3.</div>  <div>As I am not sure about their accuracy, would somebody please help me and check if the script is correct for terms 1 and 2? <BR>and also,<BR>I have really appreciate any help to make a correction of term3.</div>  <div>Sorry for long note and thank you very much for your time.<BR>Azar Zarrin</div>  <div><BR>'reinit'<BR>*****opening four files (NCEP/NCAR DAILY MEAN) of air temprature,u,v and omega. <BR>'sdfopen airtemp.nc'<BR>'sdfopen uwind.nc'<BR>'sdfopen vwind.nc'<BR>'sdfopen omega.nc'</div>  <div>'PP = lev'<BR>'set lat 0 50'<BR>'set lon 400 480'<BR>'set lev 1000 100'<BR>'set t 2'</div>
 <div>"define Term1 = (air(t-1)*pow(1000/PP(t-1),0.286)-air*pow(1000/PP,0.286)))/24"<BR>'set lat 32.5'<BR>'set zlog on'<BR>'d Term1'</div>  <div>say 'hit return to continue and plot'<BR>pull cmd<BR>'c'</div>  <div>'set lat 0 50'<BR>'set lon 400 480'<BR>'set lev 1000 100'<BR>'set t 2'<BR>'define pt=air+273.15*pow(1000/PP,0.286)'<BR>"dptx =(cdiff(pt,x))"<BR>"dpty =(cdiff(pt,y))"<BR>'set dfile 2'<BR>'u = uwnd'<BR>"dux =(cdiff(u,x))"<BR>'set dfile 3'<BR>'v=vwnd'<BR>"dvy =(cdiff(v,y))"<BR>'dx = cdiff(lon,x)*cos(lat*3.14/180)*111325'<BR>"dy =cdiff(lat,y)*55445"<BR>'define Term2 = (pt*(dux/dx))+(pt*(dvy/dy))'<BR>'set lat 32.5'<BR>'set zlog on'<BR>'d Term2'</div>  <div><BR>say 'hit return to continue and plot'<BR>pull cmd<BR>'c'</div>  <div>'set lat 0 50'<BR>'set lon 400 480'<BR>'set lev 1000 100'<BR>'set t 2'<BR>'set dfile 1'<BR>"define Term3=(air(z-1)*pow(1000/PP(z-1),0.286)-air(z+1)*pow(1000/PP(z+1),0.286)))/(PP(z-1)-PP(z+1))"<BR>'set lat 32.5'<BR>'set zlog on'<BR>'d
 Term3'<BR>say error.....<BR>Cannot plot data - all undefined values.</div>  <div>----------------------------------------------------------------<BR>Azar Zarrin<BR>Geography Dept.<BR>Tarbiat Modares University<BR>Tehran, Iran</div>  <div>&nbsp;</div><p>&#32;
      <hr size=1>Need a vacation? <a href="http://us.rd.yahoo.com/evt=48256/*http://travel.yahoo.com/;_ylc=X3oDMTFhN2hucjlpBF9TAzk3NDA3NTg5BHBvcwM1BHNlYwNncm91cHMEc2xrA2VtYWlsLW5jbQ--">Get great deals
to amazing places </a>on Yahoo! Travel.