[ncl-talk] Temperature difference

Dennis Shea shea at ucar.edu
Sat Nov 18 11:35:53 MST 2017


You have been using NCL for some time. You should know:

[1]* 'diff' is a variable*.
      Attributes [ *@ *] include long_name, units and, if appropriate for
some map graphics, the special lat2d and lon2d attributes.
      Coordinate variables [ *&* ] eg: time, lev,lat,lon could also be
assigned ... if appropriate.
      You can manually set these or use
      See:

https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarCoords.shtml

https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarAtts.shtml

https://www.ncl.ucar.edu/Document/Functions/Contributed/copy_VarMeta.shtml

[2] There are many NCL examples on the Applications page variables plotted
on 'maps'. Please look.
      *'res' is a variable* to which *all* 'map', in fact, all graphical
resources are associated.

===
To review NCL, please carefully read the User Guide at:
                http://www.ncl.ucar.edu/Document/Manuals/
It has many examples.

Good Luck

On Sat, Nov 18, 2017 at 9:28 AM, Muhammad Omer Mughal <
m.mughal1 at postgrad.curtin.edu.au> wrote:

> Hi
>
>
> Can I assign map resources to diff ?
>
>
>
>
> Muhammad Omer Mughal
> MSc BSc Mechanical Engineering
> PhD  Research Scholar
> Remote Sensing and Satellite Research Group
> Department of Imaging and Applied Physics
> Curtin University
>
> Curtin University
> Tel | +61 8 9266 7962
> Fax | +61 8 9266 2377
> Mobile | 0470 237 525
>
> Email | m.mughal1 at postgrad.curtin.edu.au <m.lynch at curtin.edu.au>
> Web | http://curtin.edu.au
>
> Curtin University is a trademark of Curtin University of Technology.
> CRICOS Provider Code 00301J (WA), 02637B (NSW)
>
>
> ------------------------------
> *From:* Dennis Shea <shea at ucar.edu>
> *Sent:* Saturday, 18 November 2017 11:04:59 PM
> *To:* Muhammad Omer Mughal
> *Cc:* ncl-talk at ucar.edu
> *Subject:* Re: Temperature difference
>
> I speculate you are overwriting the generated png file with each iteration.
>
> ---
> [1] Move the following before the 'do' loop
>
> wks = gsn_open_wks("png","diff")
>
> or
>
> [2] Keep it where it is but make the line
>
> wks = gsn_open_wks("png","diff_"+sprinti("%0.2i", it) )
>
> On Sat, Nov 18, 2017 at 2:51 AM, Muhammad Omer Mughal <
> m.mughal1 at postgrad.curtin.edu.au> wrote:
>
> Hi
>
>
> I am trying to use the following script to generate a temperature
> difference between two files. This script should generate 24 plots instead
> of just one. When I add "it" in tc2= wrf_user_getvar(a,"T2",it) then I
> get this error "Subscript out of range, error in subscript #0". This
> could be because I used NCO to generate these files which stripped out the
> time dimension since I have averaged them over time. I would appreciate if
> some one can help me out here. Kindly note that I donot intend to waste
> someone personal time.
>
>
> do it=0,23
>  wrf_file1 = "UTC_" + it + ".nc"
>  a = addfile(wrf_file1, "r")
>  wrf_file2 = "../OmerForest/UTC_" + it + ".nc"
>  b=addfile(wrf_file2,"r")
>
> tc2= wrf_user_getvar(a,"T2",0)
> tcf= wrf_user_getvar(b,"T2",0)
> diff=tc2-tcf
> wks = gsn_open_wks("png","diff")
> res=True
> plot = gsn_csm_contour(wks,diff,res)
>  end do
>
>
>
> Muhammad Omer Mughal
> MSc BSc Mechanical Engineering
> PhD  Research Scholar
> Remote Sensing and Satellite Research Group
> Department of Imaging and Applied Physics
> Curtin University
>
> Curtin University
> Tel | +61 8 9266 7962
> Fax | +61 8 9266 2377
> Mobile | 0470 237 525
>
> Email | m.mughal1 at postgrad.curtin.edu.au <m.lynch at curtin.edu.au>
> Web | http://curtin.edu.au
>
> Curtin University is a trademark of Curtin University of Technology.
> CRICOS Provider Code 00301J (WA), 02637B (NSW)
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171118/bd071232/attachment.html>


More information about the ncl-talk mailing list