Re: ncl-talk Digest, Vol 96, Issue 30

From: Run Liu <liuruncn_at_nyahnyahspammersnyahnyah>
Date: Wed Nov 30 2011 - 04:54:19 MST

Hi, All

 I'm a newer to study NCL. I have a simple question. Let me describe it
first.
 After running the WRF, i got so many output files. I want to use NCL to
analyse them. I start with the simplist scirpt, just as 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

   f =
addfile("/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_01:00:
00.nc","r")
  T = f->T
   printVarSummary(T)

end

it worked, it showes that :Variable: T
Type: float
Total Size: 1154736 bytes
            288684 values
Number of Dimensions: 4
Dimensions and sizes: [Time | 1] x [bottom_top | 27] x [south_north | 99]
x [west_east | 108]
Coordinates:
Number Of Attributes: 6
  FieldType : 104
  MemoryOrder : XYZ
  description : perturbation potential temperature (theta-t0)
  units : K
  stagger :
  coordinates : XLONG XLAT

But when i changed another similar script, it failed
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

  diri = "/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/"
  fils = systemfunc ("ls " +diri+ "wrfout_d03_2008-11-01_1*.nc")
  f = addfiles(fils,"r")
   T = f->T
   printVarSummary(T)

end

it showed that ls:
/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_1*.nc:
No such file or directory
warning:Argument 0 of the current function or procedure was coerced to the
appropriate type and thus will not change if the function or procedure
modifies its value
fatal:(-2147483647) has no file extension, can't determine type of file to
open
fatal:["NclVar.c":1376]:Assignment type mismatch, right hand side can't be
coerced to type of left hand side
fatal:Execute: Error occurred at or near line 12 in file file.ncl

or i change fils = systemfunc ("ls " +diri+
"wrfout_d03_2008-11-01_1*.nc") to fils = systemfunc ("ls " +diri+
"wrfout_d03_2008-11-01_1*") ,it showed
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_19:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_18:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_17:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_16:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_15:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_14:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_13:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_12:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_11:00:00)
has no file extension, can't determine type of file to open
fatal:(/nuwa_cluster/home/rcecstu03/RunLiu/WRF/run/PRD/wrfout_d03_2008-11-01_10:00:00)
has no file extension, can't determine type of file to open
fatal:(f) does not reference a file
fatal:Execute: Error occurred at or near line 13 in file file.ncl

what should i do? look forward your help,thanks

2011/11/18 <ncl-talk-request@ucar.edu>

