[ncl-talk] calculate monthly anomaly

Dennis Shea shea at ucar.edu
Wed Dec 27 09:10:17 MST 2017


(1) you can copy dim_pad; extract just the section for your dimensionality; translate to use 'else if' rather than 'elseif'

Not that difficult to do. 

Sent from my iPhone

> On Dec 27, 2017, at 10:10 AM, Debasish Hazra <debasish.hazra5 at gmail.com> wrote:
> 
> Thanks Karin. So, is there any other way to calculate climatology from montlhy data, when total number of months are not exactly divisible by 12 ? In my case, I have 164 months as there are some missing months in between but want to calculate 14 years climatology and anomaly ?
> 
> Debasish
> 
>> On Wed, Dec 27, 2017 at 5:05 AM, Karin Meier-Fleischer <meier-fleischer at dkrz.de> wrote:
>> Hi Debasish,
>> 
>> elseif will be available in next version 6.5.0.
>> 
>> -Karin
>> 
>>> Am 27.12.2017 um 02:30 schrieb Debasish Hazra via ncl-talk <ncl-talk at ucar.edu>:
>>> 
>>> Dennis,
>>> 
>>> I am using ncl version 6.4 and still getting this error :
>>> 
>>>  NCAR Command Language Version 6.4.0
>>>  The use of this software is governed by a License Agreement.
>>>  See http://www.ncl.ucar.edu/ for more details.
>>> fatal:syntax error: line 49 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>   elseif (rankx.eq.2) then
>>> -------------------------^
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 57 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>   elseif (rankx.eq.3) then
>>> -------------------------^
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 65 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>   elseif (rankx.eq.4) then
>>> -------------------------^
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:syntax error: line 73 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>   elseif (rankx.eq.5) then
>>> -------------------------^
>>> fatal:syntax error: possibly an undefined procedure
>>> fatal:Syntax Error in block, block not executed
>>> 
>>>> On Tue, Dec 26, 2017 at 1:59 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>> Function uses 'elseif' introduced in 6.4.0. 
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>>> On Dec 26, 2017, at 12:12 PM, Debasish Hazra <debasish.hazra5 at gmail.com> wrote:
>>>>> 
>>>>> Thanks Dennis. I tried to use "dim_pad" and it gave the following errors :
>>>>> 
>>>>> fatal:syntax error: line 49 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>>>   elseif (rankx.eq.2) then
>>>>> -------------------------^
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 57 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>>>   elseif (rankx.eq.3) then
>>>>> -------------------------^
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 65 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>>>   elseif (rankx.eq.4) then
>>>>> -------------------------^
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:syntax error: line 73 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl before or near then
>>>>>   elseif (rankx.eq.5) then
>>>>> -------------------------^
>>>>> fatal:syntax error: possibly an undefined procedure
>>>>> fatal:Syntax Error in block, block not executed
>>>>> fatal:error at line 91 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/dim_pad.ncl
>>>>> 
>>>>> Debasish
>>>>> 
>>>>>> On Wed, Dec 13, 2017 at 7:18 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>>>> Attached is an undocumented and unsupported function that (hopefully) will 'pad' a series.
>>>>>> 
>>>>>> If you have x(lat,lon,time) .... it will have to be reordered because the function currently pad only the leftmost dimension.
>>>>>> 
>>>>>> load "dim_pad.ncl"
>>>>>> 
>>>>>>       .....
>>>>>>    xr = x(time|:,lat|:,lon|:)
>>>>>>                                        
>>>>>>    X = dim_pad(xr, 12, 0)  ; xr[164,nlat,mlon] ===> dim_pad(xr,12, 0) ===> X[168 ][nlat][mlon]]
>>>>>> 
>>>>>>     x_clm = clmMonTLL(X)    ; (12,lat,lon)
>>>>>>     printVarSummary(x_clm)
>>>>>>     delete([/X, xr/])             ; delete temporary/work arrays  
>>>>>> 
>>>>>>> On Wed, Dec 13, 2017 at 1:55 PM, Debasish Hazra <debasish.hazra5 at gmail.com> wrote:
>>>>>>> Hi,
>>>>>>> I have 14 years of monthly satelitte data, but there are some missing months in between (total 164 files, inplace of 168). I am trying to calculate monthly climatology and anomaly for each of the months. But as I am using either clmMonLLT or calcMonAnomLLT it needs "time dimension must be multiple of 12". Is there any other function available to calculate anomalies when time dimension is not exactly divisible by 12.
>>>>>>> Thanks.
>>>>>>> Debasish
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> ncl-talk mailing list
>>>>>>> ncl-talk at ucar.edu
>>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>>> 
>>>>>> 
>>>>> 
>>> 
>>> _______________________________________________
>>> 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/20171227/ecdf83bc/attachment.html>


More information about the ncl-talk mailing list