Re: Adding new variable to existing NetCDF file

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 23 2012 - 12:20:13 MDT

addfile with the 'w' option
http://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml

   f = addfile("foo.nc", "w")

   t = f->TEMP ; degC
   t = t + 273.15
   t@units = "degK"

   f->TEMP = t ; overwrite

On 10/23/12 12:10 PM, Patrick C. Campbell wrote:
> In addition to my previous question, it would be advantageous if someone also could provide information on replacing a NetCDF variable using NCL, and simply how to change the units of the new variable within the NetCDF file.
>
> Does anyone have any information on this as well?
>
> Thanks!
>
> Patrick
> ________________________________________
> From: ncl-talk-bounces@ucar.edu [ncl-talk-bounces@ucar.edu] on behalf of ncl-talk-request@ucar.edu [ncl-talk-request@ucar.edu]
> Sent: Tuesday, October 23, 2012 12:00 PM
> To: ncl-talk@ucar.edu
> Subject: ncl-talk Digest, Vol 107, Issue 33
>
> 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. gsn_csm_hov for time-lat plot (Xi Chang)
> 2. Re: how to show decimal on contour line (David Brown)
> 3. Re: Label bar and constant field (David Brown)
> 4. How to read this data correctly (Thomas Tobian)
> 5. Does "break" in NCL work the same way as "exit" in fortran?
> (Wen.J.Qu)
> 6. Re: Does "break" in NCL work the same way as "exit" in
> fortran? (Dennis Shea)
> 7. Re: How to read this data correctly (Dennis Shea)
> 8. Re: label bar perimeter reduction (David Brown)
> 9. How to accomplish a loop with negative stride? (Wen.J.Qu)
> 10. Re: How to accomplish a loop with negative stride? (David Brown)
> 11. Re: gsn_csm_hov for time-lat plot (Dennis Shea)
> 12. Re: How to accomplish a loop with negative stride? (Wen.J.Qu)
> 13. Looping through dtrend function (Hyacinth Nnamchi)
> 14. Re: Looping through dtrend function (Dennis Shea)
> 15. Re: Looping through dtrend function (Hyacinth Nnamchi)
> 16. Re: FW: I mean regridding the data to a rectiliniear lat /
> lon grid (Ping Yang)
> 17. Re: Plotting large domain (Mary Haley)
> 18. Re: problem with WRF output (Mary Haley)
> 19. Re: Process optimization (Mary Haley)
> 20. Re: To add row and column headings to an ascii file (Mary Haley)
> 21. Re: Opacity in contour plot (Mary Haley)
> 22. Re: I mean regridding the data to a rectiliniear lat / lon
> grid (Mary Haley)
> 23. Re: Plotting large domain (Mary Haley)
> 24. Re: I mean regridding the data to a rectiliniear lat / lon
> grid (Dennis Shea)
> 25. Adding new variable to existing NetCDF file (Patrick C. Campbell)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 22 Oct 2012 20:16:40 +0200
> From: Xi Chang <xi.chang01@gmail.com>
> Subject: gsn_csm_hov for time-lat plot
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAGfRhtfcCYmY7D9-+WVvspmj+Z0fZooOuFV09BMj6cEdjvvMEQ@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear NCL users,
>
> Is it possible to use "gsn_csm_hov" to creat time(y)-latitude(x) plot
> instead of using "gsn_csm_time_lat"
> If it's possible anybody has an experience to shift the "lat" as the
> rightmost dimension.
>
> Thanks a lot,
>
> == Xi
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/bf9a9859/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Mon, 22 Oct 2012 12:27:28 -0600
> From: David Brown <dbrown@ucar.edu>
> Subject: Re: how to show decimal on contour line
> To: JinQ Liu <liujq_0912@126.com>
> Cc: ncl <ncl-talk@ucar.edu>
> Message-ID: <D7752E00-A7ED-4021-95C2-F12A5A79211D@ucar.edu>
> Content-Type: text/plain; charset="us-ascii"
>
> You need to set cnLineLabelFormat. See example tm_8.ncl for examples of formatting strings. The simplest thing you could use is something like "0.5f"
> See http://www.ncl.ucar.edu/Document/Graphics/format_spec.shtml for details of the formatting scheme.
> -dave
>
> On Oct 22, 2012, at 5:31 AM, JinQ Liu wrote:
>
>> In script, I use
>> res@cnFillOn = False
>> res@cnLinesOn = True
>> res@cnLevels =(/1000.0,1002.5,1005.0,1007.5,1010.0,1012.5/)
>> res@cnLineLabelInterval = 1
>> but the output picture show value 1000 1003 1005 1008 on contour lines. it seems the decimal are rounded off.
>> How can I draw original decimal value on contour line?
>> Thanks in advance!
>>
>> Ji nQ
>>
>>
>>
>>
>>
>> <line.eps><line.ncl>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/d2debc9c/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Mon, 22 Oct 2012 12:29:26 -0600
> From: David Brown <dbrown@ucar.edu>
> Subject: Re: Label bar and constant field
> To: Enrico Benso <enricobenso@gmail.com>
> Cc: ncl Talk <ncl-talk@ucar.edu>
> Message-ID: <FF78ABD7-4A84-45AD-B12D-9A2F8129F46D@ucar.edu>
> Content-Type: text/plain; charset="us-ascii"
>
> Glad to hear it.
> -dave
>
> On Oct 21, 2012, at 2:56 PM, Enrico Benso wrote:
>
>> Perfect, it works!
>>
>> Thanks!
>>
>> Bye!
>>
>> Enrico
>>
>>
>>
>> Il giorno 18/ott/2012, alle ore 01:24, David Brown <dbrown@ucar.edu> ha scritto:
>>
>>>
>>> You need to set lbLabelAutoStride to False. There are a couple of other resources that would be good to set as well:
>>>
>>> lbres@lbLabelAutoStride = False
>>> lbres@lbLabelAngleF = -45.0 ; when you use all the labels they will overlap unless you make the font very small or you rotate the labels
>>> lbres@lbLabelAlignment = "interioredges" ; I am not sure why, but if you don't set this you will get an extra default label called "Label_17" -- interior edges should be the default
>>> Also you probably want to unset this (I just commented it out), but that is up to you.
>>>
>>> ; lbres@lbLabelJust = "CenterLeft" ; left justify labels
>>>
>>> Hope this helps.
>>> -dave
>>>
>>>
>>>
>>> On Oct 17, 2012, at 11:54 AM, Enrico Benso wrote:
>>>
>>>> Ok, it seems to work!
>>>> I also added a title an the label bar.
>>>> I wonder if is it possible to display a label every bar.
>>>> Right now it display a label every 2 bars.
>>>> I tried to set lbres@lbLabelStride = 1 but it doesn't work.
>>>>
>>>> Thanks a lot!!
>>>>
>>>> Enrico
>>>>
>>>> 2012/10/17 David Brown <dbrown@ucar.edu>
>>>> Hi Enrico,
>>>> Although I was able to get the "ForceAlways" option to work using a setvalues call on contour_tend right after this line:
>>>>
>>>> contour_tend = wrf_contour(a[it],wks, rain_tot_tend(it,:,:),opts_r) ; total (color)
>>>> setvalues contour_tend
>>>> "pmLabelBarDisplayMode" : "ForceAlways"
>>>> end setvalues
>>>>
>>>> it probably does not do what you want, because when the data are constant, it does not honor the explicit labels or colors.
>>>> Hopefully this can be corrected soon, but until then your only option is to manually create your own labelbar using gsn_create_labelbar.
>>>> It actually is not too hard. I have modified your original script to demonstrate a basic version. I am attaching it here. I also generated some
>>>> random data for the first frame just to see what the plot should look like when it has valid data.
>>>> -dave
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Oct 16, 2012, at 12:40 PM, Enrico Benso wrote:
>>>>
>>>>> Hi Dave,
>>>>>
>>>>> I tried pmLabelBarDisplayMode = "ForceAlways"
>>>>> but I get a lot of warnings and the label bar is not plotted even if precipitations are present:
>>>>>
>>>>> (0) Working on time: 2012-10-19_00:00:00
>>>>> warning:ContourPlotInitialize: scalar field is constant; ContourPlot not possible:[errno=1102]
>>>>> warning:ContourPlotSetValues: Data values out of range of levels set by EXPLICITLEVELS mode
>>>>> warning:lbPerimOn is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbLabelFontHeightF is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbAutoManage is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbLabelJust is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbLabelAutoStride is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbBoxMinorExtentF is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbTitleFontHeightF is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbTitleOn is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbTitleString is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbTitleJust is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>> warning:lbTitleOffsetF is not a valid resource in /prec3h_contour.PlotManager at this time
>>>>>
>>>>>
>>>>> If this can help you, I attach here my script.
>>>>>
>>>>>
>>>>> ; Example script to produce plots for a WRF real-data run,
>>>>> ; with the ARW coordinate dynamics option.
>>>>>
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
>>>>> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>>>>> ;load "./WRFUserARW.ncl"
>>>>>
>>>>> begin
>>>>> ;
>>>>> ; Make a list of all files we are interested in
>>>>> DATADir = "/home/vonjack/wrfems/runs/veneto/wrfprd/"
>>>>> FILES = systemfunc (" ls -1 " + DATADir + "*d02* ")
>>>>> numFILES = dimsizes(FILES)
>>>>> print("numFILES = " + numFILES)
>>>>> print(FILES)
>>>>> print (" ")
>>>>>
>>>>> ; We generate plots, but what kind do we prefer?
>>>>> ; type = "x11"
>>>>> ; type = "pdf"
>>>>> type = "png"
>>>>> ; type = "ncgm"
>>>>> ;type = "ps"
>>>>>
>>>>> type@wkWidth = 1024 ; default is 1024 by 1024
>>>>> type@wkHeight = 1024
>>>>> wks = gsn_open_wks(type,"img/prec3h")
>>>>>
>>>>>
>>>>> ; Set some basic resources
>>>>> res = True
>>>>> res@MainTitle = "www.avmeteo.it WRF 1.8Km"
>>>>> res@Footer = False
>>>>>
>>>>>
>>>>> pltres = True
>>>>> mpres = True
>>>>> mpres@mpOutlineOn = False
>>>>> mpres@mpGeophysicalLineColor = "Black"
>>>>> mpres@mpNationalLineColor = "Black"
>>>>> mpres@mpUSStateLineColor = "Black"
>>>>> mpres@mpGridLineColor = "Black"
>>>>> mpres@mpLimbLineColor = "Black"
>>>>> mpres@mpPerimLineColor = "Black"
>>>>> mpres@mpDataBaseVersion = "HighRes"
>>>>> mpres@mpGeophysicalLineThicknessF = 2
>>>>>
>>>>>
>>>>>
>>>>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>>>> a = addfiles(FILES+".nc","r")
>>>>>
>>>>> times = wrf_user_getvar(a,"times",-1) ; get all times in the file
>>>>> ntimes = dimsizes(times) ; number of times in the file
>>>>>
>>>>>
>>>>> ; Get non-convective, convective and total precipitation
>>>>> rain_exp = wrf_user_getvar(a,"RAINNC",-1)
>>>>> rain_con = wrf_user_getvar(a,"RAINC",-1)
>>>>> rain_tot = rain_exp + rain_con
>>>>> rain_tot@description = "Precipitazioni accumulate (3h)"
>>>>>
>>>>> ; just creating new arrays here
>>>>> rain_exp_tend = rain_exp
>>>>> rain_con_tend = rain_con
>>>>> rain_tot_tend = rain_tot
>>>>> rain_exp_tend = 0.0
>>>>> rain_con_tend = 0.0
>>>>> rain_tot_tend = 0.0
>>>>> rain_exp_tend@description = "Explicit Precipitation Tendency"
>>>>> rain_con_tend@description = "Param Precipitation Tendency"
>>>>> rain_tot_tend@description = "Precipitazioni accumulate (3h)"
>>>>>
>>>>> ; Calculate tendency values
>>>>> ; We know our data is available every 3 hours, so setting tend_int to 1 gives
>>>>> ; tendencies for 3 hours, setting it to 2, gives 6hourly tendencies
>>>>> tend_int = 1
>>>>> rain_exp_tend(tend_int:ntimes-1:tend_int,:,:) = rain_exp(tend_int:ntimes-1:tend_int,:,:) - rain_exp(0:ntimes-2:tend_int,:,:)
>>>>> rain_con_tend(tend_int:ntimes-1:tend_int,:,:) = rain_con(tend_int:ntimes-1:tend_int,:,:) - rain_con(0:ntimes-2:tend_int,:,:)
>>>>> rain_tot_tend(tend_int:ntimes-1:tend_int,:,:) = rain_tot(tend_int:ntimes-1:tend_int,:,:) - rain_tot(0:ntimes-2:tend_int,:,:)
>>>>>
>>>>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>>>>
>>>>> do it = tend_int,ntimes-1,tend_int ; Let's skip the first time as rain is 0 here
>>>>>
>>>>> print("Working on time: " + times(it) )
>>>>> res@TimeLabel = times(it) ; Set Valid time to use on plots
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ; Plotting options for Precipitation
>>>>> opts_r = res
>>>>> opts_r@UnitLabel = "mm"
>>>>> opts_r@cnLevelSelectionMode = "ExplicitLevels"
>>>>> opts_r@cnLevels = (/ .5, 1, 2, 5, 10, 15, 20, \
>>>>> 30, 40, 50, 60, 80, 100, 120, 150, 200, 250/)
>>>>> opts_r@cnFillColors = (/"0", "116","103", \
>>>>> "93","83", \
>>>>> "75","58","38", \
>>>>> "28","08","02","ForestGreen","Green","Chartreuse","Yellow","208","224","235"/)
>>>>> opts_r@cnInfoLabelOn = False
>>>>> opts_r@cnConstFLabelOn = False
>>>>> opts_r@cnFillOn = True
>>>>> opts_r@pmLabelBarDisplayMode = "ForceAlways"
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ; Precipitation Tendencies
>>>>> opts_r@SubFieldTitle = "da " + times(it-tend_int) + " a " + times(it)
>>>>>
>>>>> contour_tend = wrf_contour(a[it],wks, rain_tot_tend(it,:,:),opts_r) ; total (color)
>>>>> opts_r@cnFillOn = False
>>>>>
>>>>>
>>>>> delete(opts_r)
>>>>>
>>>>> pltres@PanelPlot = True
>>>>>
>>>>> ; MAKE PLOTS
>>>>>
>>>>>
>>>>> ; Total Precipitation Tendency + SLP
>>>>> plot = wrf_map_overlays(a[it],wks,contour_tend,pltres,mpres)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> shp_filename = "ITA_adm2.shp"
>>>>> f = addfile(shp_filename, "r") ; Open shapefile
>>>>> ;---Read data off shapefile
>>>>> segments = f->segments
>>>>> geometry = f->geometry
>>>>> segsDims = dimsizes(segments)
>>>>> geomDims = dimsizes(geometry)
>>>>> ;---Read global attributes
>>>>> geom_segIndex = f@geom_segIndex
>>>>> geom_numSegs = f@geom_numSegs
>>>>> segs_xyzIndex = f@segs_xyzIndex
>>>>> segs_numPnts = f@segs_numPnts
>>>>> numFeatures = geomDims(0)
>>>>> lines = new(segsDims(0),graphic) ; array to hold polylines
>>>>> plres = True ; resources for polylines
>>>>> plres@gsLineColor = "black" ; Default is foreground color
>>>>> plres@gsLineThicknessF = 2.0 ; Default is 1
>>>>> ;---Add polylines to plot
>>>>> lon = f->x
>>>>> lat = f->y
>>>>> segNum = 0 ; Counter for adding polylines
>>>>> do i=0, numFeatures-1
>>>>> startSegment = geometry(i, geom_segIndex)
>>>>> numSegments = geometry(i, geom_numSegs)
>>>>> do seg=startSegment, startSegment+numSegments-1
>>>>> startPT = segments(seg, segs_xyzIndex)
>>>>> endPT = startPT + segments(seg, segs_numPnts) - 1
>>>>> lines(segNum) = gsn_add_polyline(wks, plot, lon(startPT:endPT), \
>>>>> lat(startPT:endPT), plres)
>>>>> segNum = segNum + 1
>>>>> end do
>>>>> end do
>>>>> ;---Drawing the plot will draw the newly attached polylines.
>>>>> resP = True ; panel options
>>>>> resP@gsnMaximize = True ; maximize image
>>>>> draw(plot)
>>>>> frame(wks) ; Advanced frame.
>>>>>
>>>>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>>>>>
>>>>> end do ; END OF TIME LOOP
>>>>>
>>>>> end
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2012/10/16 David Brown <dbrown@ucar.edu>
>>>>> Hi Enrico,
>>>>> There is a not-yet-documented setting for pmLabelBarDisplayMode called "ForceAlways" that will cause the LabelBar to appear even if the contour field is constant. Let us know if this does not work.
>>>>> -dave
>>>>>
>>>>>
>>>>> On Oct 15, 2012, at 1:57 PM, Enrico Benso wrote:
>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I have a question about label bars.
>>>>>>> I use NCL to view my Wrf model output.
>>>>>>> When i try to display precipitations, and there si no rain in my small
>>>>>>> domain, I get a warning (constant scalar field).
>>>>>>> The problem is that in this case the label bar disappears, even if I
>>>>>>> set levels with Explicit Mode.
>>>>>>> Is there a way to avoid this?
>>>>>>>
>>>>>>> Thank You!
>>>>>> _______________________________________________
>>>>>> ncl-talk mailing list
>>>>>> List instructions, subscriber options, unsubscribe:
>>>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/34ef87c6/attachment.html
>
> ------------------------------
>
> Message: 4
> Date: Mon, 22 Oct 2012 20:33:34 +0200
> From: Thomas Tobian <thomastobian@gmail.com>
> Subject: How to read this data correctly
> To: ncl-talk@ucar.edu
> Message-ID:
> <CAL2SQfA-UutTO3FxHbymZwWOwfTfgRrmVOarm0ju+bDK0GWUag@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Dear All,
>
> I am trying to plot the derived data that looks like as follow:
> When i tried to plot using NCL, I got wrong result and error.
> Anyone has suggestion how could i modify the format of this netcdf to the
> readable and correct one.
> Thanks.
>
> netcdf CPTdaily_minsmr1979 {
>
> dimensions:
> lat = 25 ;
> lon = 144 ;
> level = 1 ;
> time = UNLIMITED ; // (365 currently)
> variables:
> float h(time, level, lat, lon) ;
> h:units = "km" ;
> float T(time, level, lat, lon) ;
> T:units = "K" ;
> float p(time, level, lat, lon) ;
> p:units = "mbar" ;
> float SMR(time, level, lat, lon) ;
> SMR:units = "ppmv" ;
> *float vlon(lon) ;*
> * vlon:units = "degrees" ;*
> * vlon:no_button = 1 ;*
> * float vlat(lat) ;*
> * vlat:units = "degrees" ;*
> * vlat:no_button = 1 ;*
> * float time(time) ;*
> * time:units = "days" ;*
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/d56a6543/attachment.html
>
> ------------------------------
>
> Message: 5
> Date: Mon, 22 Oct 2012 15:10:57 -0500
> From: "Wen.J.Qu" <wen.j.qu@gmail.com>
> Subject: Does "break" in NCL work the same way as "exit" in
> fortran?
> To: "ncl-talk" <ncl-talk@ucar.edu>
> Message-ID: <201210221510570314187@gmail.com>
> Content-Type: text/plain; charset="gb2312"
>
> Hi, all
>
> I want to know whether "break" in NCL works the same way as "exit" in fortran. Please give me some information.
>
> Thanks a lot.
>
> Shawn
>
>
>
>
> Wen.J.Qu
> 2012-10-22
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/2287e6d8/attachment.html
>
> ------------------------------
>
> Message: 6
> Date: Mon, 22 Oct 2012 14:14:02 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: Does "break" in NCL work the same way as
> "exit" in fortran?
> To: Wen.J.Qu@gmail.com
> Cc: ncl-talk <ncl-talk@ucar.edu>
> Message-ID: <5085A90A.30505@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Please look at the NCL Reference Manul or the Mini-Language Manual
>
> http://www.ncl.ucar.edu/Document/Manuals/
>
> "Break causes the loop to abort, and continue causes the loop to proceed
> directly to the next iteration without executing the remaining
> statements in the block."
>
> On 10/22/2012 02:10 PM, Wen.J.Qu wrote:
>> Hi, all
>> I want to know whether "break" in NCL works the same way as "exit" in
>> fortran. Please give me some information.
>> Thanks a lot.
>> Shawn
>> ------------------------------------------------------------------------
>> Wen.J.Qu
>> 2012-10-22
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Mon, 22 Oct 2012 14:21:36 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: How to read this data correctly
> To: Thomas Tobian <thomastobian@gmail.com>
> Cc: ncl-talk@ucar.edu
> Message-ID: <5085AAD0.6080807@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> This is not a particularly 'good' netCDF file.
> The latitude & longitude units are non-standard.
> The units "degrees" is not recognized.
> 'degrees' what ... temperature, angle, ?????
>
>
>
> From an NCL perspective, it can be modified upon input
>
> f = addfile("CPTdaily_minsmr1979.nc", "r")
>
> lat = f->vlat
> lat!0 = "lat"
> lat@units = "degrees_north"
> lat&lat = lat
>
> lon = f->vlon
> lon!0 = "lon"
> lon@units = "degrees_east"
> lon&lon = lon
>
> h = f->h
> h&lat = lat
> h&lon = lon
> printVarSummary(h)
>
>
>
>
>
> On 10/22/2012 12:33 PM, Thomas Tobian wrote:
>> Dear All,
>>
>> I am trying to plot the derived data that looks like as follow:
>> When i tried to plot using NCL, I got wrong result and error.
>> Anyone has suggestion how could i modify the format of this netcdf to
>> the readable and correct one.
>> Thanks.
>>
>> netcdf CPTdaily_minsmr1979 {
>>
>> dimensions:
>> lat = 25 ;
>> lon = 144 ;
>> level = 1 ;
>> time = UNLIMITED ; // (365 currently)
>> variables:
>> float h(time, level, lat, lon) ;
>> h:units = "km" ;
>> float T(time, level, lat, lon) ;
>> T:units = "K" ;
>> float p(time, level, lat, lon) ;
>> p:units = "mbar" ;
>> float SMR(time, level, lat, lon) ;
>> SMR:units = "ppmv" ;
>> *float vlon(lon) ;*
>> *vlon:units = "degrees" ;*
>> *vlon:no_button = 1 ;*
>> *float vlat(lat) ;*
>> *vlat:units = "degrees" ;*
>> *vlat:no_button = 1 ;*
>> *float time(time) ;*
>> *time:units = "days" ;*
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>
> ------------------------------
>
> Message: 8
> Date: Mon, 22 Oct 2012 15:26:49 -0600
> From: David Brown <dbrown@ucar.edu>
> Subject: Re: label bar perimeter reduction
> To: Nikola Marjanovic <nikola_marjanovic@berkeley.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID: <91D3931E-0C6F-45BA-815B-C97414A202B4@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Nikola,
> Sorry for the delay in responding to your question. It depends somewhat on how you have specified the LabelBar as it appears now, but if you have not yet tried it, you should try
> setting pmLabelBarHeightF. There is a LabelBar example lb_13.ncl at http://www.ncl.ucar.edu/Applications/Scripts/lb_13.ncl that contains detailed information about the LabelBar geometry.
> If that doesn't help, please attach your script in a subsequent posting, and we will take a look.
> -dave
>
>
> On Oct 18, 2012, at 2:54 PM, Nikola Marjanovic wrote:
>
>> Hello NCL community,
>>
>> I am unsure how to reduce the label bar perimeter in NCL. I've looked at
>> the label bar (lb) and plot manager (pm) resources, but can't find the
>> proper ones to do this. I've attached a figure with an extremely large
>> label bar perimeter (black line draws the perimeter, lbPerimOn = True). I
>> would like the perimeter to only surround the label bar (just above
>> Horizontal Wind Speed (m/s) and just below the numbers for the bar). What
>> is the best way to do this?
>>
>> Thanks,
>> Nikola<perimeter.png>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 9
> Date: Mon, 22 Oct 2012 17:15:39 -0500
> From: "Wen.J.Qu" <wen.j.qu@gmail.com>
> Subject: How to accomplish a loop with negative stride?
> To: "ncl-talk" <ncl-talk@ucar.edu>
> Message-ID: <201210221715382819899@gmail.com>
> Content-Type: text/plain; charset="gb2312"
>
> Hi, all
>
> Would you please give some suggestions on how to accomplish a loop with negative stride? Just as below?
>
> Thanks a lot.
>
> Shawn
>
>
>
> **************************************************
> do i=lon90,lon180
> n588(year_index,day_index,i)=0.0
> do j=lat80,lat10,-1
> if((h(year_index,day_index,j,i)/10.0 .le. 588.0) .and. (h(year_index,day_index,j-1,i)/10.0 .le. 588.0))then
> n588(year_index,day_index,i)=j
> break
> end if
> end do
> end do
> **************************************************
>
>
>
>
> Wen.J.Qu
> 2012-10-22
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/f1d981f9/attachment.html
>
> ------------------------------
>
> Message: 10
> Date: Mon, 22 Oct 2012 16:36:25 -0600
> From: David Brown <dbrown@ucar.edu>
> Subject: Re: How to accomplish a loop with negative stride?
> To: Wen.J.Qu@gmail.com
> Cc: ncl-talk <ncl-talk@ucar.edu>
> Message-ID: <95DE26BC-495B-403A-887B-E103A58EBC7E@ucar.edu>
> Content-Type: text/plain; charset="us-ascii"
>
> See the reference manual at http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Loops
>
> Here's what it says about looping backwards:
>
> The following shows how to specify a loop with an explicit stride. The following form is also necessary to loop backwards. With this form, if start is greater than end, then the identifier is decremented by the stride value, which must always be positive. If the start is less than the end, then the identifier is incremented by the stride value.
>
>
> do loop_identifier = scalar_start_expr , scalar_end_expr , scalar_stride_expr
> statement list
> end do
>
>
> On Oct 22, 2012, at 4:15 PM, Wen.J.Qu wrote:
>
>> Hi, all
>>
>> Would you please give some suggestions on how to accomplish a loop with negative stride? Just as below?
>>
>> Thanks a lot.
>>
>> Shawn
>>
>>
>>
>> **************************************************
>> do i=lon90,lon180
>> n588(year_index,day_index,i)=0.0
>> do j=lat80,lat10,-1
>> if((h(year_index,day_index,j,i)/10.0 .le. 588.0) .and. (h(year_index,day_index,j-1,i)/10.0 .le. 588.0))then
>> n588(year_index,day_index,i)=j
>> break
>> end if
>> end do
>> end do
>> **************************************************
>>
>> Wen.J.Qu
>> 2012-10-22
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/db6e9ea4/attachment.html
>
> ------------------------------
>
> Message: 11
> Date: Mon, 22 Oct 2012 17:02:54 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: gsn_csm_hov for time-lat plot
> To: Xi Chang <xi.chang01@gmail.com>
> Cc: ncl-talk@ucar.edu
> Message-ID: <5085D09E.4000106@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> The question is a bit vague.
>
> x(time,lat,lon)
>
> To learn how NCL operates .... try
>
> x1 = x(time|:,lon|:,lat|:) ; lat is rightmost
> printVarSummary(x1)
> print("rank_x1="+dimsizes(dimsizes(x2)))
>
> x2 = x(lon|:,lat|:,time|:) ; time is rightmost
> printVarSummary(x2)
> print("rank_x2="+dimsizes(dimsizes(x1)))
>
> what do you notice about the following??
>
> x3 = x(lat|:,time|:,{lon|80})
> printVarSummary(x3)
> print("rank_x3="+dimsizes(dimsizes(x3)))
>
> x4 = x(lat|:,{lon|80},time|:)
> printVarSummary(x4)
> print("rank_x4="+dimsizes(dimsizes(x4)))
>
> x5 = x({lon|80},time|:,lat|:)
> printVarSummary(x5)
> print("rank_x5="+dimsizes(dimsizes(x5)))
>
> Try the following in your script
>
> plot = gsn_csm_contour(wks, x({lon|80},time|:,lat|:), res )
>
> If you are new to NCL, please read the Mini-Language Manual at:
>
> http://www.ncl.ucar.edu/Document/Manuals/
>
> See Dimension reordering
>
>
> On 10/22/2012 12:16 PM, Xi Chang wrote:
>> Dear NCL users,
>>
>> Is it possible to use "gsn_csm_hov" to creat time(y)-latitude(x) plot
>> instead of using "gsn_csm_time_lat"
>> If it's possible anybody has an experience to shift the "lat" as the
>> rightmost dimension.
>>
>> Thanks a lot,
>>
>> == Xi
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
>
> ------------------------------
>
> Message: 12
> Date: Mon, 22 Oct 2012 18:28:48 -0500
> From: "Wen.J.Qu" <wen.j.qu@gmail.com>
> Subject: Re: How to accomplish a loop with negative stride?
> To: "David Brown" <dbrown@ucar.edu>
> Cc: ncl-talk <ncl-talk@ucar.edu>
> Message-ID: <201210221828478439632@gmail.com>
> Content-Type: text/plain; charset="gb2312"
>
> Thanks, David.
>
> I think I understand now. It seems the the stride should always be positive. But when execute NCL can automatically determine to increase or to decrease the loop indentifier by the stride depending on whether the start index is smaller than the end index or the start index is greater than the end index.
>
> Thanks again and all my best!
>
>
> Shawn
>
>
>
>
> Wen.J.Qu
> 2012-10-22
>
>
>
> ???? David Brown
> ????? 2012-10-22 17:36:28
> ???? Wen.J.Qu@gmail.com
> ??? ncl-talk
> ??? Re: [ncl-talk] How to accomplish a loop with negative stride?
>
> See the reference manual at http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Loops
>
>
> Here's what it says about looping backwards:
>
>
> The following shows how to specify a loop with an explicit stride. The following form is also necessary to loop backwards. With this form, if start is greater than end, then the identifier is decremented by the stride value, which must always be positive. If the start is less than the end, then the identifier is incremented by the stride value.
>
>
> do loop_identifier = scalar_start_expr , scalar_end_expr , scalar_stride_expr
> statement list
> end do
>
>
>
>
> On Oct 22, 2012, at 4:15 PM, Wen.J.Qu wrote:
>
>
> Hi, all
>
> Would you please give some suggestions on how to accomplish a loop with negative stride? Just as below?
>
> Thanks a lot.
>
> Shawn
>
>
>
> **************************************************
> do i=lon90,lon180
> n588(year_index,day_index,i)=0.0
> do j=lat80,lat10,-1
> if((h(year_index,day_index,j,i)/10.0 .le. 588.0) .and. (h(year_index,day_index,j-1,i)/10.0 .le. 588.0))then
> n588(year_index,day_index,i)=j
> break
> end if
> end do
> end do
> **************************************************
>
>
>
>
> Wen.J.Qu
> 2012-10-22
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121022/1dd8e53a/attachment.html
>
> ------------------------------
>
> Message: 13
> Date: Tue, 23 Oct 2012 11:20:28 +0800
> From: Hyacinth Nnamchi <hyacinth.1@hotmail.com>
> Subject: Looping through dtrend function
> To: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <COL125-W4068C86D3438561A1AB362D8790@phx.gbl>
> Content-Type: text/plain; charset="gb2312"
>
>
> Hi;
> I am trying to detrend a monthly time series, month by month:
> nmos = 12ntim = dimsizes(x)
> do n = 0,ntim-1,nmosx_dtrnd = dtrend(x,False)
> end do
> print(x_dtrnd(0:11))
> But the result doesn't look correct, looks like deviations from annual mean. What could be wrong?
> Hyacinth
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121023/d8e44cb4/attachment.html
>
> ------------------------------
>
> Message: 14
> Date: Mon, 22 Oct 2012 23:09:21 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: Looping through dtrend function
> To: Hyacinth Nnamchi <hyacinth.1@hotmail.com>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <50862681.2090400@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> [1] dtrend (dtrend_n) returns anomalies. It removes the mean.
>
> [2] Is 'x' one dimensional
> x(0)=Jan, x(1)=Feb, ... x(11)=Dec, x(12)=Jan_next year , ...
>
> x_dtrnd = x ; create array including meta data
> do nmo=0,nmos-1
> work = x(nmo::12) ; every 12-th value
> wavg = avg(work) ; average
> work = dtrnd(work, False) ; anomalies
> work = wavg + work ; add average back in
> x_dtrend(nmo::nmos) = work
> end do
>
>
>
> On 10/22/12 9:20 PM, Hyacinth Nnamchi wrote:
>> Hi;
>>
>> I am trying to detrend a monthly time series, month by month:
>>
>> nmos = 12
>> ntim = dimsizes(x)
>>
>> do n = 0,ntim-1,nmos
>> x_dtrnd = dtrend(x,False)
>> end do
>>
>> print(x_dtrnd(0:11))
>>
>> But the result doesn't look correct, looks like deviations from annual
>> mean. What could be wrong?
>>
>> Hyacinth
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> ------------------------------
>
> Message: 15
> Date: Tue, 23 Oct 2012 13:55:18 +0800
> From: Hyacinth Nnamchi <hyacinth.1@hotmail.com>
> Subject: Re: Looping through dtrend function
> To: "shea@ucar.edu" <shea@ucar.edu>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <COL125-W438E99985F03DE17FB05FED8790@phx.gbl>
> Content-Type: text/plain; charset="gb2312"
>
>
> Thank you very much Dennis, your suggestion works.
>
> Hyacinth
>> Date: Mon, 22 Oct 2012 23:09:21 -0600
>> From: shea@ucar.edu
>> To: hyacinth.1@hotmail.com
>> CC: ncl-talk@ucar.edu
>> Subject: Re: Looping through dtrend function
>>
>> [1] dtrend (dtrend_n) returns anomalies. It removes the mean.
>>
>> [2] Is 'x' one dimensional
>> x(0)=Jan, x(1)=Feb, ... x(11)=Dec, x(12)=Jan_next year , ...
>>
>> x_dtrnd = x ; create array including meta data
>> do nmo=0,nmos-1
>> work = x(nmo::12) ; every 12-th value
>> wavg = avg(work) ; average
>> work = dtrnd(work, False) ; anomalies
>> work = wavg + work ; add average back in
>> x_dtrend(nmo::nmos) = work
>> end do
>>
>>
>>
>> On 10/22/12 9:20 PM, Hyacinth Nnamchi wrote:
>>> Hi;
>>>
>>> I am trying to detrend a monthly time series, month by month:
>>>
>>> nmos = 12
>>> ntim = dimsizes(x)
>>>
>>> do n = 0,ntim-1,nmos
>>> x_dtrnd = dtrend(x,False)
>>> end do
>>>
>>> print(x_dtrnd(0:11))
>>>
>>> But the result doesn't look correct, looks like deviations from annual
>>> mean. What could be wrong?
>>>
>>> Hyacinth
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121023/437a6898/attachment.html
>
> ------------------------------
>
> Message: 16
> Date: Tue, 23 Oct 2012 11:32:13 -0400
> From: Ping Yang <pyang@ccny.cuny.edu>
> Subject: Re: FW: I mean regridding the data to a
> rectiliniear lat / lon grid
> To: Dennis Shea <shea@ucar.edu>
> Cc: ncl-talk@ucar.edu
> Message-ID:
> <CAK8gSG8dSOmzo3=OiVuQHi8uTqP+6=8tiPUaaA=_r2+zm-XJ7Q@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Dennis,
>
> I tried to download the NCL 6.1.0 Beta installation file but currently it
> is not available. I will try another time. When will the NCL 6.1.0 Release
> version come out?
>
> Now I am struggling with a dataset "Daymet" which have been tiled into
> every 2*2 degree file at 1 km resolution. I need to do two things:
> regridding them to 4km resolution and transformating them to lat/lon. I am
> wondering which will be a better way to regrid:
> 1)I found each file for this data is different in the grid size, Can I use
> the same weight file(defined by the resolution?) for each small file
> regridding and then merge then as a one file?
> 2)Merge the file first and regriding them as a whole(the data size will be
> several GB)
>
> Looking forward to hearing from you.
>
> Regards,
>
> Ping
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121023/4db6a873/attachment.html
>
> ------------------------------
>
> Message: 17
> Date: Tue, 23 Oct 2012 09:43:04 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Plotting large domain
> To: BasitAli Khan <BasitAli.Khan@kaust.edu.sa>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <97454F4F-8672-4106-9DC1-093FB036259B@ucar.edu>
> Content-Type: text/plain; charset=windows-1252
>
> We worked with this offline a bit, and I ended up filing a ticket (NCL-1563) to fix a strange problem.
>
> The hang up seems to occur while plotting "pbl". If I set the "cnFillMode" resource to "RasterFill", then it draws a bit faster. There are other issues. however, that are worth looking into.
>
> I'll let you know if we make any progress on this issue. Thanks for providing the script and data.
>
> --Mary
>
> On Oct 21, 2012, at 2:21 AM, BasitAli Khan wrote:
>
>> Hi all,
>>
>> I want to plot a large domain (790x601 grid points). NCL gets stuck on the first time step at plotting function (wrf_map_overlays) as shown below:
>>
>> plot = wrf_map_overlays(fLL,wks,(/contour_pbl, contour_tc2C, vector/),pltres,mpres)
>>
>> NCL does not produce any error message though, but when i reduce the domain size, ncl plots it without any problem. It appears to be a memory issue. I am on Intel Xeon "Harpertown" x86_64 cluster running on Linux Red Hat 6.1 . I am just wondering if there is any work around to plot the entire plot?
>>
>> Thanks and best regards,
>>
>> ----
>> Basit A. Khan, Ph.D.
>> Postdoctoral Research Fellow
>> Division of Physical Sciences & Engineering
>> Office# 3204, Level 3, Building 1,
>> King Abdullah University of Science & Technology
>> 4700 King Abdullah Blvd, Box 2753, Thuwal 23955 ?6900,
>> Kingdom of Saudi Arabia.
>>
>> Office: +966(0)2 808 0276, Mobile: +966(0)5 0860 3617
>> E-mail: basitali.khan@kaust.edu.sa
>> Skype name: basit.a.khan
>>
>> This message and its contents including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 18
> Date: Tue, 23 Oct 2012 09:56:14 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: problem with WRF output
> To: marziyeh dadizadeh <marzi_d65@yahoo.com>
> Cc: NCL <ncl-talk@ucar.edu>
> Message-ID: <75C4B4CE-6056-49CD-A39C-8D973972E59D@ucar.edu>
> Content-Type: text/plain; charset=iso-8859-1
>
> Dear Marzie,
>
> It's hard to tell if the problem is with the data or the plot, since it's being overlaid on a map.
>
> First, you should look at the data itself. What does:
>
> print("min/max data = " + min(EXTCOF55(1,:,:)) + "/" + max(EXTCOF55(1,:,:)))
>
> report?
>
> What about just:
>
> print("min/max data = " + min(EXTCOF55) + "/" + max(EXTCOF55))
>
> Usually, when I'm trying to plot something that doesn't look correct, I like to look at just the contour plot so I can make sure it isn't the map overlay that is the problem.
>
> To look at the contour plot: after you call wrf_contour, add the two lines:
>
> draw(pm)
> frame(wks)
>
> Finally, maybe you want to look at "raster" contours rather than smooth contours. Try adding:
>
>
> opts@cnFillMode = "RasterFill"
>
> --Mary
>
>
> On Oct 21, 2012, at 8:23 AM, marziyeh dadizadeh wrote:
>
>> Dear NCL Users,
>> I have an output of WRF model and it 's needed to plot a parameter in name "EXTCOF55".
>> when I got the plot, it's clear that there is a problem but I don't know where it is!!!
>> my script is incorrect or my output is incorrect?
>> you can see my script in follow and a sample image output in attach.
>> can anyone help me please??!!! Dose anyone have any suggestion?!
>> thanks in advance
>> Marzie
>> --------------------------------------------------
>> This is summary of "EXTCOF55" :
>> ;float EXTCOF55(Time, bottom_top, south_north, west_east) ;
>> ; EXTCOF55:FieldType = 104 ;
>> ; EXTCOF55:MemoryOrder = "XYZ" ;
>> ; EXTCOF55:description = "Extinction coefficients for .55um" ;
>> ; EXTCOF55:units = "km^-1" ;
>> ; EXTCOF55:stagger = "" ;
>> ; EXTCOF55:coordinates = "XLONG XLAT" ;
>> -----------------------------------------------------------
>> and this is my complete script:
>> 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/wrf/WRF_contributed.ncl"
>> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
>> begin
>> a = addfile("wrfout_d01_2009-07-05_10_00_00.nc","r")
>> wks = gsn_open_wks("pdf","do3.11.00")
>> gsn_define_colormap(wks,"sunshine_9lev")
>> res = True
>> res@lgTitleOn = True
>> res@MainTitle = "REAL-TIME WRF"
>> res@gsnMaximize = True
>> res@gsnSpreadColors = True
>> res@cnFillOn = True
>> res@cnLinesOn = False
>> res@cnLineLabelsOn = False
>> pltres = True
>> mpres = True
>> mpres@gsnSpreadColors = True
>> mpres@mpGeophysicalLineColor = "Black"
>> mpres@mpNationalLineColor = "Black"
>> mpres@mpUSStateLineColor = "Black"
>> mpres@mpGridLineColor = "Black"
>> mpres@mpLimbLineColor = "Black"
>> mpres@mpPerimLineColor = "Black"
>> mpres@mpGeophysicalLineThicknessF = 2
>> times = wrf_user_list_times(a) ; get times in the file
>> ntimes = dimsizes(times)
>> do it = 0,ntimes-1,1 ; TIME LOOP
>> print("Working on time: " + times(it) )
>> res = True
>> res@TimeLabel = times(it) ; Set Valid time to use on plots
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> EXTCOF55= wrf_user_getvar(a,"EXTCOF55",it)
>> res@lbTitleOn = True
>> ; plotting for AOD
>> opts=res
>> pm= wrf_contour(a,wks,EXTCOF55(1,:,:),opts)
>> delete(opts)
>> plot = wrf_map_overlays(a,wks,(/pm/),pltres,mpres)
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> end do ; END OF TIME LOOP
>> end
>> <aod.pdf>_______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 19
> Date: Tue, 23 Oct 2012 09:59:53 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Process optimization
> To: Yann Bertrand <yann74@yahoo.fr>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <7AEC0B8F-BCCD-430D-976B-C4141BFFB44E@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Yann,
>
> Without seeing your script, it's hard to suggest how you might improve the speed.
>
> If you have a do loop that is calling "gsn_csm_contour_map" every time in the loop, then something you might consider is calling "gsn_csm_contour_map" only once, the first time in the loop, and then every subsequent time, use a "setvalues" block to just change the data.
>
>
> See example "animate_1.ncl" at:
>
> http://www.ncl.ucar.edu/Applications/animate.shtml
>
> --Mary
>
>
> On Oct 22, 2012, at 5:43 AM, Yann Bertrand wrote:
>
>> Hello,
>> I'm using NCL and sometimes i plot many large maps. It can take over one hour.
>> Is there a way to optimize multiple map ploting?
>> how many map creation parallel process should we run?
>> I have a 2 processors with 4 core by processor, and 32Gb ram.
>> Thanks in advance.
>> Yann
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 20
> Date: Tue, 23 Oct 2012 10:02:48 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: To add row and column headings to an ascii
> file
> To: Noel Aloysius <noel.aloysius@gmail.com>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <4FE0D24B-9622-4D1F-9F06-63636323FC84@ucar.edu>
> Content-Type: text/plain; charset=iso-8859-1
>
> See "Method 2" at:
>
> http://www.ncl.ucar.edu/Applications/o-ascii.shtml
>
> This uses sprintf and sprinti to create formatted strings. You can easily add an additional element to "lines" to add some headers.
>
> I believe "Method 1" should be easier, but this will only be in the 6.1.0 release.
>
> --Mary
>
> On Oct 19, 2012, at 4:10 AM, Noel Aloysius wrote:
>
>> Hi NCL,
>>
>> I want to add row and column heading to a 5x30 matrix and write an ascii output. The write_matrix function works well if I just want to write only the numbers.
>>
>> How can I write the file with the row and column headings?
>>
>> Here is how I write the ascii file now,
>>
>> opt = True
>> opt@fout = diro + "pr_extreme_values_count.txt"
>> system("rm -f " + opt@fout) ; delete existing file
>> write_matrix(transpose(Plarge_ens),"12f12.4",opt)
>>
>>
>> Thanks,
>> Noel
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 21
> Date: Tue, 23 Oct 2012 10:59:01 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Opacity in contour plot
> To: imran nadeem <qphoton@gmail.com>
> Cc: ncl-talk@ucar.edu
> Message-ID: <B3E5F042-23A9-41E5-8AFB-9A9BB1C54E92@ucar.edu>
> Content-Type: text/plain; charset=us-ascii
>
> Imran,
>
> I ran your script using NCL V6.1.0 (not 6.1.0-beta), and didn't get any ARSCAM/ARPRAM error messages. Rick fixed some other bugs that may have been related to this one, but they didn't get in until after the 6.1.0-beta release. They will be in the 6.1.0 release.
>
> The reason you are getting two labelbars is because you are setting this resource:
>
> res@pmLabelBarDisplayMode = "Always" ; Turn on a label bar.
>
> That resource overrides the lbLabelBarOn resource. The above resource is True by default, but if you explicitly set it, then NCL assumes you want to turn the lablebar on, regardless of what lbLabelBarOn is set to.
>
> To clean up your labelbar, I suggest:
>
> res@lbLabelBarOn = False ; Turn off labelbar
> res@lbPerimOn = False ; Turn off label bar perim.
> res@lbAutoManage = False
> res@pmLabelBarSide = "Bottom"
> res@lbOrientation = "Horizontal"
>
> Note I set lbPerimOn to False so that box won't be drawn around the labelbar.
>
> --Mary
>
> On Oct 19, 2012, at 3:17 AM, imran nadeem wrote:
>
>> Dear NCL-developers,
>>
>> I confirm the problem is coming from very "twisty" contours
>> drawn in a small area. I tried to enlarge my plots, but still getting
>> ARSCAM/ARPRAM error.
>> For me the best solution is that cnFillOpacityF works for RasterFill
>> or CellFilll because ARSCAM/ARPRAM error doesn't occur for these
>> contour fill types.
>> In separate email, I sent data + script to Mary for possible fix.
>>
>> Regards
>> Nadeem
>>
>>
>> On Wed, Oct 17, 2012 at 4:35 PM, Mary Haley <haley@ucar.edu> wrote:
>>> Hi Nadeem,
>>>
>>> We are trying to fix the contouring code so that users don't run into the ARSCAM/ARPRAM error.
>>> Do you still get an image, by any chance? Sometimes you just get a plot with no data in it.
>>>
>>> To help make this error go away, sometimes making the plot slightly larger will help. The error
>>> shows up sometimes when you have very "twisty" contours that are being drawn in a small area.
>>> If you make the plot slightly larger, this can help. We see this error more when people are
>>> panelling plots. Is that what you're doing here?
>>>
>>> If so, and if I can see a sample image, then I might be able to suggest ways to make the plots larger.
>>>
>>> Even better, if you can provide me with your data and your script, then I can try to reproduce the
>>> problem here and see if there's an easy fix. You can ftp your script and data . See:
>>>
>>> http://www.ncl.ucar.edu/report_bug.shtml#HowToFTP
>>>
>>> Hopefully Rick or Dave will address your question about cnFillOpacityF not working with
>>> RasterFill or CellFill.
>>>
>>> --Mary
>>>
>>>
>>>
>>> On Oct 17, 2012, at 7:32 AM, imran nadeem wrote:
>>>
>>>> Dear All,
>>>> I am using NCL verion 6.1.0-beta to make partially transparent
>>>> contour plots. For me, the resource "cnFillOpacityF" works only with
>>>> cnFillMode = "AreaFill". It doesn't have any effect on RasterFill or
>>>> CellFill.
>>>> This is problem for me because "AreaFill" is producing the following message.
>>>>
>>>> fatal:ContourPlotDraw: ARSCAM/ARPRAM - ALGORITHM FAILURE
>>>> fatal:ContourPlotDraw: draw error
>>>> warning:WorkstationDeactivate: workstation not active or not opened
>>>>
>>>> I can avoid this message by setting cnFillMode to RasterFill but then
>>>> I cannot use transparency through cnFillOpacityF.
>>>>
>>>> Any suggestion to solve this problem
>>>> Thanks in advance.
>>>>
>>>> Regards
>>>> Nadeem
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 22
> Date: Tue, 23 Oct 2012 11:02:05 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: I mean regridding the data to a rectiliniear
> lat / lon grid
> To: Ping Yang <pyang@ccny.cuny.edu>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <9E21F7A5-AE00-4682-8653-F6F734501D47@ucar.edu>
> Content-Type: text/plain; charset=iso-8859-1
>
> Ping,
>
> We had a scheduled power down of our systems last weekend, but when we powered things back up, one of the ESG disk drives failed. I believe you can't download *any* versions of NCL right now.
>
> Once this is fixed, we hope to release V6.1.0, which should be downloaded instead of 6.1.0-beta.
>
> --Mary
>
> On Oct 23, 2012, at 9:32 AM, Ping Yang wrote:
>
>> Hi Dennis,
>>
>> I tried to download the NCL 6.1.0 Beta installation file but currently it is not available. I will try another time. When will the NCL 6.1.0 Release version come out?
>>
>> Now I am struggling with a dataset "Daymet" which have been tiled into every 2*2 degree file at 1 km resolution. I need to do two things: regridding them to 4km resolution and transformating them to lat/lon. I am wondering which will be a better way to regrid:
>> 1)I found each file for this data is different in the grid size, Can I use the same weight file(defined by the resolution?) for each small file regridding and then merge then as a one file?
>> 2)Merge the file first and regriding them as a whole(the data size will be several GB)
>>
>> Looking forward to hearing from you.
>>
>> Regards,
>>
>> Ping
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 23
> Date: Tue, 23 Oct 2012 11:07:02 -0600
> From: Mary Haley <haley@ucar.edu>
> Subject: Re: Plotting large domain
> To: BasitAli Khan <BasitAli.Khan@kaust.edu.sa>
> Cc: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID: <B77DB033-19FE-4285-90A1-2E783E54520C@ucar.edu>
> Content-Type: text/plain; charset=windows-1252
>
> Another thing that will help speed up the drawing of this script is to set
>
> opts@cnLinesOn = False
>
> for the height plot. It seems that the drawing of the individual contour lines is taking an extra long time.
>
> --Mary
>
> On Oct 23, 2012, at 9:43 AM, Mary Haley wrote:
>
>> We worked with this offline a bit, and I ended up filing a ticket (NCL-1563) to fix a strange problem.
>>
>> The hang up seems to occur while plotting "pbl". If I set the "cnFillMode" resource to "RasterFill", then it draws a bit faster. There are other issues. however, that are worth looking into.
>>
>> I'll let you know if we make any progress on this issue. Thanks for providing the script and data.
>>
>> --Mary
>>
>> On Oct 21, 2012, at 2:21 AM, BasitAli Khan wrote:
>>
>>> Hi all,
>>>
>>> I want to plot a large domain (790x601 grid points). NCL gets stuck on the first time step at plotting function (wrf_map_overlays) as shown below:
>>>
>>> plot = wrf_map_overlays(fLL,wks,(/contour_pbl, contour_tc2C, vector/),pltres,mpres)
>>>
>>> NCL does not produce any error message though, but when i reduce the domain size, ncl plots it without any problem. It appears to be a memory issue. I am on Intel Xeon "Harpertown" x86_64 cluster running on Linux Red Hat 6.1 . I am just wondering if there is any work around to plot the entire plot?
>>>
>>> Thanks and best regards,
>>>
>>> ----
>>> Basit A. Khan, Ph.D.
>>> Postdoctoral Research Fellow
>>> Division of Physical Sciences & Engineering
>>> Office# 3204, Level 3, Building 1,
>>> King Abdullah University of Science & Technology
>>> 4700 King Abdullah Blvd, Box 2753, Thuwal 23955 ?6900,
>>> Kingdom of Saudi Arabia.
>>>
>>> Office: +966(0)2 808 0276, Mobile: +966(0)5 0860 3617
>>> E-mail: basitali.khan@kaust.edu.sa
>>> Skype name: basit.a.khan
>>>
>>> This message and its contents including attachments are intended solely for the original recipient. If you are not the intended recipient or have received this message in error, please notify me immediately and delete this message from your computer system. Any unauthorized use or distribution is prohibited. Please consider the environment before printing this email.
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> ------------------------------
>
> Message: 24
> Date: Tue, 23 Oct 2012 11:09:11 -0600
> From: Dennis Shea <shea@ucar.edu>
> Subject: Re: I mean regridding the data to a rectiliniear
> lat / lon grid
> To: Ping Yang <pyang@ccny.cuny.edu>
> Cc: NCL Talk <ncl-talk@ucar.edu>
> Message-ID: <5086CF37.7070800@ucar.edu>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> I have no experience with "Daymet" tiled data.
>
> My guess is that you will have to regrid *each* 2x2 tile with 1km data
> onto a 'mega grid' at 4km. Given the nature of the data. I would
> suggest that ESMF' conservative method be used.
>
> This will mean many regrid weight files.
>
> D
>
> On 10/23/12 11:02 AM, Mary Haley wrote:
>> Ping,
>>
>> We had a scheduled power down of our systems last weekend, but when we powered things back up, one of the ESG disk drives failed. I believe you can't download *any* versions of NCL right now.
>>
>> Once this is fixed, we hope to release V6.1.0, which should be downloaded instead of 6.1.0-beta.
>>
>> --Mary
>>
>> On Oct 23, 2012, at 9:32 AM, Ping Yang wrote:
>>
>>> Hi Dennis,
>>>
>>> I tried to download the NCL 6.1.0 Beta installation file but currently it is not available. I will try another time. When will the NCL 6.1.0 Release version come out?
>>>
>>> Now I am struggling with a dataset "Daymet" which have been tiled into every 2*2 degree file at 1 km resolution. I need to do two things: regridding them to 4km resolution and transformating them to lat/lon. I am wondering which will be a better way to regrid:
>>> 1)I found each file for this data is different in the grid size, Can I use the same weight file(defined by the resolution?) for each small file regridding and then merge then as a one file?
>>> 2)Merge the file first and regriding them as a whole(the data size will be several GB)
>>>
>>> Looking forward to hearing from you.
>>>
>>> Regards,
>>>
>>> Ping
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
>
> ------------------------------
>
> Message: 25
> Date: Tue, 23 Oct 2012 17:52:36 +0000
> From: "Patrick C. Campbell" <pcampbe2@uwyo.edu>
> Subject: Adding new variable to existing NetCDF file
> To: "ncl-talk@ucar.edu" <ncl-talk@ucar.edu>
> Message-ID:
> <7152B32081801E4795FE7671590355BC04119140@ponyexpress-m6.uwyo.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello,
>
> Rather simple question that I haven't found many examples of.
>
> If I have calculated a new variable, does anyone have any information on how to add this variable using NCL, to an existing NetCDF file (same dimensions)?
>
> Regards,
>
> Patrick
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20121023/a9f6380f/attachment.html
>
> ------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> End of ncl-talk Digest, Vol 107, Issue 33
> *****************************************
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 23 12:20:44 2012

This archive was generated by hypermail 2.1.8 : Wed Oct 31 2012 - 09:14:12 MDT