<div dir="ltr">Dear NCL,<div><br></div><div>I have been working on making a plot with correlation between detrended data (snow cover extent) and I had first</div><div>used CDO to convert weekly data to monthly data. In the process the lat and lon cordinates became y and x.</div><div>It works fine if till I reorder it. But it is not calculating dtrend correctly, all the values are fill values. </div><div><br></div><div>I worked on using calculate_monthly_values to see if I could use it convert weekly to monthly in NCL and I could not use it. I would be grateful for any input</div><div><br></div><div>Here is the code I am using</div><div><br></div><div><div>;============================================</div><div>; set up parameters</div><div>;============================================</div><div><br></div><div>;This is extracting latitude of Western Europe<br></div><div>;Reading in the data</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/Snow_cover_IMS/<a href="http://nhsce_v01r01_19661004_20140602.nc" target="_blank">nhsce_v01r01_19661004_20140602.nc</a>","r")</div><div><br></div><div>;Extracting snow cover extent (sce) from respective data files</div><div><br></div><div>sce=byte2flt(a->sce)</div><div><br></div><div>sce@_FillValue = 9.9621e+36</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>;Reading in JJAS rainfall </div><div><br></div><div>JJAS_1871_2012 =asciiread("~/Documents/NCL_files/SST/Monthly/jjas_1871_2012.txt",(/142,1/),"float")</div><div><br></div><div>;Extracting JJAS for 1967 to 2012</div><div><br></div><div>JJAS_1967_2012=JJAS_1871_2012(96:141,0)</div><div><br></div><div>;============================================</div><div>;Extracting monthly data for sce</div><div><br></div><div>Jan_sce = new((/46,88,88/),float)</div><div><br></div><div>Jan_sce@_FillValue = 9.9621e+36</div><div><br></div><div>Jan_sce@lat2d=lat</div><div>Jan_sce@lon2d=lon</div><div><br></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><br></div><div>end do</div><div><br></div><div>Jan_reorder=Jan_sce(y|:,x|:,time|:)</div><div><br></div><div>Jan_dt=dtrend(Jan_reorder,False)</div><div><br></div><div><br></div><div>Jan_reorder@_FillValue = 9.9621e+36</div><div><br></div><div>corr_jan=escorc(Jan_dt,JJAS_1967_2012)</div></div><div><div><br></div><div><div dir="ltr"><br></div></div>
</div></div>