[ncl-talk] The result of the conditional expression yields a missing value (mjoclivar_15)

reza tisa rezatisa1 at gmail.com
Tue Dec 31 04:10:41 MST 2019


Now i already adding at least 100 days before and after the date i want to
get (20160101-20171231),
i set the mjoclivar_14 like this
mjoclivar_14:


*   ymdStrt = 20150910                         ; start yyyymmdd   ymdLast =
20180415                         ; last  *

Result file :
MJO_PC_INDEX.nc *:   *
https://drive.google.com/open?id=1pr6wTdRXE0AWaPbh-Q8wWHca8NZLTLQw

Then i set the time for mjoclivar_15
mjoclivar_15.ncl  (
https://drive.google.com/open?id=1TZO_iumtPSLuXITY8J4hRCKvfzBlzMrh):

*  ymdStrt = 20160101                        ; start yyyymmdd  ymdLast =
20171231                         ; last  *

and i got this error for mjoclivar_15:
.........
fatal:Subscript out of range, error in subscript #0
fatal:["Execute.c":8635]:Execute: Error occurred at or near line 149
..........
ncl 147>       if (iday(nt).eq.1) then
ncl 148>           nMon = nMon+1
*ncl 149>           monInfo(nMon,0) = namMonth(imon(nt)-1) *
ncl 150>           monInfo(nMon,1) = colMonth(imon(nt)-1)
ncl 151>       end if
...........

*This is my printVarSummary:*
*ncl 148> printVarSummary(namMonth(imon(nt)-1))*
Variable: namMonth (subsection)
Type: string
Total Size: 8 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes: [1]
Coordinates:

*I also printVarSummary for pc1 and pc2 variable:*
*Variable: pc1*
Type: float
Total Size: 2924 bytes
            731 values
Number of Dimensions: 1
Dimensions and sizes: [time | 731]
Coordinates:
            time: [1893408..1910928]
Number Of Attributes: 5
  matrix : covariance
  ts_mean : ( 3.883529e-09, -1.027128e-09 )
  long_name : PC1
  info : PC1/stddev(PC1)
  _FillValue : 32766

*Variable: pc2*
Type: float
Total Size: 2924 bytes
            731 values
Number of Dimensions: 1
Dimensions and sizes: [time | 731]
Coordinates:
            time: [1893408..1910928]
Number Of Attributes: 5
  matrix : covariance
  ts_mean : ( 3.883529e-09, -1.027128e-09 )
  long_name : PC2
  info : PC2/stddev(PC2)
  _FillValue : 32766
(0) PC1 : min=-2.94831   max=3.18312
(0) PC2 : min=-2.46549   max=2.53068
(0) Missing value count = 0
(0) Missing value count = 0

Any advice for this error?

Pada tanggal Sel, 31 Des 2019 pukul 11.16 Dave Allured - NOAA Affiliate via
ncl-talk <ncl-talk at ucar.edu> menulis:

> Reza, thanks for taking my suggestion for printing diagnostics for missing
> values.  Notice that this helped us identify the source of your current
> problem.  I agree with Dennis, your selected time range included one of the
> missing value zones generated by the band pass filter. Because you printed
> the values, you can see exactly how much of the zone you need to avoid.
>
> Please read the documentation for how to correctly use printMinMax, in
> case you need it in the future.  It is under "Functions" documentation on
> the NCL website.
>
> --Dave
>
>
> On Mon, Dec 30, 2019 at 8:53 PM Dennis Shea <shea at ucar.edu> wrote:
>
>> There has been another thread on ncl-talk regarding mjoclivar_{2,14,15}.
>> *You* should read that thread. The answer to your question is in that
>> thread.
>>
>> The period you want *MUST* have at least 100 extra days* before and
>> after* the the specified .
>> The MJO Diagnostics specify using a Lanczos filter of length 201 days.
>> The first and last 100 (=201/2) filtered values will be missing.
>>
>> ;************************************************
>>
>> ; create BandPass Filter
>> ;************************************************
>>   ihp      = 2                             ; bpf=>band pass filter
>>   nWgt     = 201
>>   sigma    = 1.0                           ; Lanczos sigma
>>   fca      = 1./100.
>>   fcb      = 1./20.
>>   wgt      = *filwgts_lanczos* <http://www.ncl.ucar.edu/Document/Functions/Built-in/filwgts_lanczos.shtml> (nWgt, ihp, fca, fcb, sigma )
>>
>>
>> On Mon, Dec 30, 2019 at 8:33 PM reza tisa via ncl-talk <ncl-talk at ucar.edu>
>> wrote:
>>
>>> This is what i got before line 110, i got 100 missing data on pc1 and
>>> pc2 (day 265-365)
>>> any advice for this?
>>>
>>> *PrintVarSummary(pc1) & printVarSummary(pc2) :*
>>> Variable: pc1
>>> Type: float
>>> Total Size: 1460 bytes
>>>             365 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [time | 365]
>>> Coordinates:
>>>             time: [1910952..1919688]
>>> Number Of Attributes: 5
>>>   matrix : covariance
>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>   long_name : PC1
>>>   info : PC1/stddev(PC1)
>>>   _FillValue : 32766
>>>
>>> Variable: pc2
>>> Type: float
>>> Total Size: 1460 bytes
>>>             365 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [time | 365]
>>> Coordinates:
>>>             time: [1910952..1919688]
>>> Number Of Attributes: 5
>>>   matrix : covariance
>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>   long_name : PC2
>>>   info : PC2/stddev(PC2)
>>>   _FillValue : 32766
>>>
>>>
>>>
>>> *print(pc1) & print(pc2):*
>>>
>>> Variable: pc1
>>> Type: float
>>> Total Size: 1460 bytes
>>>             365 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [time | 365]
>>> Coordinates:
>>>             time: [1910952..1919688]
>>> Number Of Attributes: 5
>>>   matrix : covariance
>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>   long_name : PC1
>>>   info : PC1/stddev(PC1)
>>>   _FillValue : 32766
>>> (0) 0.6806232
>>> (1) 0.8251321
>>> (2) 0.9573668
>>> (3) 1.082248
>>> (4) 1.204796
>>> ........................
>>> (263) -0.2053133
>>> (264) -0.3058788
>>>
>>>
>>> *(265) 32766(266) 32766*
>>>
>>> *................ (same 32766 fillValue)*
>>> *................*
>>>
>>>
>>> *(363) 32766(364) 32766*
>>>
>>> Variable: pc2
>>> Type: float
>>> Total Size: 1460 bytes
>>>             365 values
>>> Number of Dimensions: 1
>>> Dimensions and sizes: [time | 365]
>>> Coordinates:
>>>             time: [1910952..1919688]
>>> Number Of Attributes: 5
>>>   matrix : covariance
>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>   long_name : PC2
>>>   info : PC2/stddev(PC2)
>>>   _FillValue : 32766
>>> (0) -2.171702
>>> (1) -2.205069
>>> (2) -2.23731
>>> (3) -2.264152
>>> (4) -2.279648
>>> ..................
>>> ..................
>>> (261) 0.4560925
>>> (262) 0.4993998
>>> (263) 0.5322841
>>> (264) 0.5507534
>>>
>>>
>>> *(265) 32766(266) 32766......................*
>>>
>>> *...................... (same 32766 fillValue)*
>>>
>>> *(363) 32766(364) 32766*
>>>
>>> *printMinMax :*
>>> ncl 125>     printMinMax(pc1) ;Show the min and max values of a whole
>>> array
>>> *result :*
>>> fatal:syntax error: procedure printMinMax expects 2 arguments, got 1
>>> fatal:error at line 125
>>> ncl 126> printMinMax(pc2) ;Show the min and max values of a whole array
>>> fatal:syntax error: procedure printMinMax expects 2 arguments, got 1
>>> fatal:error at line 126
>>>
>>> *print ("Missing value count = " + num (ismissing (X)) :*
>>> ncl 323>     print ("Missing value count = " + num (ismissing (pc1))
>>> *result*
>>> (0) Missing value count = 100
>>>
>>> ncl 323>     print ("Missing value count = " + num (ismissing (pc2))
>>> *result*
>>> (0) Missing value count = 100
>>>
>>>
>>> Pada tanggal Sel, 31 Des 2019 pukul 07.34 Dave Allured - NOAA Affiliate <
>>> dave.allured at noaa.gov> menulis:
>>>
>>>> This error is not immediately obvious.  In general, when you get a
>>>> mysterious error from an NCL statement, you should manually check each one
>>>> of the inputs, immediately before the statement is executed.  The following
>>>> debugging statements are most useful for this:
>>>>
>>>>     print -- Show all dimensions, attributes, and data values of the
>>>> named variable or immediate expression
>>>>     printVarSummary -- Show all dimensions and attributes, but not the
>>>> data values
>>>>     printMinMax -- Show the min and max values of a whole array
>>>>     print ("Missing value count = " + num (ismissing (X))) -- Show the
>>>> number of missing values of X
>>>>
>>>> Please use these methods to check all of the individual inputs to line
>>>> 110, and make sure everything looks reasonable.  Note that this line draws
>>>> one of the line segments on your expected plot, so it needs two valid
>>>> coordinate pairs for input.  If you still need to report back to the
>>>> mailing list, please report only things that you find invalid or
>>>> mysterious.  Thanks.
>>>>
>>>>
>>>> On Mon, Dec 30, 2019 at 4:53 AM reza tisa via ncl-talk <
>>>> ncl-talk at ucar.edu> wrote:
>>>>
>>>>> Hello all NCL user, i am running mjoclivar_15 and got this error
>>>>> messages:
>>>>> Error Message :
>>>>> *fatal:The result of the conditional expression yields a missing
>>>>> value. NCL can not determine branch, see ismissing function*
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> *fatal:["Execute.c":8637]:Execute: Error occurred at or near line 3836
>>>>> in file
>>>>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.nclfatal:["Execute.c":8637]:Execute:
>>>>> Error occurred at or near line 4143 in file
>>>>> $NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.nclfatal:["Execute.c":8635]:Execute:
>>>>> Error occurred at or near line 110*
>>>>> *This is my data:*
>>>>> MJO_PC_INDEX.nc (i got from running mjoclivar_14):
>>>>> https://drive.google.com/open?id=1pr6wTdRXE0AWaPbh-Q8wWHca8NZLTLQw
>>>>> My mjoclivar_15 script:
>>>>> https://drive.google.com/open?id=1uvljzKOnCZt2vqso1fPPxLqCD1R9FBq2
>>>>>
>>>>> *Error line:*
>>>>> ................
>>>>> ncl 106> gsn_define_colormap(wks,"radar_1")
>>>>> ncl 107>       end if
>>>>> ncl 108>                                                     ; color
>>>>> changes w month
>>>>> ncl 109>       plLine at gsLineColor = colMonth(imon(nt)-1)     ; -1 is
>>>>> cuz NCL is 0-based
>>>>> *ncl 110>       plot@$unique_string("dum")$ = gsn_add_polyline(wks,
>>>>> plot, (/xBegin,pc1(nt)/), (/yBegin,pc2(nt)/), plLine)*
>>>>> ncl 111>
>>>>> ncl 112>       if (label_opt.eq.0) then
>>>>> ncl 113>
>>>>> ...................
>>>>>
>>>>> *printVarSummary from MJO_PC_INDEX.nc :*
>>>>> ncl 6> printVarSummary(T) *;PC1*
>>>>> Variable: T
>>>>> Type: float
>>>>> Total Size: 5844 bytes
>>>>>             1461 values
>>>>> Number of Dimensions: 1
>>>>> Dimensions and sizes: [time | 1461]
>>>>> Coordinates:
>>>>>             time: [1884648..1919688]
>>>>> Number Of Attributes: 5
>>>>>   info : PC1/stddev(PC1)
>>>>>   long_name : PC1
>>>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>>>   matrix : covariance
>>>>>   _FillValue : 32766
>>>>>
>>>>> ncl 8> printVarSummary(T2) *;PC2*
>>>>> Variable: T2
>>>>> Type: float
>>>>> Total Size: 5844 bytes
>>>>>             1461 values
>>>>> Number of Dimensions: 1
>>>>> Dimensions and sizes: [time | 1461]
>>>>> Coordinates:
>>>>>             time: [1884648..1919688]
>>>>> Number Of Attributes: 5
>>>>>   info : PC2/stddev(PC2)
>>>>>   long_name : PC2
>>>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>>>   matrix : covariance
>>>>>   _FillValue : 32766
>>>>>
>>>>> ncl 11> printVarSummary(T2)  *;MJO_INDEX*
>>>>> Variable: T2
>>>>> Type: float
>>>>> Total Size: 5844 bytes
>>>>>             1461 values
>>>>> Number of Dimensions: 1
>>>>> Dimensions and sizes: [time | 1461]
>>>>> Coordinates:
>>>>>             time: [1884648..1919688]
>>>>> Number Of Attributes: 5
>>>>>   long_name : MJO PC INDEX
>>>>>   info : (PC1^2 + PC2^2)
>>>>>   ts_mean : ( 4.944145e-09, -3.424131e-09 )
>>>>>   matrix : covariance
>>>>>   _FillValue : 32766
>>>>>
>>>>> ncl 13> printVarSummary(T3)   *;time  *
>>>>> Variable: T3
>>>>> Type: double
>>>>> Total Size: 11688 bytes
>>>>>             1461 values
>>>>> Number of Dimensions: 1
>>>>> Dimensions and sizes: [time | 1461]
>>>>> Coordinates:
>>>>>             time: [1884648..1919688]
>>>>> Number Of Attributes: 6
>>>>>   units : hours since 1800-01-01 00:00:0.0
>>>>>   long_name : Time
>>>>>   actual_range : ( 1528872, 1919688 )
>>>>>   delta_t : 0000-00-01 00:00:00
>>>>>   standard_name : time
>>>>>   axis : T
>>>>>
>>>>> Thanks for anybody could help and giving solution for this error
>>>>>
>>>> _______________________________________________
> 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/20191231/35e17e56/attachment.html>


More information about the ncl-talk mailing list