<div dir="ltr"><div>Goodday sir<br></div>I think i&#39;ve added 75 to &#39; ir_u@_FillValue= 255 &#39;.  pls check this script for any correction:<br><br>; A script to convert binary data to netcdf<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot; <br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot; <br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot; <br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot; <br><br>begin<br>file_name_read = &quot;merg_2012090102_4km-pixel&quot;<br><br>ir_u = byte2flt( fbindirread (file_name_read ,0, (/2,3298,9896/),&quot;ubyte&quot;)) + 75.<br><br><br>lon_g = fspan(0.0182,360,9896)<br>lat_g = fspan(59.982,59.982-0.036383683*3298,3298)<br> <br>lon_g@units      = &quot;degrees_east&quot;<br>lon_g@long_name  = &quot;longitude&quot;<br>lon_g@short_name = &quot;longitude&quot;<br>lon_g!0 = &quot;lon&quot;<br>lon_g&amp;lon = lon_g<br><br>lat_g@units      = &quot;degrees_north&quot;<br>lat_g@long_name  = &quot;latitude&quot;<br>lat_g@short_name = &quot;latitude&quot;<br>lat_g!0 = &quot;lat&quot;<br>lat_g&amp;lat = lat_g<br><br><br>ir_u!0      = &quot;time&quot;<br>ir_u!1      = &quot;lat&quot;<br>ir_u!2      = &quot;lon&quot;<br><br>ir_u&amp;lat    = lat_g<br>ir_u&amp;lon    = lon_g<br><br>ir_u@_FillValue= 255+75.<br><br><br>wks = gsn_open_wks(&quot;X11&quot;,&quot;&quot;)<br>res = True<br>res@cnFillOn = True<br>res@cnFillMode = &quot;RasterFill&quot;<br>res@cnLinesOn = False<br>plot = gsn_csm_contour_map(wks, ir_u(0,:,:), res)<br><br>ncout = addfile(file_name_read+&quot;.nc&quot;,&quot;c&quot;)<br>ncout-&gt;ir_data = ir_u<br><br>end<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 6, 2016 at 8:00 PM,  <span dir="ltr">&lt;<a href="mailto:ncl-talk-request@ucar.edu" target="_blank">ncl-talk-request@ucar.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send ncl-talk mailing list submissions to<br>
        <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:ncl-talk-request@ucar.edu">ncl-talk-request@ucar.edu</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:ncl-talk-owner@ucar.edu">ncl-talk-owner@ucar.edu</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of ncl-talk digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Re: Data conversion (Alan Brammer)<br>
   2. Re: gsn_csm_vector_scalar_map (Xi Chang)<br>
   3. Re: gsn_csm_vector_scalar_map (alesall)<br>
   4. Re: read and write netcdf-4 compressed files (David Brown)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 5 Feb 2016 14:10:24 -0500<br>
