<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000'>Hi Muhammad,<div><br></div><div>I think there are two issues here, but the problem might not be caused by either of them. First, you close file 1 after defining a variable. I don't think this is a good idea, since it leaves grads without a default file and the subsequent behavior of grads might be strange or incorrect (I ran into something like this in the past). Similarly, if there are several files open, the current default file should not be closed, for the same reason (e.g. if you have 'set dfile 2', don't close file 2 until you've set the default file to something other than 2). In your script, you should leave file 1 open and use 2,3,4 to refer to the files you open later.</div><div><br></div><div>There is also an error in the calculation. The vertically integrated moisture transport is NOT equal to the product of the vertical integrals of wind and moisture. You need to calculate it this way:</div><div><br></div><div>'define zon=vint(surfpres,shum.2*uwnd.3,500)'</div><div>'define mer=vint(surfpres,shum.2*vwnd.4,500)'</div><div><br></div><div>Best regards,</div><div><br><br><div><span name="x"></span>Eric L. Altshuler<br>Research Scientist<br>Center for Ocean-Land-Atmosphere Studies<br>253 Research Hall, Mail Stop 6C5<div>George Mason University</div><div>4400 University Drive<br>Fairfax, VA 22030 USA<br><br>E-mail: ela@cola.iges.org<br>Phone: (703) 993-5725<br>Fax: (703) 993-5770</div><span name="x"></span><br></div><br><hr id="zwchr"><b>From: </b>"Muhammad Latif" &lt;latif_space@yahoo.com&gt;<br><b>To: </b>gradsusr@gradsusr.org<br><b>Sent: </b>Friday, May 9, 2014 4:06:19 PM<br><b>Subject: </b>[gradsusr] Vertical Integrated Moisture Transport (VIMT)<br><br><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div class="" style="">Hi all,</div><div class="" style=""><br class="" style=""></div><div class="" style="">I am trying to calculate Vertical Integrated Moisture Transport (VIMT) from surface to 500 hPa in units of kg/m/sec using grads function "vint(psexpr,expr,top)" only on the one time step.</div><div class="" style="">I used the following script to get VIMT:</div><div class="" style=""><br class="" style=""></div><div class="" style=""><span style="font-size: 12pt;">'sdfopen spr-daily.nc' &nbsp; &nbsp; &nbsp; &nbsp; ;* spr is the surface pressure in Pa.</span><br></div><div class="" style="">'set time 20jun1970'</div><div class="" style="">'define surfpres=pres/100' &nbsp; &nbsp; ;* /100 to convert in hPa</div><div class="" style="">'close 1'</div><div class="" style=""><br class="" style=""></div><div class="" style="">'sdfopen shum-daily.nc'</div><div class="" style="">'sdfopen uwnd-daily.nc'</div><div class="" style="">'sdfopen vwnd-daily.nc'</div><div class="" style=""><br class="" style=""></div><div class="" style="">'set lat 0 45'</div><div class="" style="">'set lon 50 100'</div><div class="" style=""><br class="" style=""></div><div class="" style="">'set time 20jun1970'</div><div class="" style="">'define vintq=vint(surfpres,shum.1,500)' &nbsp; &nbsp; ;*shum is the specific humidity in kg/kg</div><div class="" style="">'define vintu=vint(surfpres,uwnd.2,500)' &nbsp; &nbsp; ;*uwnd is the u component of wind in m/sec</div><div class="" style="">'define vintv=vint(surfpres,vwnd.3,500)' &nbsp; &nbsp; ;*vwnd is the v component of wind in m/sec</div><div class="" style="">'define zon=(vintq*vintu)'</div><div class="" style="">'define mer=(vintq*vintv)'</div><div class="" style=""><br class="" style=""></div><div class="" style="">'set gxout vector'</div><div class="" style="">'d zon;mer'</div><div class="" style=""><br class="" style=""></div><div class="" style="">Script runs successfully showing VIMT, but the magnitude of vector appears (4e+06) in the vector scale bar.</div><div class="" style="">I guess, this magnitude is not right. The value should lie around 20 or 40 (kg/m/sec).&nbsp;</div><div class="" style=""><br class="" style=""></div><div class="" style="">I'll be very thankful if anyone could help me to sort out the issue mentioned above.</div><div class="" style=""><br class="" style=""></div><div class="" style="">Regards</div><div class="" style=""><br class="" style=""></div><div class="" style="">Muhammad Latif</div><div class="" style="">PhD Scholar</div><div class="" style="">Department of Meteorology</div><div class="" style="">CIIT, Islamabad&nbsp;</div><div class="" style=""><br class="" style=""></div></div><br>_______________________________________________<br>gradsusr mailing list<br>gradsusr@gradsusr.org<br>http://gradsusr.org/mailman/listinfo/gradsusr<br></div></div></body></html>