[ncl-talk] Error in running wheeler- kiladis script

Dennis Shea shea at ucar.edu
Mon Jul 24 19:30:52 MDT 2017


Something 'funny' is going on here.

You mention "OLR daily data from NOAA" . I assume you are referring to:
       https://www.esrl.noaa.gov/psd/data/gridded/data.interp_OLR.html

The NOAA 'olr' is type 'short'. It must be unpacked before it can be used.
---
In your code, you read and use the variable directly:

   olr =  f->olr

I can only speculate that 'someone' unpacked the original NOAA OLR data and
overwrote the original file. In my opinion, this is not good practice.  A
different file name should have been used:  eg, olr.day.mean.unpacked.nc

============
The error message you included is from one of several * error checks *performed
internally by the wkSpaceTime procedure*. *It checks to see if _FillValue
(missing values) are present in the variable being processed. If _FillValue
are encountered, wkSpaceTime  prints the following* fatal* error and
terminates:

nMsg=390635003  *User must preprocess to remove _FillValue*
(0)               FFTs do not allow missing values!!

The 390635003 indicates the overall total number of _FillValue.

The key is: *User must preprocess to remove _FillValue*

The *user* to whom the message is referring is you   :-)

There is no magic. You must determine the continuous period that has no
_FillValue.
---------

Luckily, I have the original NOAA olr.day.mean.nc file. The olr variable is
type short. Hence, short2flt must be used to to unpack the variable.
   https://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml

Also, I (arbitrarily) used 15S to 15N and will use NCL's coordinate
subscripting {...} to select the desired latitudes. You can use the
latitude bounds that you want but I suggest thinking about the appropriate
latitude band for your objective.  Perhaps, talk to an adviser .
;-----------------------------------------------------------------
; Read the variable; Look at variable overview
;-----------------------------------------------------------------
   latN = 15
   latS = -latN

   f    =  addfile("olr.day.mean.nc", "r")
   olr =  short2flt( f->olr(*:,{latS:latN},*:) )   ; ALL times   ... <<<
NOAA
 ;;olr =  f->olr(*:,{latS:latN},*:) )                  ; ALL times   ...
<<< your file

   printVarSummary(olr)   *; Look at the variable!*
   printMinMax(olr,0)
*; Do the values look reasonable?*

;-----------------------------------------------------------------
; What dates are on the file?
; Convert 'time' to human readable  yyyymmdd
; https://www.ncl.ucar.edu/Document/Functions/Built-in/cd_calendar.shtml
;--------------------------------------------------------------------
   ymd  = cd_calendar(olr*&*time, -2)          ; time -> yyyymmdd
   dimo = dimsizes(olr)
   ntim = dimo(0)                                        ; # days on file
   print("First and Last dates on file: ymd(0)="+ymd(0)+"
ymd(ntim-1)="+ymd(ntim-1))

;-----------------------------------------------------------------
; Determine the number of _FillValue in the olr variable
; Print the days that have _FillValue oresent
;-----------------------------------------------------------------

   do nt=0,ntim-1      ; loop over each day; print days when _FillValue
present
        nmsg = num(ismissing(olr(nt,:,:)))
        if (nmsg.ne.0) then
            print(nt+"  "+ymd(nt) +"  nmsg="+nmsg)
        end if
     end do

----------
OUTPUT:

(0)    File First and Last dates: ymd(0)=19740601   ymd(ntim-1)=20131231

           nt           ymd        # missing
(*0)    1385  19780317  nmsg=10512    missing data block starts*
(0)    1386  19780318  nmsg=10512
[snip]
(0)     1673  19781230  nmsg=10512
*(0)     1674  19781231  nmsg=10512   missing data block ends*
          ^^^^
         Last index with _FillValue;

*use next index 1674+1=1675 [ 19790101 ]*
============

I think you should start at 1 Jan 1979 [ 19790101 ]: time index 1675.


   ; *Selected
times* : 15S to 15N
   olr =  short2flt( f->olr(*1675: ,{latS:latN}*,:) )   ;  <<< original
NOAA file
 ;;olr =  f->olr(1*675: ,{latS:latN}*,:) )                  ;  <<< your file

Attached is a script that creates the Wheeler-Kiladis plots using olr
between 15S and 15N. Change to read your data file and use your desired
latS & latN

**************************************
FYI:    NCL version (6.1.2) is 4.5 years old.  You should upgrade to NCL
version 6.4.0
           http://www.ncl.ucar.edu/current_release.shtml

On Mon, Jul 24, 2017 at 3:49 AM, Aditi Modi <aditimodi91 at gmail.com> wrote:

> Dear all,
>
> I am trying to plot the wheeler kiladis diagram for the OLR daily data
> from NOAA and the following ncl script shows the error:
>
> nMsg=390635003  User must preprocess to remove _FillValue
> (0)               FFTs do not allow missing values!!
>
> Script: My NCL version (6.1.2)
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"
>
>   case     = "wheeler"
>   diro    = "./"
>   latN    = 15
>   latS    = -latN
>
>   nDayWin = 96
>   nDaySkip =1
>
>    opt  = True
>    opt at debug= True
>    opt at pltType     = "eps"
>    opt at cnLinesOn   = False   ; turn off contour lines
>
>    spd = 1
>    var = "olr"
>
>  setfileoption("nc", "FileStructure", "Advanced")
>
>    f =  addfile("olr.day.mean.nc", "r")
>  sla =  f->olr(:,{latS:latN},:)
>
> olr at _FillValue = olr at missing_value
>
>  wkSpaceTime (olr, diro, case, var,latN, spd, nDayWin, nDaySkip, opt  )
>
>
> _______________________________________________
> 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/20170724/a28ef84e/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig1.Asym.wheeler_olr.png
Type: image/png
Size: 56421 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/a28ef84e/attachment-0005.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig1.Sym.wheeler_olr.png
Type: image/png
Size: 56089 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/a28ef84e/attachment-0006.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig2.wheeler_olr.png
Type: image/png
Size: 53792 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/a28ef84e/attachment-0007.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig3.Asym.wheeler_olr.png
Type: image/png
Size: 81442 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/a28ef84e/attachment-0008.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Fig3.Sym.wheeler_olr.png
Type: image/png
Size: 88334 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/a28ef84e/attachment-0009.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ncltalk.AditiModi.ncl
Type: application/octet-stream
Size: 1005 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/a28ef84e/attachment-0001.obj 


More information about the ncl-talk mailing list