From: Alan Brammer &lt;<a href="mailto:abrammer@albany.edu">abrammer@albany.edu</a>&gt;<br>
Subject: Re: [ncl-talk] Data conversion<br>
To: Benjamin Alabi &lt;<a href="mailto:alabibenjamin2@gmail.com">alabibenjamin2@gmail.com</a>&gt;<br>
Cc: &quot;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&quot; &lt;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;<br>
Message-ID: &lt;<a href="mailto:564569E1-65BD-4130-B4EA-872812D72277@albany.edu">564569E1-65BD-4130-B4EA-872812D72277@albany.edu</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
&gt; And you don&#39;t want to try to add 75.0 to the fill value in the script.<br>
<br>
Just to respond to this and clarify, the missing value in the documentation that was linked to is 330. ( <a href="http://www.cpc.ncep.noaa.gov/products/global_precip/html/README" rel="noreferrer" target="_blank">http://www.cpc.ncep.noaa.gov/products/global_precip/html/README</a> &lt;<a href="http://www.cpc.ncep.noaa.gov/products/global_precip/html/README" rel="noreferrer" target="_blank">http://www.cpc.ncep.noaa.gov/products/global_precip/html/README</a>&gt; )<br>
<br>
When I put the example script together I first posted, I just saw what was obviously a missing value at 255, having forgotten the offset.   255 is a very reasonable value in the world of brightness temps, so apologies for that,  in my haste I made a mistake there in the first script.<br>
<br>
So the real _FillValue should be 330 (i.e. 255+75 )<br>
<br>
<br>
<br>
<br>
&gt; On 5 Feb 2016, at 09:15, HAVENER, KEVIN F GS-12 USAF ACC 14 WS/WXED &lt;<a href="mailto:kevin.havener@us.af.mil">kevin.havener@us.af.mil</a>&gt; wrote:<br>
&gt;<br>
&gt; And you don&#39;t want to try to add 75.0 to the fill value in the script.<br>
&gt;<br>
&gt; Kevin Havener<br>
&gt;<br>
&gt; -----Original Message-----<br>
&gt; From: <a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a> [mailto:<a href="mailto:ncl-talk-bounces@ucar.edu">ncl-talk-bounces@ucar.edu</a>] On Behalf Of alesall<br>
&gt; Sent: Friday, February 05, 2016 9:03 AM<br>
&gt; To: Benjamin Alabi<br>
&gt; Cc: <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; Subject: Re: [ncl-talk] Data conversion<br>
&gt;<br>
&gt;<br>
&gt; the error message is:<br>
&gt;<br>
&gt; fatal:Undefined identifier: (byte2flt) is undefined, can&#39;t continue<br>
&gt;<br>
&gt; it is not finding the function ?byte2flt&quot;<br>
&gt; on the documentation page, this one: &lt;<a href="http://ncl.ucar.edu/Document/Functions/Contributed/byte2flt.shtml" rel="noreferrer" target="_blank">http://ncl.ucar.edu/Document/Functions/Contributed/byte2flt.shtml</a>&gt;<br>
&gt; it says that such function is in the ?contributed? file.<br>
&gt;<br>
&gt; you need to add statements such as:<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl &lt;<a href="http://ncl.ucar.edu/Document/Functions/Contributed/contrib.shtml" rel="noreferrer" target="_blank">http://ncl.ucar.edu/Document/Functions/Contributed/contrib.shtml</a>&gt; &quot;<br>
&gt; at the beginning of your script, actually before the ?begin?<br>
&gt;<br>
&gt; I have all of these in my scripts:<br>
&gt;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>
&gt;<br>
&gt; hope this helps!<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Alessandra Giannini<br>
&gt; IRI for Climate and Society - The Earth Institute at Columbia University P.O. Box 1000, Palisades NY 10964-8000<br>
&gt; phone/fax: +1 845 680-4473/4864 - email: <a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a><br>
&gt;<br>
&gt;<br>
&gt;       On Feb 5, 2016, at 8:57 AM, Benjamin Alabi &lt;<a href="mailto:alabibenjamin2@gmail.com">alabibenjamin2@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;       Goodday sir,<br>
&gt;<br>
&gt;       I appreciate your effort in guiding me. I&#39;m new in this platform, please dont be offended by sending the message three times, I&#39;m just learning to get help from here.<br>
&gt;<br>
&gt;       I used the script,<br>
&gt;       begin<br>
&gt;       file_name_read = &quot;merg_2012090101_4km-pixel&quot;<br>
&gt;<br>
&gt;       ir_u = byte2flt( fbindirread (file_name_read ,0, (/2,3298,9896/),&quot;ubyte&quot;)) +75.0<br>
&gt;<br>
&gt;<br>
&gt;       lon_g = fspan(0.0182,360,9896)<br>
&gt;       lat_g = fspan(59.982,59.982-0.036383683*3298,3298)<br>
&gt;<br>
&gt;       lon_g@units      = &quot;degrees_east&quot;<br>
&gt;       lon_g@long_name  = &quot;longitude&quot;<br>
&gt;       lon_g@short_name = &quot;longitude&quot;<br>
&gt;       lon_g!0 = &quot;lon&quot;<br>
&gt;       lon_g&amp;lon = lon_g<br>
&gt;<br>
&gt;       lat_g@units      = &quot;degrees_north&quot;<br>
&gt;       lat_g@long_name  = &quot;latitude&quot;<br>
&gt;       lat_g@short_name = &quot;latitude&quot;<br>
&gt;       lat_g!0 = &quot;lat&quot;<br>
&gt;       lat_g&amp;lat = lat_g<br>
&gt;<br>
&gt;<br>
&gt;       ir_u!0      = &quot;time&quot;<br>
&gt;       ir_u!1      = &quot;lat&quot;<br>
&gt;       ir_u!2      = &quot;lon&quot;<br>
&gt;<br>
&gt;       ir_u&amp;lat    = lat_g<br>
&gt;       ir_u&amp;lon    = lon_g<br>
&gt;<br>
&gt;       ir_u@_FillValue= 255+75.0<br>
&gt;<br>
&gt;<br>
&gt;       wks = gsn_open_wks(&quot;X11&quot;,&quot;&quot;)<br>
&gt;       res = True<br>
&gt;       res@cnFillOn = True<br>
&gt;       res@cnFillMode = &quot;RasterFill&quot;<br>
&gt;       res@cnLinesOn = False<br>
&gt;       plot = gsn_csm_contour_map(wks, ir_u(0,:,:), res)<br>
&gt;<br>
&gt;       ncout = addfile(file_name_read+&quot;.nc&quot;,&quot;c&quot;)<br>
&gt;       ncout-&gt;ir_data = ir_u<br>
&gt;<br>
&gt;       end<br>
&gt;<br>
&gt;<br>
&gt;       But it was generating this error:<br>
&gt;       fatal:Undefined identifier: (byte2flt) is undefined, can&#39;t continue<br>
&gt;       fatal:[&quot;Execute.c&quot;:7741]:Execute: Error occurred at or near line 41<br>
&gt;<br>
&gt;<br>
&gt;       Waiting for guide, Thanks.<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;       On Thu, Feb 4, 2016 at 8:07 PM, Alan Brammer &lt;<a href="mailto:abrammer@albany.edu">abrammer@albany.edu</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;               Forgot the offset, which is mentioned in the link Kevin sent.<br>
&gt;<br>
&gt;<br>
&gt;               ir_u = byte2flt( fbindirread (file_name_read ,0, (/2,3298,9896/),&quot;ubyte&quot;)) +75.<br>
&gt;               ir_u@_FillValue= 255+75.<br>
&gt;<br>
&gt;               &quot;Each record is a 9896 x 3298 Fortran array of IR brightness temperatures that have been scaled to fit into 1-byte by subtracting &quot;75&quot; from each datum. Therefore it is necessary for the user to add a value of &quot;75&quot; to each data value when using the data.&quot;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;                       On 4 Feb 2016, at 13:30, Alan Brammer &lt;<a href="mailto:abrammer@albany.edu">abrammer@albany.edu</a>&gt; wrote:<br>
&gt;<br>
&gt;                       ok, wow. Don?t send the same message 3 times, if the first answers weren?t complete at least expand and attempt something not just copy paste the same lines again.<br>
&gt;<br>
&gt;                       as said before .Z means it?s compressed.  gunzip merg_2016020123_4km-pixel.Z  will uncompress it. Then you have a binary file as a small amount of googling would have told you.<br>
&gt;                       The same search would have linked you to various messages on here and various scripts where other people have included simple examples of this file type (myself included). Here is an example of reading and making a simple plot.  There are plenty of examples on how to write netcdf on the NCL website so you should develop code from there.  Most simple example at bottom of script below.<br>
&gt;                       <a href="https://www.ncl.ucar.edu/Applications/o-netcdf.shtml" rel="noreferrer" target="_blank">https://www.ncl.ucar.edu/Applications/o-netcdf.shtml</a><br>
&gt;<br>
&gt;                       Read the documentation on the below functions and understand what is occurring .<br>
&gt;<br>
&gt;<br>
&gt;                       begin<br>
&gt;                       file_name_read = &quot;merg_2016020123_4km-pixel&quot;<br>
&gt;<br>
&gt;                       ir_u = byte2flt( fbindirread (file_name_read ,0, (/2,3298,9896/),&quot;ubyte&quot;))<br>
&gt;<br>
&gt;<br>
&gt;                       lon_g = fspan(0.0182,360,9896)<br>
&gt;                       lat_g = fspan(59.982,59.982-0.036383683*3298,3298)<br>
&gt;<br>
&gt;                       lon_g@units      = &quot;degrees_east&quot;<br>
&gt;                       lon_g@long_name  = &quot;longitude&quot;<br>
&gt;                       lon_g@short_name = &quot;longitude&quot;<br>
&gt;                       lon_g!0 = &quot;lon&quot;<br>
&gt;                       lon_g&amp;lon = lon_g<br>
&gt;<br>
&gt;                       lat_g@units      = &quot;degrees_north&quot;<br>
&gt;                       lat_g@long_name  = &quot;latitude&quot;<br>
&gt;                       lat_g@short_name = &quot;latitude&quot;<br>
&gt;                       lat_g!0 = &quot;lat&quot;<br>
&gt;                       lat_g&amp;lat = lat_g<br>
&gt;<br>
&gt;<br>
&gt;                       ir_u!0      = &quot;time&quot;<br>
&gt;                       ir_u!1      = &quot;lat&quot;<br>
&gt;                       ir_u!2      = &quot;lon&quot;<br>
&gt;<br>
&gt;                       ir_u&amp;lat    = lat_g<br>
&gt;                       ir_u&amp;lon    = lon_g<br>
&gt;<br>
&gt;                       ir_u@_FillValue= 255<br>
&gt;<br>
&gt;<br>
&gt;                       wks = gsn_open_wks(&quot;X11&quot;,&quot;&quot;)<br>
&gt;                       res = True<br>
&gt;                       res@cnFillOn = True<br>
&gt;                       res@cnFillMode = &quot;RasterFill&quot;<br>
&gt;                       res@cnLinesOn = False<br>
&gt;                       plot = gsn_csm_contour_map(wks, ir_u(0,:,:), res)<br>
&gt;<br>
&gt;                       ncout = addfile(file_name_read+?.nc?,?c?)<br>
&gt;                       ncout-&gt;ir_data = ir_u<br>
&gt;<br>
&gt;                       end<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;                               On 4 Feb 2016, at 13:04, Benjamin Alabi &lt;<a href="mailto:alabibenjamin2@gmail.com">alabibenjamin2@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;                               Thanks for your assistance sir. I&#39;ve tried the cdo to get general information on the data, but it didn&#39;t work<br>
&gt;                               I need help from someone that can guide me to convert this data format - &#39;merg_2012091000_4km-pixel.Z&#39; to netcdf format.<br>
&gt;                               I download Gobally-merged (60N-60S) pixel-resolution IR brightness temperature data (equivalent blackbody temps), merged from all available geostationary satellites (GOES-8/10, METEOSAT-7/5)<br>
&gt;                               This is the link:<br>
&gt;                               <a href="http://mirador.gsfc.nasa.gov/cgi-bin/mirador/presentNavigation.pl?tree=project&amp;dataset=Global-merged%20IR%20Brightness%20Temperature%20Data&amp;project=TRMM&amp;dataGroup=Ancillary&amp;version=001&amp;CGISESSID=25c6337b80163b3743e8bea85d015558" rel="noreferrer" target="_blank">http://mirador.gsfc.nasa.gov/cgi-bin/mirador/presentNavigation.pl?tree=project&amp;dataset=Global-merged%20IR%20Brightness%20Temperature%20Data&amp;project=TRMM&amp;dataGroup=Ancillary&amp;version=001&amp;CGISESSID=25c6337b80163b3743e8bea85d015558</a>.<br>
&gt;<br>
&gt;                               I really want it to be in netcdf format.<br>
&gt;<br>
&gt;<br>
&gt;                               Regard<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;                               _______________________________________________<br>
&gt;                               ncl-talk mailing list<br>
&gt;                               <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;                               List instructions, subscriber options, unsubscribe:<br>
&gt;                               <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;       _______________________________________________<br>
&gt;       ncl-talk mailing list<br>
&gt;       <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt;       List instructions, subscriber options, unsubscribe:<br>
&gt;       <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160205/2fdc6d64/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160205/2fdc6d64/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Fri, 5 Feb 2016 21:19:10 +0100<br>
From: Xi Chang &lt;<a href="mailto:xi.chang01@gmail.com">xi.chang01@gmail.com</a>&gt;<br>
Subject: Re: [ncl-talk] gsn_csm_vector_scalar_map<br>
To: Karin Meier-Fleischer &lt;<a href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</a>&gt;<br>
Cc: &quot;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&quot; &lt;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;<br>
Message-ID:<br>
        &lt;CAGfRhteOJRK4=Rvrnoua8a+JDA2HQwfe8Q2jMhN=<a href="mailto:cmtmrj7gVg@mail.gmail.com">cmtmrj7gVg@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Hi Karin,,<br>
<br>
I did, but it doesnt work for gsn_csm_vector_scalar_map, no idea why..<br>
<br>
Chang.<br>
<br>
On Fri, Feb 5, 2016 at 7:53 PM, Karin Meier-Fleischer &lt;<br>
<a href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</a>&gt; wrote:<br>
<br>
&gt; Hi Xi,<br>
&gt;<br>
&gt; have you taken a look at the first example of the vector examples page<br>
&gt;     <a href="http://ncl.ucar.edu/Applications/Scripts/vector_1.ncl" rel="noreferrer" target="_blank">http://ncl.ucar.edu/Applications/Scripts/vector_1.ncl</a><br>
&gt;<br>
&gt; When you want to control the minimum/maximum and interval of the contour<br>
&gt; lines use<br>
&gt;<br>
&gt;   res@cnLevelSelectionMode = &quot;ManualLevels&quot;     ; set manual contour levels<br>
&gt;   res@cnMinLevelValF       = 24.0               ; set min contour level<br>
&gt;   res@cnMaxLevelValF       = 29                 ; set max contour level<br>
&gt;   res@cnLevelSpacingF      = 0.10               ; set contour spacing<br>
&gt;<br>
&gt; Bye,<br>
&gt; Karin<br>
&gt;<br>
&gt; Am 05.02.16 um 19:00 schrieb Xi Chang:<br>
&gt;<br>
&gt; Hello...<br>
&gt;<br>
&gt; Could you please tell me how to control the contour interval for color<br>
&gt; shading once im using this function  *gsn_csm_vector_scalar_map*.<br>
&gt;<br>
&gt; ;===========PLOT=================<br>
&gt;<br>
&gt;   wks = gsn_open_wks(&quot;png&quot;,&quot;overlay&quot;)<br>
&gt;<br>
&gt;   res                       = True              ; plot mods desired<br>
&gt;   plot = new(16,graphic)<br>
&gt;<br>
&gt;   res@gsnDraw             = False           ; don&#39;t draw<br>
&gt;   res@gsnFrame            = False           ; don&#39;t advance frame<br>
&gt;<br>
&gt; ; vector rescoures<br>
&gt;   res@vcRefLengthF             = 0.045<br>
&gt;   res@vcRefMagnitudeF          = 20.0<br>
&gt;   res@vcRefAnnoOrthogonalPosF  = -0.12<br>
&gt;   res@vcRefAnnoParallelPosF    =  0.997<br>
&gt;   res@vcRefAnnoFontHeightF     = 0.015<br>
&gt;   res@vcMinDistanceF          = 0.03<br>
&gt;   res@lbLabelBarOn        = False<br>
&gt;<br>
&gt;   res@mpProjection   = &quot;AzimuthalEquidistant&quot;  ; choose map projection<br>
&gt;   res@mpLimitMode    = &quot;LatLon&quot;          ; use lat/lon coordinates to<br>
&gt; limit area<br>
&gt;   res@mpMinLatF      = 25.<br>
&gt;   res@mpMaxLatF      = 75.<br>
&gt;   res@mpMinLonF      = -80.<br>
&gt;   res@mpMaxLonF      = 20.<br>
&gt;   res@gsnMaximize           = True<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; *  res@gsnScalarContour        = True   res@cnFillOn                = True<br>
&gt;   res@cnFillPalette           = &quot;gui_default&quot;     ; set color map<br>
&gt; res@cnLinesOn               = False             ; turn off contour lines *<br>
&gt;<br>
&gt;<br>
&gt;   do i=0,15<br>
&gt;   plot(i)  = gsn_csm_vector_scalar_map(wks,u(i,:,:),v(i,:,:), \<br>
&gt;                                    p(i,:,:),res)<br>
&gt;   end do<br>
&gt;<br>
&gt;   resP                     = True                ; modify the panel plot<br>
&gt;   resP@gsnMaximize           = True<br>
&gt;   gsn_panel(wks,plot,(/4,4/),resP)               ; now draw as one plot<br>
&gt;<br>
&gt;<br>
&gt; end<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing <a href="mailto:listncl-talk@ucar.edu">listncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
&gt;<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160205/4e881daa/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160205/4e881daa/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Fri, 5 Feb 2016 15:21:44 -0500<br>
From: alesall &lt;<a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a>&gt;<br>
Subject: Re: [ncl-talk] gsn_csm_vector_scalar_map<br>
To: Xi Chang &lt;<a href="mailto:xi.chang01@gmail.com">xi.chang01@gmail.com</a>&gt;<br>
Cc: &quot;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&quot; &lt;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;<br>
Message-ID: &lt;<a href="mailto:257ABA37-BFD7-49C5-B6CB-193B6F81F39F@iri.columbia.edu">257ABA37-BFD7-49C5-B6CB-193B6F81F39F@iri.columbia.edu</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
Hi, is it complaining that the spacing is too fine compared to the wide range between min and max values, and reverting to doing what it thinks best?<br>
<br>
<br>
<br>
--<br>
Alessandra Giannini<br>
IRI for Climate and Society - The Earth Institute at Columbia University<br>
P.O. Box 1000, Palisades NY 10964-8000<br>
phone/fax: +1 845 680-4473/4864 - email: <a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a> &lt;mailto:<a href="mailto:alesall@iri.columbia.edu">alesall@iri.columbia.edu</a>&gt;<br>
&gt; On Feb 5, 2016, at 3:19 PM, Xi Chang &lt;<a href="mailto:xi.chang01@gmail.com">xi.chang01@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Karin,,<br>
&gt;<br>
&gt; I did, but it doesnt work for gsn_csm_vector_scalar_map, no idea why..<br>
&gt;<br>
&gt; Chang.<br>
&gt;<br>
&gt; On Fri, Feb 5, 2016 at 7:53 PM, Karin Meier-Fleischer &lt;<a href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</a> &lt;mailto:<a href="mailto:meier-fleischer@dkrz.de">meier-fleischer@dkrz.de</a>&gt;&gt; wrote:<br>
&gt; Hi Xi,<br>
&gt;<br>
&gt; have you taken a look at the first example of the vector examples page<br>
&gt;     <a href="http://ncl.ucar.edu/Applications/Scripts/vector_1.ncl" rel="noreferrer" target="_blank">http://ncl.ucar.edu/Applications/Scripts/vector_1.ncl</a> &lt;<a href="http://ncl.ucar.edu/Applications/Scripts/vector_1.ncl" rel="noreferrer" target="_blank">http://ncl.ucar.edu/Applications/Scripts/vector_1.ncl</a>&gt;<br>
&gt;<br>
&gt; When you want to control the minimum/maximum and interval of the contour lines use<br>
&gt;   res@cnLevelSelectionMode = &quot;ManualLevels&quot;     ; set manual contour levels<br>
&gt;   res@cnMinLevelValF       = 24.0               ; set min contour level<br>
&gt;   res@cnMaxLevelValF       = 29                 ; set max contour level<br>
&gt;   res@cnLevelSpacingF      = 0.10               ; set contour spacing<br>
&gt; Bye,<br>
&gt; Karin<br>
&gt;<br>
&gt; Am 05.02.16 um 19:00 schrieb Xi Chang:<br>
&gt;&gt; Hello...<br>
&gt;&gt;<br>
&gt;&gt; Could you please tell me how to control the contour interval for color shading once im using this function  gsn_csm_vector_scalar_map.<br>
&gt;&gt;<br>
&gt;&gt; ;===========PLOT=================<br>
&gt;&gt;<br>
&gt;&gt;   wks = gsn_open_wks(&quot;png&quot;,&quot;overlay&quot;)<br>
&gt;&gt;<br>
&gt;&gt;   res                       = True              ; plot mods desired<br>
&gt;&gt;   plot = new(16,graphic)<br>
&gt;&gt;<br>
&gt;&gt;   res@gsnDraw             = False           ; don&#39;t draw<br>
&gt;&gt;   res@gsnFrame            = False           ; don&#39;t advance frame<br>
&gt;&gt;<br>
&gt;&gt; ; vector rescoures<br>
&gt;&gt;   res@vcRefLengthF             = 0.045<br>
&gt;&gt;   res@vcRefMagnitudeF          = 20.0<br>
&gt;&gt;   res@vcRefAnnoOrthogonalPosF  = -0.12<br>
&gt;&gt;   res@vcRefAnnoParallelPosF    =  0.997<br>
&gt;&gt;   res@vcRefAnnoFontHeightF     = 0.015<br>
&gt;&gt;   res@vcMinDistanceF          = 0.03<br>
&gt;&gt;   res@lbLabelBarOn        = False<br>
&gt;&gt;<br>
&gt;&gt;   res@mpProjection   = &quot;AzimuthalEquidistant&quot;  ; choose map projection<br>
&gt;&gt;   res@mpLimitMode    = &quot;LatLon&quot;          ; use lat/lon coordinates to limit area<br>
&gt;&gt;   res@mpMinLatF      = 25.<br>
&gt;&gt;   res@mpMaxLatF      = 75.<br>
&gt;&gt;   res@mpMinLonF      = -80.<br>
&gt;&gt;   res@mpMaxLonF      = 20.<br>
&gt;&gt;   res@gsnMaximize           = True<br>
&gt;&gt;<br>
&gt;&gt;   res@gsnScalarContour        = True<br>
&gt;&gt;   res@cnFillOn                = True<br>
&gt;&gt;   res@cnFillPalette           = &quot;gui_default&quot;     ; set color map<br>
&gt;&gt;   res@cnLinesOn               = False             ; turn off contour lines<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;   do i=0,15<br>
&gt;&gt;   plot(i)  = gsn_csm_vector_scalar_map(wks,u(i,:,:),v(i,:,:), \<br>
&gt;&gt;                                    p(i,:,:),res)<br>
&gt;&gt;   end do<br>
&gt;&gt;<br>
&gt;&gt;   resP                     = True                ; modify the panel plot<br>
&gt;&gt;   resP@gsnMaximize           = True<br>
&gt;&gt;   gsn_panel(wks,plot,(/4,4/),resP)               ; now draw as one plot<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; end<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; ncl-talk mailing list<br>
&gt;&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a> &lt;mailto:<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;<br>
&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a> &lt;<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a> &lt;mailto:<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;<br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a> &lt;<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160205/8c35e975/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160205/8c35e975/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Fri, 5 Feb 2016 14:37:26 -0700<br>
From: David Brown &lt;<a href="mailto:dbrown@ucar.edu">dbrown@ucar.edu</a>&gt;<br>
Subject: Re: [ncl-talk] read and write netcdf-4 compressed files<br>
To: Dan Chen &lt;<a href="mailto:dchen@ucar.edu">dchen@ucar.edu</a>&gt;, ncl-talk &lt;<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>&gt;<br>
Message-ID:<br>
        &lt;<a href="mailto:CAC92F7fDd6iTx4N401jbbN-G6ieUzzgFEuW5TG9QhMHLaRvx3A@mail.gmail.com">CAC92F7fDd6iTx4N401jbbN-G6ieUzzgFEuW5TG9QhMHLaRvx3A@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Hi Dan,<br>
The problem is a dimension mismatch. I am not sure why it does not get<br>
reported as such, but here is the issue:<br>
Your call to wrf_user_getvar asks for time step 0, granted the only<br>
time step since the Time dimension has only 1 element. But the result<br>
is that the return variable &#39;bb&#39; is reduced from 4 dimensions (t,<br>
z,y,x) in the file variable to 3 (z,y,x) in the local variable.<br>
<br>
Then you are trying to assign this 3d variable to a 4d variable in the<br>
file. This causes the error.<br>
There are two ways to fix it.<br>
1) Substitute -1 for 0 in the 3rd argument to wrf_user_getvar. You<br>
will then get Time as the leftmost dimension of a 4d variable, and the<br>
write can proceed without error.<br>
2) Or leave the wrf_user_getvar call alone. You can write the 3d local<br>
variable into the 4d file variable by subscripting the left hand side<br>
of the assignment:<br>
<br>
in-&gt;PM2_5_DRY(0,:,:,:) = (/bb/)<br>
<br>
We will look into why this is not caught earlier with a more apropos<br>
&quot;dimension mismatch&quot; error to avoid the trip into the NetCDF library<br>
code and the resulting low-level error messages.<br>
 -dave<br>
