<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Henry,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Yes, I think your problem is that you are trying to use variables that are on different grids, as you suggested.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>(This would only work if one grid was a subset of the other.)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You can do calculations on these variables separately, but you can’t combine them (e.g. sum them).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Chances are that you will need to regrid some variables to get everything on the same grid. In GrADS, you can regrid using the regrid UDF (user defined function – only available with some versions of GrADS I think) or you could regrid using some other package outside of GrADS.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>(By the way, I notice your file #1 has different xsize and ysize from files #2 and 3, which might be fine, but check that this also doesn’t give you unexpected results.)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Doug<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> gradsusr-bounces@gradsusr.org [mailto:gradsusr-bounces@gradsusr.org] <b>On Behalf Of </b>Hang<br><b>Sent:</b> 26 January 2011 08:51<br><b>To:</b> gradsusr@gradsusr.org<br><b>Subject:</b> [gradsusr] Problem in loading variables in different files.<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Hi,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>I want to do some calculations using the values in different files but an error message was shown :<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'>Data Request Error: Invalid grid coordinates</span></em><i><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'> World coordinates convert to non-integer grid coordinates</span></em><br><em><span style='font-family:"Arial","sans-serif"'> Variable = vwnd10m Dimension = 1 </span></em><br><em><span style='font-family:"Arial","sans-serif"'>Operation Error: Error from ave function</span></em><br><em><span style='font-family:"Arial","sans-serif"'> Error ocurred at column 32</span></em><br><em><span style='font-family:"Arial","sans-serif"'>DEFINE error: Invalid expression.</span></em></span></i><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><u><span style='font-family:"Arial","sans-serif"'>The following are the main components of my script:</span></u><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'>'sdfopen /home2/h08hang/redata/uwnd10m.mon.mean.nc'</span></em><i><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'>'set lat -90 90'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'set lon 0 360'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'set t 1 753'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'define uwnd10m=uwnd'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'close 1'</span></em></span></i><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'>'sdfopen /home2/h08hang/redata/vwnd10m.mon.mean.nc'</span></em><i><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'>'set lat -90 90'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'set lon 0 360'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'set t 1 753'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'define vwnd10m=vwnd'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'close 1'</span></em></span></i><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'>'sdfopen /home2/h08hang/redata/shum2m.mon.mean.nc'</span></em><i><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'>'set lat -90 90'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'set lon 0 360'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'set t 1 753'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'define shum2m=shum'</span></em><br><em><span style='font-family:"Arial","sans-serif"'>'close 1'</span></em></span></i><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'>'sdfopen /home2/h08hang/redata/uwnd.mon.mean.nc'</span></em><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'>'sdfopen /home2/h08hang/redata/vwnd.mon.mean.nc'</span></em><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'>'sdfopen /home2/h08hang/redata/shum.mon.mean.nc'</span></em><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'>....</span></em><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'> </span></em><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'> lon1=112.5</span></em><i><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'> lon2=115</span></em><br><em><span style='font-family:"Arial","sans-serif"'> lat1=22.5</span></em><br><em><span style='font-family:"Arial","sans-serif"'> lat2=25</span></em></span></i><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><span style='font-family:"Arial","sans-serif"'> 'set lat 'lat1' 'lat2</span></em><i><span style='font-family:"Arial","sans-serif"'><br><em><span style='font-family:"Arial","sans-serif"'> 'set lon 'lon1</span></em><br><em><span style='font-family:"Arial","sans-serif"'> 'set t 'time</span></em><br><em><span style='font-family:"Arial","sans-serif"'> 'set lev 'level1</span></em></span></i><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><em><b><span style='font-family:"Arial","sans-serif"'> 'define wind=(ave(uwnd.1,lat='lat1',lat='lat2')+ave(uwnd10m,lat='lat1',lat='lat2'))/2'</span></b></em><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>For the first three files I opened (uwnd10m,vwnd10m,shum2m), the variables are uwnd,vwnd and shum respectively. I define three new variables to store them as their varable name crash with the next three file I am going to open. I close the each file after I have defined the new variables (for the first three files)<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>For the next three files I opened,<strong><span style='font-family:"Arial","sans-serif"'> </span></strong>they have a <strong><span style='font-family:"Arial","sans-serif"'>different Grids</span></strong> as shown below.<strong><span style='font-family:"Arial","sans-serif"'> Is this the reason why I cannot run my script, or something else?</span></strong><o:p></o:p></span></p></div><div><p class=MsoNormal><strong><span style='font-family:"Arial","sans-serif"'>But what I want is to use the values from different files (those with different Grids to do my calculation) How can I solve this? </span></strong><span style='font-family:"Arial","sans-serif"'><o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Can anyone give me some help? Thanks a lot (and sorry for the lengthy question)<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>File 1 : NCEP Reanalysis monthly ltm surface pressure<br> Descriptor: /home2/h08hang/redata/pres.mon.mean.nc<br> Binary: /home2/h08hang/redata/pres.mon.mean.nc<br> Type = Gridded<br><strong><span style='font-family:"Arial","sans-serif"'> Xsize = 144 Ysize = 73 Zsize = 1 Tsize = 756 Esize = 1</span></strong><b><br></b> Number of Variables = 1<br> pres 0 -103 Monthly Mean of Surface Pressure<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>File 2 : monthly mean u wind<br> Descriptor: /home2/h08hang/redata/uwnd10m.mon.mean.nc<br> Binary: /home2/h08hang/redata/uwnd10m.mon.mean.nc<br> Type = Gridded<br><strong><span style='font-family:"Arial","sans-serif"'> Xsize = 192 Ysize = 94 Zsize = 1 Tsize = 756 Esize = 1</span></strong><b><br></b> Number of Variables = 1<br> uwnd 0 -103 Monthly Mean of U-Wind<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>File 3 : monthly mean u wind<br> Descriptor: /home2/h08hang/redata/vwnd10m.mon.mean.nc<br> Binary: /home2/h08hang/redata/vwnd10m.mon.mean.nc<br> Type = Gridded<br><strong><span style='font-family:"Arial","sans-serif"'> Xsize = 192 Ysize = 94 Zsize = 1 Tsize = 756 Esize = 1</span></strong><b><br></b> Number of Variables = 1<br> vwnd 0 -103 Monthly Mean V wind at 10 m<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>File 4 : monthly mean u wind from the NCEP Reanalysis<br> Descriptor: /home2/h08hang/redata/uwnd.mon.mean.nc<br> Binary: /home2/h08hang/redata/uwnd.mon.mean.nc<br> Type = Gridded<br><strong><span style='font-family:"Arial","sans-serif"'> Xsize = 144 Ysize = 73 Zsize = 17 Tsize = 751 Esize = 1</span></strong><b><br></b> Number of Variables = 1<br> uwnd 17 -103 Monthly mean u wind<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>File 5 : monthly mean v wind from the NCEP Reanalysis<br> Descriptor: /home2/h08hang/redata/vwnd.mon.mean.nc<br> Binary: /home2/h08hang/redata/vwnd.mon.mean.nc<br> Type = Gridded<br><strong><span style='font-family:"Arial","sans-serif"'> Xsize = 144 Ysize = 73 Zsize = 17 Tsize = 751 Esize = 1</span></strong><b><br></b> Number of Variables = 1<br> vwnd 17 -103 Monthly mean v wind<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>File 6 : 4x daily NMC reanalysis<br> Descriptor: /home2/h08hang/redata/shum.mon.mean.nc<br> Binary: /home2/h08hang/redata/shum.mon.mean.nc<br> Type = Gridded<br><strong><span style='font-family:"Arial","sans-serif"'> Xsize = 144 Ysize = 73 Zsize = 8 Tsize = 752 Esize = 1</span></strong><b><br></b> Number of Variables = 1<br> shum 8 -103 Monthly Mean of Specific Humidity<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'> <o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-family:"Arial","sans-serif"'>Best,<br>Henry<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p></div><br />--
<br />This message (and any attachments) is for the recipient only. NERC
<br />is subject to the Freedom of Information Act 2000 and the contents
<br />of this email and any reply you make may be disclosed by NERC unless
<br />it is exempt from release under the Act. Any material supplied to
<br />NERC may be stored in an electronic records management system.</body></html>