[ncl-talk] detrend not working right and calculate_monthly_values

Dennis Shea shea at ucar.edu
Tue Feb 16 14:47:13 MST 2016


TYour comments do not make any sense to me. Actually, they are rather
frustrating.

[1] The CDO  and NCL are not returning the correct results. They are two
independent software tools. Something does not seem right here.

[2] I am sure that neither were designed to work with 'weekly data'.
'Weekly data' can span across neighboring months.
NCL's function requires that 'time' be recognized by 'cd_calendar'. Are the
units of your variable  'weeks since ...'? Certainly NCL and, likely, the
CDO are not going to partition a week that spans two months.

[3] You make statements like "detrend not working right and
calculate_monthly_values". You give no particulars.
Why do you say these are not working correctly?



On Tue, Feb 16, 2016 at 1:14 PM, Ipshita Majhi <ipmajhi at alaska.edu> wrote:

> Dear NCL,
>
> I have been working on making a plot with correlation between detrended
> data (snow cover extent) and I had first
> used CDO to convert weekly data to monthly data. In the process the lat
> and lon cordinates became y and x.
> It works fine if till I reorder it. But it is not calculating dtrend
> correctly, all the values are fill values.
>
> 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
>
> Here is the code I am using
>
> ;============================================
> ; set up parameters
> ;============================================
>
> ;This is extracting latitude of Western Europe
> ;Reading in the data
> a=addfile("~/Documents/NCL_files/Snow_cover_IMS/NCL_codes/sce_mon_mean.nc","r")
> ; open output netCDF file
> b=addfile("~/Documents/NCL_files/Snow_cover_IMS/
> nhsce_v01r01_19661004_20140602.nc","r")
>
> ;Extracting  snow cover extent (sce) from respective data files
>
> sce=byte2flt(a->sce)
>
> sce at _FillValue = 9.9621e+36
>
> lat=b->latitude
> lon=b->longitude
>
> sce at lat2d=lat
> sce at lon2d=lon
>
> ;==============================================
> ;Reading in JJAS rainfall
>
> JJAS_1871_2012
> =asciiread("~/Documents/NCL_files/SST/Monthly/jjas_1871_2012.txt",(/142,1/),"float")
>
> ;Extracting JJAS for 1967 to 2012
>
> JJAS_1967_2012=JJAS_1871_2012(96:141,0)
>
> ;============================================
> ;Extracting monthly data for sce
>
> Jan_sce = new((/46,88,88/),float)
>
> Jan_sce at _FillValue = 9.9621e+36
>
> Jan_sce at lat2d=lat
> Jan_sce at lon2d=lon
>
> ;==========================================
>
> do nyr=0,551,12
>
> Jan_sce(nyr/12,:,:) =sce(nyr,:,:)
>
> end do
>
> Jan_reorder=Jan_sce(y|:,x|:,time|:)
>
> Jan_dt=dtrend(Jan_reorder,False)
>
>
> Jan_reorder at _FillValue = 9.9621e+36
>
> corr_jan=escorc(Jan_dt,JJAS_1967_2012)
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160216/c096281c/attachment.html 


More information about the ncl-talk mailing list