<br>
<br>
On Thu, Feb 4, 2016 at 8:16 PM, Dan Chen &lt;<a href="mailto:dchen@ucar.edu">dchen@ucar.edu</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; My name is Dan Chen working at MMM, NCAR.  I&#39;m using ncl to read a variable<br>
&gt; and write into the netcdf-4 compressed file on Yellowstone, but failed.<br>
&gt;<br>
&gt; The script is as blow:<br>
&gt; ========================================<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT//lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>
&gt; load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl&quot;<br>
&gt;<br>
&gt;     begin<br>
&gt;<br>
&gt;      fils = &quot;/glade/scratch/dchen/ncl_netcdf4/analysis.ensmean&quot;<br>
&gt;       in = addfile(fils,&quot;w&quot;)<br>
&gt;       bb = wrf_user_getvar(in,&quot;PM2_5_DRY&quot;,0)<br>
&gt;       bb = bb*10<br>
&gt;     fils-&gt;PM2_5_DRY = (/bb/)<br>
&gt;<br>
&gt;     end<br>
&gt; ==========================================<br>
&gt;<br>
&gt;<br>
&gt; The error is as below<br>
&gt; =========================<br>
&gt;   Copyright (C) 1995-2015 - All Rights Reserved<br>
&gt;  University Corporation for Atmospheric Research<br>
&gt;  NCAR Command Language Version 6.3.0<br>
&gt;  The use of this software is governed by a License Agreement.<br>
&gt;  See <a href="http://www.ncl.ucar.edu/" rel="noreferrer" target="_blank">http://www.ncl.ucar.edu/</a> for more details.<br>
&gt; fatal:[&quot;NclNetCDF4.c&quot;:3073]:NclNetCDF4.c: Error in nc_def_var_chunking in<br>
&gt; file (/glade/scratch/dchen/ncl_netcdf4/analysis.ensmean) for writing, at<br>
&gt; line: 3073<br>
&gt;<br>
&gt; line 3074 of NclNetCDF4.c: NetCDF: Attempt to define var properties, like<br>
&gt; deflate, after enddef.<br>
&gt; ============================<br>
&gt;<br>
&gt;<br>
&gt; If I change the input file to a normal netcdf file without the compression<br>
&gt; option, it works fine. But I do need to process those netcdf-4 compressed<br>
&gt; files.  Can you let me know if there is anything I can try?<br>
&gt;<br>
&gt; Many thanks,<br>
&gt; Dan<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; ncl-talk mailing list<br>
&gt; <a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
&gt; List instructions, subscriber options, unsubscribe:<br>
&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br>
<br>
End of ncl-talk Digest, Vol 147, Issue 8<br>
****************************************<br>
</blockquote></div><br></div>