Hi Hui,<br>
<br>
Humm, I never tried to do correlations with data that only partially<br>
overlap... But I think it should work. You could try your script<br>
with the same variable. I mean, try to calculate the correlation<br>
of the reanalysis agains the reanalysis.... and the model x model.<br>
If that doen's work, than rewrite your script.<br>
<br>
If that work then you could try to write the lon/lat exactly<br>
as in the ctl. For instance, call scorr with lon=230.5045 <br>
instead of 230.505.<br>
<br>
]['s<br>
Henrique<br><br><div><span class="gmail_quote">On 9/30/05, <b class="gmail_sendername">Hui Du</b> <<a href="mailto:huidu@ucdavis.edu">huidu@ucdavis.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear GrADs users:<br>I want to calculate the correlation between two variables which come<br>from two data sets. One is model output, the other is reanalysis data.<br>The domain of the model is a little bigger than the reanalysis, But part
<br>of them are overlapped exactly. I have written the grid set at the last.<br>We can see that they are exactly the same except the blue part. My<br>script is<br><br>function wp ( args)<br>tb=subwrd(args,1)<br>te=subwrd(args,2)
<br>'define avet2a=ave(t2.2,t='tb',t='te')'<br>'define avet20=ave(t2,t='tb',t='te')'<br>'define<br>cort2a=scorr(avet2a,avet20,lon=230.505,lon=252.651,lat=28.4976,lat=46.6943)'<br>'d cort2a'<br>return<br><br>When I ran the above script, I got:
<br><br>ga-> run <a href="http://b.gs">b.gs</a> 613 736<br>Error from SCORR: Incompatable grids<br>Operation Error: Error from scorr function<br>Error ocurred at column 1<br>DEFINE error: Invalid expression.<br><br>I wonder where my problem was, when I calculate two model sets which
<br>have the exactly same grid set. It was ok<br>Thanks lot<br><br>**********************************************************************************************************<br>Control<br><br>longitude = 223.6738, 224.011
, 224.3488, 224.6871, 225.0258, 225.3651,<br><br>225.7048, 226.045, 226.3856, 226.7267, 227.0682, 227.4102, 227.7525,<br><br>228.0952, 228.4384, 228.7819, 229.1257, 229.4699, 229.8145, 230.1593,<br><br>230.5045, 230.85, 231.1957
, 231.5418, 231.888, 232.2346, 232.5814,<br><br>232.9284, 233.2756, 233.623, 233.9706, 234.3183, 234.6662, 235.0143,<br><br>235.3625, 235.7108, 236.0592, 236.4077, 236.7563, 237.105, 237.4537,<br><br>237.8024, 238.1512, 238.5
, 238.8488, 239.1976, 239.5463, 239.895,<br><br>240.2437, 240.5923, 240.9408, 241.2892, 241.6375, 241.9857, 242.3338,<br><br>242.6817, 243.0294, 243.377, 243.7244, 244.0716, 244.4186, 244.7654,<br><br>245.1119, 245.4583,
245.8043, 246.15, 246.4955, 246.8407, 247.1855,<br><br>247.5301, 247.8743, 248.2181, 248.5616, 248.9048, 249.2475, 249.5898,<br><br>249.9318, 250.2733, 250.6144, 250.955, 251.2952, 251.6349, 251.9742,<br><br>252.313, 252.6512
, 252.989, 253.3262, 253.6629 ;<br><br>latitude = 28.4976, 28.76577, 29.03428, 29.30313, 29.57229, 29.84179,<br><br>30.11159, 30.38172, 30.65216, 30.9229, 31.19394, 31.46528, 31.73691,<br><br>32.00883, 32.28103, 32.55351,
32.82626, 33.09929, 33.37257, 33.64611,<br><br>33.9199, 34.19395, 34.46824, 34.74277, 35.01752, 35.29251, 35.56772,<br><br>35.84315, 36.11879, 36.39464, 36.67069, 36.94694, 37.22338, 37.5,<br><br>37.7768, 38.05378, 38.33092
, 38.60824, 38.8857, 39.16333, 39.44109,<br><br>39.71899, 39.99703, 40.2752, 40.55349, 40.83189, 41.1104, 41.38903,<br><br>41.66775, 41.94656, 42.22545, 42.50443, 42.78348, 43.0626, 43.34177,<br><br>43.62101, 43.90029, 44.17961
, 44.45897, 44.73835, 45.01777, 45.29719,<br><br>45.57663, 45.85606, 46.1355, 46.41492, 46.69433, 46.9737 ;<br><br>Observation<br><br>longitude = 230.5045, 230.85, 231.1957, 231.5418, 231.888, 232.2346,<br><br>232.5814, 232.9284
, 233.2756, 233.623, 233.9706, 234.3183, 234.6662,<br><br>235.0143, 235.3625, 235.7108, 236.0592, 236.4077, 236.7563, 237.105,<br><br>237.4537, 237.8024, 238.1512, 238.5, 238.8488, 239.1976, 239.5463,<br><br>239.895, 240.2437
, 240.5923, 240.9408, 241.2892, 241.6375, 241.9857,<br><br>242.3338, 242.6817, 243.0294, 243.377, 243.7244, 244.0716, 244.4186,<br><br>244.7654, 245.1119, 245.4583, 245.8043, 246.15, 246.4955, 246.8407,<br><br>247.1855, 247.5301
, 247.8743, 248.2181, 248.5616, 248.9048, 249.2475,<br><br>249.5898, 249.9318, 250.2733, 250.6144, 250.955, 251.2952, 251.6349,<br><br>251.9742, 252.313, 252.6512 ;<br><br>latitude = 28.4976, 28.76577, 29.03428, 29.30313,
29.57229, 29.84179,<br><br>30.11159, 30.38172, 30.65216, 30.9229, 31.19394, 31.46528, 31.73691,<br><br>32.00883, 32.28103, 32.55351, 32.82626, 33.09929, 33.37257, 33.64611,<br><br>33.9199, 34.19395, 34.46824, 34.74277, 35.01752
, 35.29251, 35.56772,<br><br>35.84315, 36.11879, 36.39464, 36.67069, 36.94694, 37.22338, 37.5,<br><br>37.7768, 38.05378, 38.33092, 38.60824, 38.8857, 39.16333, 39.44109,<br><br>39.71899, 39.99703, 40.2752, 40.55349, 40.83189
, 41.1104, 41.38903,<br><br>41.66775, 41.94656, 42.22545, 42.50443, 42.78348, 43.0626, 43.34177,<br><br>43.62101, 43.90029, 44.17961, 44.45897, 44.73835, 45.01777, 45.29719,<br><br>45.57663, 45.85606, 46.1355, 46.41492, 46.69433
;<br></blockquote></div><br>