<div dir="ltr"><div>Hi Atiqah,<br><br>You'll need to first define zICnew so that it only varies in time, not space. Then you set x and y to a larger spatial domain and run tcorr.<br></div><div>See the tcorr example on calculating the El Nino index: <a href="http://www.iges.org/grads/gadoc/gadocindex.html">http://www.iges.org/grads/gadoc/gadocindex.html</a><br></div><div><br>You can modify it to work with your dataset. For example, try adding these lines in your script:<br></div><div><div><br><div>* Correlation;</div><div>* ===========</div><div>*</div>'set t 5 417'<br></div><div>'set x 1'<br></div><div>'set y 1'<br></div><div>'define zICnew1D = aave(zICnew,lon=-160,lon=-80,lat=-10,lat=10)' <-- these are the lon and lat domains of the ENSO index - you should change them for what you want<br></div><div><br></div><div><div>'set lon 80 200'</div><div>'set lat -90 28'<br></div><div>'set t 1'<br></div><div> 'define corr=tcorr(zICnew1D,zMHnew,t=5,t=417)'</div><div dir="ltr"> 'd corr'</div><br></div><div>Best, Andrew<br></div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:verdana,helvetica,sans-serif;font-size:13px"><div><div class="h5"><br><div><br><br></div><div style="display:block"> <div style="font-family:verdana,helvetica,sans-serif;font-size:13px"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"> <div dir="ltr"> <font face="Arial" size="2"> On Wednesday, June 3, 2015 4:53 PM, Andrew Friedman <<a href="mailto:andfried@gmail.com" target="_blank">andfried@gmail.com</a>> wrote:<br> </font> </div> <br><br> <div><div><div><div dir="ltr"><div><div>Hi Atiqah,<br clear="none"><br clear="none"></div>I think one problem is that zICnew varies in space and time, but the first argument of tcorr can only vary in time. <br clear="none"><br clear="none"></div>Andrew<br clear="none"></div><div><br clear="none"><div>On Tue, Jun 2, 2015 at 8:52 AM, syairah atiqah atiq <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:syairahatiqah@yahoo.com" target="_blank">syairahatiqah@yahoo.com</a>></span> wrote:<br clear="none"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:verdana,helvetica,sans-serif;font-size:13px"><div>Can anyone help me with the below scripts. I get an error when I run it.</div><div><br clear="none"></div><div>'reinit'</div><div>*</div><div>* sea ice cover;</div><div>* -------------</div><div>*</div><div> 'sdfopen D:\atiqah\GrADs\Real\Data\montly\SeaIceCover_19792014.nc'</div><div>*</div><div>* </div><div> 'set dfile 1'</div><div> 'set lon 0 360'</div><div> 'set lat -90 -55'</div><div>*</div><div> 'icMJJAS=ave(ci*100,t=5,t=417,12)'</div><div>*</div><div> 'clim5=ave(ci*100,t=5,t=413,12)'</div><div> 'clim6=ave(ci*100,t=6,t=414,12)'</div><div> 'clim7=ave(ci*100,t=7,t=415,12)'</div><div> 'clim8=ave(ci*100,t=8,t=416,12)'</div><div> 'clim9=ave(ci*100,t=9,t=417,12)' </div><div>*</div><div> 'climavg=clim5+clim6+clim7+clim8+clim9/5'</div><div>*</div><div> 'anomIC=icMJJAS-climavg'</div><div>*</div><div> 'avg2=(ave(pow(clim5-ci,2),t=5,t=413,12)+ave(pow(clim6-ci,2),t=6,t=414,12)+ave(pow(clim7-ci,2),t=7,t=415,12)+ave(pow(clim8-ci,2),t=8,t=416,12)+ave(pow(clim9-ci,2),t=9,t=417,12))/5'</div><div>*</div><div> 'stDv=sqrt(avg2)'</div><div>*</div><div> 'zIC=anomIC/stDv'</div><div>*</div><div>* MSLP MH;</div><div>* ========</div><div>*</div><div> 'sdfopen D:\atiqah\GrADs\Real\Data\montly\MSLP_ST_TP_1979_2014.nc'</div><div>*</div><div> 'set dfile 2'</div><div> 'set lon 40E 90E'</div><div> 'set lat 25S 35S'</div><div>*</div><div> 'mslMJJAS=ave(msl,t=5,t=417,12)'</div><div>*</div><div> 'clim5=ave(msl,t=5,t=413,12)'</div><div> 'clim6=ave(msl,t=6,t=414,12)'</div><div> 'clim7=ave(msl,t=7,t=415,12)'</div><div> 'clim8=ave(msl,t=8,t=416,12)'</div><div> 'clim9=ave(msl,t=9,t=417,12)' </div><div>*</div><div> 'climavg=clim5+clim6+clim7+clim8+clim9/5'</div><div>*</div><div> 'anomMH=mslMJJAS-climavg'</div><div>*</div><div>*</div><div> 'avg2=(ave(pow(clim5-msl,2),t=5,t=413,12)+ave(pow(clim6-msl,2),t=6,t=414,12)+ave(pow(clim7-msl,2),t=7,t=415,12)+ave(pow(clim8-msl,2),t=8,t=416,12)+ave(pow(clim9-msl,2),t=9,t=417,12))/5'</div><div>*</div><div> 'stDv=sqrt(avg2)'</div><div>*</div><div>*</div><div> 'zMH=anomMH/stDv'</div><div>*</div><div>* set same grid for both file;</div><div>* ==========================</div><div>*</div><div> 'zICnew=re2(zIC,0.25,0.25,ba)'</div><div> 'zMHnew=re2(zMH,0.25,0.25,ba)'</div><div>*</div><div>* Correlation;</div><div>* ===========</div><div>*</div><div> 'set t 1 12'</div><div> 'set lon 80 200'</div><div> 'set lat -90 28'</div><div> 'define corr=tcorr(zICnew,zMHnew,t=5,t=417)'</div><div dir="ltr"> 'd corr'</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Error from TCORR: 1st arg must be 0-D</div><div dir="ltr">Error from TCORR: Error getting grids</div><div dir="ltr">Operation Error: Error from tcorr function</div><div dir="ltr"> Error ocurred at column 1</div><div dir="ltr">DEFINE error: Invalid expression.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">Thank in advance</div><span></span><div dir="ltr"><br clear="none"></div><div dir="ltr">Atiqah</div><div><br clear="none"></div></div></div></div><br clear="none">_______________________________________________<br clear="none">
gradsusr mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br clear="none">
<a rel="nofollow" shape="rect" href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><br></div> </div> </div> </div></div></div></div></div></blockquote><div class="gmail_extra"><br></div></div></div></div></div>