Cheng, Rui r5cheng at ucsd.edu
Fri Jun 13 10:50:14 EDT 2014

```Hi Andrew,

Thank you very much for your advice. Let me check it using the standard formula.

Rui
________________________________________
Sent: Friday, June 13, 2014 1:41 AM

This should allow you to isolate whether the issue is GrADS or the implementation.
Andrew

On Jun 13, 2014, at 1:09 AM, Andrew Friedman <andfried at berkeley.edu> wrote:

> Hi Rui,
>
> As a more simple check than another program, can you compare your GrADS results with a simple correlation coefficient calculated using the standard formula with a handful of data points?
> https://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient
>
> Andrew
>
> On Jun 12, 2014, at 3:27 PM, Cheng, Rui <r5cheng at ucsd.edu> wrote:
>
>>
>> I want to get the correlation between dcape and rainrate using GrADS. Meanwhile, NCL is used to test the result.
>>
>> Assuming dcape is one time step prior to rainrate, so we can get the correlation (0.0266) using GrADS through,
>> "set t 2 77; define dcapeave2=dcapeave(t-1); set t 1; d tcorr(dcapeave2,rainrateconvm,t=2,t=77)."
>>
>> Also using NCL, we can get the correlation (-0.18815) through,
>> "ccr2=esccr(dcapeave(1:76,0,0,0),rainrateconvm(1:76,0,0,0),1)."
>>
>> I notice that the difference is small if there is no time lag between dcape and rainrate. Then we get the correlation "-0.1139" using GrADS and "-0.1101" using NCL.
>>
>> Why the difference is so big when the time lag is present between two time series?
>> Would you like to help me?
>>
>> Many thanks,
>>
>> Rui
>>
>> _______________________________________________