[ncl-talk] Temperature difference

Muhammad Omer Mughal m.mughal1 at postgrad.curtin.edu.au
Sun Nov 19 03:03:09 MST 2017


Hi


Thanks for the reply. Yes I have been using NCL for a while but since CDO has changed the dimensions of the variables therefore it was difficult for me to plot. Any how I have used the map resources from a file named "c" in the attached code and it worked. Now the last two lines of the code are supposed to add the outline using a shape file but it is not appearing in the output without showing any error. Can you kindly suggest why its not being added to the output ?




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<mailto:m.lynch at curtin.edu.au>
Web | http://curtin.edu.au<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: Sunday, 19 November 2017 2:35:53 AM
To: Muhammad Omer Mughal
Cc: ncl-talk at ucar.edu
Subject: Re: Temperature difference

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<mailto: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<mailto:m.lynch at curtin.edu.au>
Web | http://curtin.edu.au<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<mailto:shea at ucar.edu>>
Sent: Saturday, 18 November 2017 11:04:59 PM
To: Muhammad Omer Mughal
Cc: ncl-talk at ucar.edu<mailto: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<mailto: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<mailto:m.lynch at curtin.edu.au>
Web | http://curtin.edu.au<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/20171119/e795b29c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tempdiff2.ncl
Type: application/octet-stream
Size: 1665 bytes
Desc: tempdiff2.ncl
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171119/e795b29c/attachment.obj>


More information about the ncl-talk mailing list