Re: A few simple questions!

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 12 Feb 2007 09:10:42 -0700 (MST)

On Fri, 9 Feb 2007, Mateus da Silva Teixeira wrote:

> Dear NCL users,
>
> I've two simple questions:
> 1) I have a sequential access binary file created in a little_endian
> plataform in which the dimension data are (time | 21185, lat | 50, lon | 50).
> So, to read this file I should use fbinrecread() function. My doubt: what's
> the difference reading this file with two different ways? These different
> ways are below:
>
> prec = new((/21185,51,51/),float)
> prec = fbinrecread("brazil.daily.prcp.le.b19480101.e20051231", 0,
> (/21185,51,51/), "float")
>
> and
> prec = new((/21185,51,51/),float)
> do i=0,21184
> prec(i,:,:) =
> fbinrecread("brazil.daily.prcp.le.b19480101.e20051231", i, (/51,51/),
> "float")
> end do
>
> I ask it because the precipitation plots obtained with the same data, but
> read with these different ways, aren't equal. The plots from the first way of
> reading these data appears to move to right (or east), while with the second
> way they are correct.
>
> 2) My following question is about resources. I've resources that are defaults
> depending of the kind of the plot. So, I made some tests with the load
> command, putting it inside the code, instead of putting it at beginning of
> the script, like illustrated below:
>
> load "$NCARG_ROOT/lib/ncarg/nclex/gsun/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> begin
> vento_u=addfile("u.200.jun.2002.nc","r")
> ventu_v=addfile("v.200.jun.2002.nc","r")
> u=vento_u->uwnd(0,0,:,:)
> v=ventu_v->vwnd(0,0,:,:)
> arquivo="vectors"
>
> Xwks = gsn_open_wks("ps",arquivo)
> load "./vectors.res" ; <<=== LOADING RESOURCES FROM EXTERNAL
> FILE
> plot = gsn_csm_streamline_map(Xwks,u,v,res)
> end
>
>
> VECTORS.RES
> res = True
> res_at_mpOutlineBoundarySets = "National" res_at_mpLimitMode
> = "LatLon" res_at_mpMinLonF = 270
> res_at_mpMaxLonF = 330 res_at_mpMinLatF =
> -60 res_at_mpMaxLatF = 15
> res_at_mpPerimOn = True
>
> Is it a good programming practice? There is another way to read default
> resources for specific kind of plots?
>
> Thanks
>
> Mateus
>

Hi Mateus,

Dennis pointed out to me that the second part of your question
hasn't been answered yet. Sorry about that.

Instead of using the "load" command, I would recommend using
the "loadscript" procedure, which allows you to conditionally
load scripts. Please see:

   http://www.ncl.ucar.edu/Document/Functions/Built-in/loadscript.shtml

This was added in a034, so you must have the most recent version
of NCL in order to use this.

--Mary

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 12 2007 - 09:10:42 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 13 2007 - 14:07:37 MST