[gradsusr] Determine tcorr.

Andrew Friedman andfried at gmail.com
Thu Jun 4 13:48:42 EDT 2015


Hi Atiqah,

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.
See the tcorr example on calculating the El Nino index:
http://www.iges.org/grads/gadoc/gadocindex.html

You can modify it to work with your dataset. For example, try adding these
lines in your script:

* Correlation;
* ===========
*
'set t 5 417'
'set x 1'
'set y 1'
'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

'set lon 80 200'
'set lat -90 28'
'set t 1'
 'define corr=tcorr(zICnew1D,zMHnew,t=5,t=417)'
 'd corr'

Best, Andrew

>
>
>
>   On Wednesday, June 3, 2015 4:53 PM, Andrew Friedman <andfried at gmail.com>
> wrote:
>
>
> Hi Atiqah,
>
> I think one problem is that zICnew varies in space and time, but the first
> argument of tcorr can only vary in time.
>
> Andrew
>
> On Tue, Jun 2, 2015 at 8:52 AM, syairah atiqah atiq <
> syairahatiqah at yahoo.com> wrote:
>
> Can anyone help me with the below scripts. I get an error when I run it.
>
> 'reinit'
> *
> * sea ice cover;
> * -------------
> *
>   'sdfopen D:\atiqah\GrADs\Real\Data\montly\SeaIceCover_19792014.nc'
> *
> *
>   'set dfile 1'
>   'set lon 0 360'
>   'set lat -90 -55'
> *
>   'icMJJAS=ave(ci*100,t=5,t=417,12)'
> *
>   'clim5=ave(ci*100,t=5,t=413,12)'
>   'clim6=ave(ci*100,t=6,t=414,12)'
>   'clim7=ave(ci*100,t=7,t=415,12)'
>   'clim8=ave(ci*100,t=8,t=416,12)'
>   'clim9=ave(ci*100,t=9,t=417,12)'
> *
>   'climavg=clim5+clim6+clim7+clim8+clim9/5'
> *
>   'anomIC=icMJJAS-climavg'
> *
>
> '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'
> *
>   'stDv=sqrt(avg2)'
> *
>   'zIC=anomIC/stDv'
> *
> * MSLP MH;
> * ========
> *
>   'sdfopen D:\atiqah\GrADs\Real\Data\montly\MSLP_ST_TP_1979_2014.nc'
> *
>   'set dfile 2'
>   'set lon 40E 90E'
>   'set lat 25S 35S'
> *
>   'mslMJJAS=ave(msl,t=5,t=417,12)'
> *
>   'clim5=ave(msl,t=5,t=413,12)'
>   'clim6=ave(msl,t=6,t=414,12)'
>   'clim7=ave(msl,t=7,t=415,12)'
>   'clim8=ave(msl,t=8,t=416,12)'
>   'clim9=ave(msl,t=9,t=417,12)'
> *
>   'climavg=clim5+clim6+clim7+clim8+clim9/5'
> *
>   'anomMH=mslMJJAS-climavg'
> *
> *
>
> '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'
> *
>   'stDv=sqrt(avg2)'
> *
> *
>   'zMH=anomMH/stDv'
> *
> * set same grid for both file;
> * ==========================
> *
>   'zICnew=re2(zIC,0.25,0.25,ba)'
>   'zMHnew=re2(zMH,0.25,0.25,ba)'
> *
> * Correlation;
> * ===========
> *
>  'set t 1 12'
>  'set lon 80 200'
>  'set lat -90 28'
>  'define corr=tcorr(zICnew,zMHnew,t=5,t=417)'
>  'd corr'
>
> Error from TCORR:  1st arg must be 0-D
> Error from TCORR:  Error getting grids
> Operation Error:  Error from tcorr function
>   Error ocurred at column 1
> DEFINE error:  Invalid expression.
>
> Thank in advance
>
> Atiqah
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150604/4ee9a672/attachment.html 


More information about the gradsusr mailing list