<div dir="ltr">Interpolate so that both grids have the same dimensions.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 23, 2016 at 3:27 PM, Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br clear="all"><div>Dear NCL,</div><div><br></div><div>I used escorc to calculate correlation. The lat and lon dimension of the two variables are different so the correlation output had four dimension. How can i resolve it. Thank you, listed below is the code:-</div><div><br></div><div><div><br></div><div>;********************************************</div><div>;Reading in monthly mean and original weekly data</div><div>;for sce</div><div>;********************************************</div><div><br></div><div>a=addfile("~/Documents/NCL_files/Snow_cover_IMS/NCL_codes/<a href="http://sce_mon_mean.nc" target="_blank">sce_mon_mean.nc</a>","r") ; open output netCDF file</div><div>b=addfile("~/Documents/NCL_files/Sea_ice/<a href="http://nhsce_v01r01_19661004_20140602.nc" target="_blank">nhsce_v01r01_19661004_20140602.nc</a>","r")</div><div><br></div><div>;Extracting time and snow cover extent (sce) from respective data files</div><div><br></div><div>sce=byte2flt(a->sce)</div><div><br></div><div>sce@_FillValue = 0</div><div><br></div><div>sce!1="lat"</div><div>sce!2="lon"</div><div><br></div><div>lat=b->latitude</div><div>lon=b->longitude</div><div><br></div><div>sce@lat2d=lat</div><div>sce@lon2d=lon</div><div><br></div><div>;*********************************************</div><div><br></div><div>;*********************************************</div><div>;Reading in Sea ice data</div><div>;*********************************************</div><div><br></div><div>c=addfile("~/Documents/NCL_files/Sea_ice/HadISST_ice.nc","r")</div><div>lat_sic=c->latitude</div><div>lon_sic=c->longitude</div><div><br></div><div>sic=c->sic</div><div><br></div><div>;Extracting 1967-2012</div><div><br></div><div>sic_1967_2012=sic(1164:1715,:,:)</div><div><br></div><div>copy_VarAtts(sic,sic_1967_2012)</div><div>copy_VarCoords_1(sic,sic_1967_2012)</div><div><br></div><div>;*******************************************</div><div><br></div><div>;*******************************************</div><div>;Detrending and reording both the datasets</div><div>;*******************************************</div><div><br></div><div>jan_sce = new((/46,88,88/),float)</div><div>jan_sic=new((/46,180,360/),float)</div><div><br></div><div>jan_sce@_FillValue = -0.99</div><div>jan_sic@_FillValue= -1e+30</div><div><br></div><div>jan_sce@lat2d=lat</div><div>jan_sce@lon2d=lon</div><div>;*****************************************</div><div><br></div><div>;*****************************************</div><div>;Extracting monthly data for sce</div><div>;*****************************************</div><div><br></div><div>do nyr=0,551,12</div><div><br></div><div>jan_sce(nyr/12,:,:) =sce(nyr,:,:) </div><div>jan_sic(nyr/12,:,:)=sic_1967_2012(nyr,:,:)</div><div><br></div><div>end do</div><div><br></div><div>;****************************************</div><div><br></div><div>;****************************************</div><div>;Reordering</div><div><br></div><div>jan_reorder_sce=jan_sce(lat|:,lon|:,time|:); Dimension is (88,88,:)</div><div>jan_reorder_sic=jan_sic(latitude|:,longitude|:,time|:); Dimension is (180,360,:)</div><div><br></div><div>;****************************************</div><div><br></div><div>;****************************************</div><div>;Detrending now</div><div>;****************************************</div><div>jan_sce_dt=dtrend(jan_reorder_sce,False)</div><div>jan_sic_dt=dtrend(jan_reorder_sic,False)</div><div>;****************************************</div><div><br></div><div>;****************************************</div><div>;Correlation coefficient</div><div><br></div><div>jan_ccr = escorc(jan_sce_dt,jan_sic_dt)</div><div>print(jan_ccr)</div></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>