> Send ncl-talk mailing list submissions to
> ncl-talk@ucar.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> or, via email, send a message with subject or body 'help' to
> ncl-talk-request@ucar.edu
>
> You can reach the person managing the list at
> ncl-talk-owner@ucar.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ncl-talk digest..."
>
>
> Today's Topics:
>
> 1. 2 dimensional running local area average (Stephan Matthiesen)
> 2. Two legends for Four lines ? (Helen Parish)
> 3. Looking for reference datafile (Gerald Creager)
> 4. Re: Looking for reference datafile (Dennis Shea)
> 5. Re: Two legends for Four lines ? (Mary Haley)
> 6. upscript (Chao Luo)
> 7. Re: upscript (Rick Brownrigg)
> 8. Re: Looking for reference datafile (Gerald Creager)
> 9. Re: upscript (Chao Luo)
> 10. label bar labels and WRF contour (David B. Reusch)
> 11. Re: Two legends for Four lines ? (Mary Haley)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 17 Nov 2011 08:40:25 +0000
> From: Stephan Matthiesen <info@stephan-matthiesen.de>
> Subject: 2 dimensional running local area average
> To: ncl-talk@ucar.edu
> Message-ID: <4EC4C879.5090605@stephan-matthiesen.de>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hello,
>
> I'm looking for a function that can calculate running local area
> averages, i.e. for each point xi,yi the average of all points xj,yj that
> are within n gridpoints of xi,yi.
>
> That is essentially a 2-d version of runave. Is there a function that
> does that?
>
> I thought perhaps one of the regridding functions might do that.
> area_hi2lores is getting close to what I need, but it averages only when
> reducing the grid, while I need it for the original grid resolution.
>
> Are there any functions that help, or do I have to do it manually?
>
> Thanks a lot in advance
> Stephan
>
> --
> Stephan Matthiesen
> http://www.stephan-matthiesen.de
> Neu auf www.science-texts.de: Novembermuster
>
> LinkedIn: http://www.linkedin.com/in/stephanmatthiesen
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 17 Nov 2011 05:16:31 -0800
> From: Helen Parish <hparish@ess.ucla.edu>
> Subject: Two legends for Four lines ?
> To: ncl-talk@ucar.edu
> Cc: hparish@ess.ucla.edu
> Message-ID: <A569F566-B13C-4549-805D-E77BAD2631B3@ess.ucla.edu>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
>
> Does anyone know if there is a way to plot legends for only some of
> the lines on a plot ?. I have four lines in the example below, which
> shows a section of the NCL code. I want to put legends on the plot for
> only two of these lines. For the other two lines I do not want any
> part of the legend to appear. I tried just putting "" for one of the
> legend labels I did not want, which removed the writing, but still
> left a colored line for the legend. I also tried omitting the fourth
> label in the ExplicitLegendLabels assignment, but this still left a
> colored line and put rubbish in the written part of the legend.
>
> Is there a way to create legends for just 2 of the 4 lines ?.
>
> Thanks,
> Helen.
>
>
>
> Below is an excerpt from the routine :
>
>
> res@xyLineColors =
> (/"black","blue","red","red"/) ; change line colour
>
> res@xyDashPatterns = (/0,1,2,2/) ;
> choose dash patterns
>
> res@xyLineThicknesses = (/1.0,2.0,2.0,2.0/) ;
> make 2nd, 3rd, 4th lines thicker
>
> ; add a legend
> res@pmLegendDisplayMode = "Always" ; turn on legend
>
> res@pmLegendSide = "Top" ; Change location
> of
> res@pmLegendParallelPosF = .80 ; move units right
> res@pmLegendOrthogonalPosF = -0.275 ; more neg = down
>
> res@pmLegendWidthF = 0.12 ; Change width and
> res@pmLegendHeightF = 0.10 ; height of legend.
> res@lgLabelFontHeightF = .02 ; change font
> height
> res@lgPerimOn = False ; no box around
> ; labels for the legend
> res@xyExplicitLegendLabels = (/"","Mean","Standard deviation"/)
>
> plot = gsn_csm_xy (wks,x,y,res) ; create plot
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 17 Nov 2011 09:23:02 -0600
> From: Gerald Creager <gerry.creager@tamu.edu>
> Subject: Looking for reference datafile
> To: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <4EC526D6.3020805@tamu.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I'm looking for the datafile (gx1v3.TEMP.nc) used in example iso_1.ncl
> on this page: http://www.ncl.ucar.edu/Applications/iso.shtml
>
> Is it available anywhere, easily?
>
> Thanks, Gerry
> --
> Gerry Creager -- gerry.creager@tamu.edu
> Texas Mesonet -- AATLT, Texas A&M University
> Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
> Office: 7607 Eastmark Drive, Suite 112, College Station, TX 77840
>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 17 Nov 2011 08:43:09 -0700
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: Looking for reference datafile
> To: gerry.creager@tamu.edu
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <4EC52B8D.3060503@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> ftp ftp.cgd.ucar.edu
> anonymous
> email
> cd pub/shea/POP
> get gx1v3.TEMP.nc
> quit
>
> 20645792 Nov 17 08:41 gx1v3.TEMP.nc
>
> Good Luck
> D
>
> On 11/17/11 8:23 AM, Gerald Creager wrote:
> > I'm looking for the datafile (gx1v3.TEMP.nc) used in example iso_1.ncl
> > on this page: http://www.ncl.ucar.edu/Applications/iso.shtml
> >
> > Is it available anywhere, easily?
> >
> > Thanks, Gerry
>
>
> ------------------------------
>
> Message: 5
> Date: Thu, 17 Nov 2011 10:12:12 -0700
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Two legends for Four lines ?
> To: Helen Parish <hparish@ess.ucla.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <5635B76E-7A66-4E5F-B8B2-D0352EDEF7F3@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Helen,
>
> The legend object that's associated with an XY plot that you create is
> not very customizable in this fashion. I was able to turn off the
> labels the same way you did, but instead of setting
> xyExplicitLegendLabels to 2 elements, I set it to four elements,
> with the last two being equal to "". This way you don't get the
> label rubbish.
>
> However, you can't turn off the individual lines.
>
> I will write an example script that shows how to customize your legend.
>
> --Mary
>
> On Nov 17, 2011, at 6:16 AM, Helen Parish wrote:
>
> > Does anyone know if there is a way to plot legends for only some of
> > the lines on a plot ?. I have four lines in the example below, which
> > shows a section of the NCL code. I want to put legends on the plot for
> > only two of these lines. For the other two lines I do not want any
> > part of the legend to appear. I tried just putting "" for one of the
> > legend labels I did not want, which removed the writing, but still
> > left a colored line for the legend. I also tried omitting the fourth
> > label in the ExplicitLegendLabels assignment, but this still left a
> > colored line and put rubbish in the written part of the legend.
> >
> > Is there a way to create legends for just 2 of the 4 lines ?.
> >
> > Thanks,
> > Helen.
> >
> >
> >
> > Below is an excerpt from the routine :
> >
> >
> > res@xyLineColors =
> > (/"black","blue","red","red"/) ; change line colour
> >
> > res@xyDashPatterns = (/0,1,2,2/) ;
> > choose dash patterns
> >
> > res@xyLineThicknesses = (/1.0,2.0,2.0,2.0/) ;
> > make 2nd, 3rd, 4th lines thicker
> >
> > ; add a legend
> > res@pmLegendDisplayMode = "Always" ; turn on legend
> >
> > res@pmLegendSide = "Top" ; Change location
> > of
> > res@pmLegendParallelPosF = .80 ; move units right
> > res@pmLegendOrthogonalPosF = -0.275 ; more neg = down
> >
> > res@pmLegendWidthF = 0.12 ; Change width and
> > res@pmLegendHeightF = 0.10 ; height of legend.
> > res@lgLabelFontHeightF = .02 ; change font
> > height
> > res@lgPerimOn = False ; no box around
> > ; labels for the legend
> > res@xyExplicitLegendLabels = (/"","Mean","Standard deviation"/)
> >
> > plot = gsn_csm_xy (wks,x,y,res) ; create plot
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 6
> Date: Thu, 17 Nov 2011 12:20:51 -0500 (EST)
> From: Chao Luo <chao.luo@eas.gatech.edu>
> Subject: upscript
> To: ncl-talk@ucar.edu
> Message-ID: <9238e9aa-b501-436d-ac15-e938d653fddb@mail4.gatech.edu>
> Content-Type: text/plain; charset=utf-8
>
> Hi,
>
> I have a simple question. Want to change "m/s" to ms^-1, but don't know
> how to change "-1" for upscript in NCL script.
>
> Thanks,
>
> Chao
>
>
> ------------------------------
>
> Message: 7
> Date: Thu, 17 Nov 2011 10:27:50 -0700
> From: Rick Brownrigg <brownrig@ucar.edu>
> Subject: Re: upscript
> To: Chao Luo <chao.luo@eas.gatech.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <70561BDF-4B0A-4AEF-A82F-9F19830B9D93@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi,
>
> Check out the discussion on Text Function Codes:
>
> http://www.ncl.ucar.edu/Document/Graphics/function_code.shtml
>
> Rick
>
> On Nov 17, 2011, at 10:20 AM, Chao Luo wrote:
>
> > Hi,
> >
> > I have a simple question. Want to change "m/s" to ms^-1, but don't know
> how to change "-1" for upscript in NCL script.
> >
> > Thanks,
> >
> > Chao
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 8
> Date: Thu, 17 Nov 2011 12:16:24 -0600
> From: Gerald Creager <gerry.creager@tamu.edu>
> Subject: Re: Looking for reference datafile
> To: Dennis Shea <shea@ucar.edu>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <4EC54F78.2020308@tamu.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Thanks! Got it.
> gerry
>
> On 11/17/2011 09:43 AM, Dennis Shea wrote:
> > ftp ftp.cgd.ucar.edu
> > anonymous
> > email
> > cd pub/shea/POP
> > get gx1v3.TEMP.nc
> > quit
> >
> > 20645792 Nov 17 08:41 gx1v3.TEMP.nc
> >
> > Good Luck
> > D
> >
> > On 11/17/11 8:23 AM, Gerald Creager wrote:
> >> I'm looking for the datafile (gx1v3.TEMP.nc) used in example iso_1.ncl
> >> on this page: http://www.ncl.ucar.edu/Applications/iso.shtml
> >>
> >> Is it available anywhere, easily?
> >>
> >> Thanks, Gerry
>
> --
> Gerry Creager -- gerry.creager@tamu.edu
> Texas Mesonet -- AATLT, Texas A&M University
> Cell: 979.229.5301 Office: 979.458.4020 FAX: 979.862.3983
> Office: 7607 Eastmark Drive, Suite 112, College Station, TX 77840
>
>
> ------------------------------
>
> Message: 9
> Date: Thu, 17 Nov 2011 13:22:18 -0500 (EST)
> From: Chao Luo <chao.luo@eas.gatech.edu>
> Subject: Re: upscript
> To: Rick Brownrigg <brownrig@ucar.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <3d2b2eec-2172-4357-bb5b-1fff7b93cacb@mail4.gatech.edu>
> Content-Type: text/plain; charset=utf-8
>
> Thanks much!
>
> Chao
>
>
> ----- Original Message -----
> From: "Rick Brownrigg" <brownrig@ucar.edu>
> To: "Chao Luo" <chao.luo@eas.gatech.edu>
> Cc: ncl-talk@ucar.edu
> Sent: Thursday, November 17, 2011 9:27:50 AM
> Subject: Re: upscript
>
> Hi,
>
> Check out the discussion on Text Function Codes:
>
> http://www.ncl.ucar.edu/Document/Graphics/function_code.shtml
>
> Rick
>
> On Nov 17, 2011, at 10:20 AM, Chao Luo wrote:
>
> > Hi,
> >
> > I have a simple question. Want to change "m/s" to ms^-1, but don't know
> how to change "-1" for upscript in NCL script.
> >
> > Thanks,
> >
> > Chao
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 10
> Date: Thu, 17 Nov 2011 11:22:41 -0700
> From: "David B. Reusch" <dreusch@ees.nmt.edu>
> Subject: label bar labels and WRF contour
> To: NCL Talk <ncl-talk@ucar.edu>, wrfhelp@ucar.edu
> Message-ID: <4EC550F1.2010206@ees.nmt.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Not sure if this is NCL or the WRF NCL scripts so you're both getting
> this email. I've been trying to create a soil category plot from
> geogrid data starting from the vegland_1
> <http://www.ncl.ucar.edu/Applications/Scripts/vegland_1.ncl> example on
> the NCL site. The problem I can't seem to resolve is that in my label
> bar I can either get (a) 16 number labels and 17 label boxes or (b) 15
> number labels + "Label 15" and 16 label boxes (for my 16 category soil
> data). I've tried to follow this through the WRFUserARW.ncl code but
> have given up (after trying lots of variations...). Although I am
> providing a lbUserLabels all the way through (as far as I can tell),
> this seems to be being ignored at some level I haven't nailed down.
>
> I have put the file dbr_wrf_plot_lb.tgz at the ftp incoming site. It
> has my script, my input file and an output file.
>
> Thanks,
> Dave Reusch
>
> --
> Associate Research Professor of Climatology
> Dept of Earth and Environmental Science
> MSEC 304; 801 Leroy Place
> New Mexico Tech
> Socorro, NM 87801
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20111117/fa6de231/attachment.html
>
> ------------------------------
>
> Message: 11
> Date: Thu, 17 Nov 2011 11:44:56 -0700
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Two legends for Four lines ?
> To: Helen Parish <hparish@ess.ucla.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <4C1159C8-6247-45A3-8D3E-503AF880E48A@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Helen,
>
> Please see example 13 on the legend page:
>
> http://www.ncl.ucar.edu/Applications/legend.shtml#ex13
>
> This example is probably a bit of overkill for what you need,
> for it tries to recreate an XY legend from scratch.
>
> Note that this XY plot has four curves, but I only created
> two legend items. See the "NumberLegendItems"
> attribute in this code.
>
> --Mary
>
> On Nov 17, 2011, at 6:16 AM, Helen Parish wrote:
>
> > Does anyone know if there is a way to plot legends for only some of
> > the lines on a plot ?. I have four lines in the example below, which
> > shows a section of the NCL code. I want to put legends on the plot for
> > only two of these lines. For the other two lines I do not want any
> > part of the legend to appear. I tried just putting "" for one of the
> > legend labels I did not want, which removed the writing, but still
> > left a colored line for the legend. I also tried omitting the fourth
> > label in the ExplicitLegendLabels assignment, but this still left a
> > colored line and put rubbish in the written part of the legend.
> >
> > Is there a way to create legends for just 2 of the 4 lines ?.
> >
> > Thanks,
> > Helen.
> >
> >
> >
> > Below is an excerpt from the routine :
> >
> >
> > res@xyLineColors =
> > (/"black","blue","red","red"/) ; change line colour
> >
> > res@xyDashPatterns = (/0,1,2,2/) ;
> > choose dash patterns
> >
> > res@xyLineThicknesses = (/1.0,2.0,2.0,2.0/) ;
> > make 2nd, 3rd, 4th lines thicker
> >
> > ; add a legend
> > res@pmLegendDisplayMode = "Always" ; turn on legend
> >
> > res@pmLegendSide = "Top" ; Change location
> > of
> > res@pmLegendParallelPosF = .80 ; move units right
> > res@pmLegendOrthogonalPosF = -0.275 ; more neg = down
> >
> > res@pmLegendWidthF = 0.12 ; Change width and
> > res@pmLegendHeightF = 0.10 ; height of legend.
> > res@lgLabelFontHeightF = .02 ; change font
> > height
> > res@lgPerimOn = False ; no box around
> > ; labels for the legend
> > res@xyExplicitLegendLabels = (/"","Mean","Standard deviation"/)
> >
> > plot = gsn_csm_xy (wks,x,y,res) ; create plot
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 96, Issue 30
> ****************************************
>

-- 
Liu Run
State Key Joint Laboratory of Environment Simulation and Pollution Control
College of Environmental Sciences and Engineering
Peking University, Beijing
P.R.China, 100871
E-mail: liuruncn@gmail.com
Mobile: 86-15201475934

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Nov 30 04:54:32 2011

This archive was generated by hypermail 2.1.8 : Wed Nov 30 2011 - 19:52:47 MST