Re: Request

From: donna Cote <d-cote_at_nyahnyahspammersnyahnyah>
Date: Wed May 01 2013 - 09:53:05 MDT

Sachin, I have done graphs similar to what you are trying to do and find
that the conditional:

   if (nf.ne.0) then

isn't sufficient and that I had to add a check for missing values

   if ((.not.ismissing(nf)).and.(nf.ne.0)) then

good luck.

Donna

-- 
Donna Cote
Senior Research Associate
The Academy for Advanced Telecommunications and Learning Technologies
Texas A&M University
On 4/29/13 1:00 PM, ncl-talk-request@ucar.edu wrote:
> Date: Sun, 28 Apr 2013 23:24:47 +0000
> From: nand_s<sachin.nand@usp.ac.fj>
> Subject: Re: Request
> To: Adam Phillips<asphilli@ucar.edu>
> Cc:"ncl-talk@ucar.edu"  <ncl-talk@ucar.edu>
> Message-ID:
> 	<72337BC310441640929317A240FBB9020B096413@suvxch10mb5.usp.ac.fj>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> I have tried executing my NCL code below in order to generate multiple graphs of Temperature versus Pressure and Salinity versus Pressure but it generating error as "missing value as input, can't continue". Can anyone please help me out on this one. The code are given below:
>
> 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"
> ;************************************************
> begin
> ;************************************************
> ; get list of files
> ;************************************************
> diri  = "pacific-12-2012/pacific/2012/12/"         ; input directory
> fili  = systemfunc("cd "+diri+" ; ls nodc_D5902072*nc")
> print(fili)
> nfili = dimsizes(fili)
>
>
> ;************************************************
> ; plot resources
> ;************************************************
> res                   = True                       ; plot mods desired
> res@trYReverse        = True                       ; reverse Y-axis
> res@xyLineThicknessF  = 2                          ; choose dash patterns
> res@gsnDraw           = False
> res@gsnFrame          = False
>
>
> resP                  = True
> resP@gsnMaximize      = True
>
> plot = new (2, "graphic")
> plot1 = new(nfili,"graphic")
> plot2 = plot
>
> do nf=0,nfili-1
>      f = addfile (diri+fili(nf),"r")
>      t = f->temperature(0,:,0,0)
>      s = f->salinity(0,:,0,0)
>      sfx   = get_file_suffix(fili(nf),0)
>      pname = sfx@fBase
>      wks      = gsn_open_wks ("ps",pname)
>      res@xyLineColor      = (/"blue"/)
>      plot1(nf)  = gsn_csm_xy (wks,t,t&pressure,res) ; create plot
>      res@xyLineColor      = (/"red"/)
>      plot2(nf)  = gsn_csm_xy (wks,s,s&pressure,res) ; create plot
>      if (nf.ne.0) then
>         overlay(plot1(0),plot1(nf))
>         overlay(plot2(0),plot2(nf))    .................Error occurs in these lines!!!!
>      end if
>      delete([/t,s/])
> end do
> resP@txString = fili(nf)
> gsn_panel(wks,(/plot1(0),plot2(0)/),(/2,1/),resP)
> end
>
>
> Thanks
> Sachin.
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 1 09:53:17 2013

This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT