From barry.h.lynn at gmail.com Wed Jul 5 20:07:05 2023 From: barry.h.lynn at gmail.com (Barry Lynn) Date: Thu, 6 Jul 2023 05:07:05 +0300 Subject: [ncl-talk] To many lines on the bar graph Message-ID: Hello: Is there a way to cancel the vertical lines that delineate colors on the bar graph? I am trying to use all the colors in the color scheme, but when I do that, I end up with a black color bar because the colors are so close together. Thanks, -- Barry H. Lynn, Ph.D Senior Scientist, Lecturer, The Institute of Earth Sciences, The Hebrew University of Jerusalem, Givat Ram, Jerusalem 91904, Israel Tel: 972 547 231 170 Fax: (972)-25662581 Weather It Is, LTD Weather and Climate Focus https://weather-it-is.com Jerusalem, Israel Local: 02 930 9525 Cell: 054 7 231 170 Int-IS: x972 2 930 9525 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot 2023-07-06 at 5.05.31 AM.png Type: image/png Size: 267229 bytes Desc: not available URL: From dave.allured at noaa.gov Wed Jul 5 20:43:02 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Wed, 5 Jul 2023 20:43:02 -0600 Subject: [ncl-talk] To many lines on the bar graph In-Reply-To: References: Message-ID: Example bar_4 on the NCL Bar Charts examples page shows how to do this. On Wed, Jul 5, 2023 at 8:07?PM Barry Lynn via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hello: > > Is there a way to cancel the vertical lines that delineate colors on the > bar graph? > > I am trying to use all the colors in the color scheme, but when I do that, > I end up with a black color bar because the colors are so close together. > > Thanks, > > -- > > Barry H. Lynn, Ph.D > Senior Scientist, Lecturer, > The Institute of Earth Sciences, > The Hebrew University of Jerusalem, > Givat Ram, Jerusalem 91904, Israel > Tel: 972 547 231 170 > Fax: (972)-25662581 > > Weather It Is, LTD > Weather and Climate Focus > https://weather-it-is.com > Jerusalem, Israel > Local: 02 930 9525 > Cell: 054 7 231 170 > Int-IS: x972 2 930 9525 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From barry.h.lynn at gmail.com Wed Jul 5 21:30:31 2023 From: barry.h.lynn at gmail.com (Barry Lynn) Date: Thu, 6 Jul 2023 06:30:31 +0300 Subject: [ncl-talk] To many lines on the bar graph In-Reply-To: References: Message-ID: Thank you. res at xyLineColors = (/"red","blue"/) ; colors for the above/blow On Thu, Jul 6, 2023 at 5:43?AM Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > Example bar_4 on the NCL Bar Charts examples page shows how to do this. > > > On Wed, Jul 5, 2023 at 8:07?PM Barry Lynn via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hello: >> >> Is there a way to cancel the vertical lines that delineate colors on the >> bar graph? >> >> I am trying to use all the colors in the color scheme, but when I do >> that, I end up with a black color bar because the colors are so close >> together. >> >> Thanks, >> >> -- >> >> Barry H. Lynn, Ph.D >> Senior Scientist, Lecturer, >> The Institute of Earth Sciences, >> The Hebrew University of Jerusalem, >> Givat Ram, Jerusalem 91904, Israel >> Tel: 972 547 231 170 >> Fax: (972)-25662581 >> >> Weather It Is, LTD >> Weather and Climate Focus >> https://weather-it-is.com >> Jerusalem, Israel >> Local: 02 930 9525 >> Cell: 054 7 231 170 >> Int-IS: x972 2 930 9525 >> > -- Barry H. Lynn, Ph.D Senior Scientist, Lecturer, The Institute of Earth Sciences, The Hebrew University of Jerusalem, Givat Ram, Jerusalem 91904, Israel Tel: 972 547 231 170 Fax: (972)-25662581 Weather It Is, LTD Weather and Climate Focus https://weather-it-is.com Jerusalem, Israel Local: 02 930 9525 Cell: 054 7 231 170 Int-IS: x972 2 930 9525 -------------- next part -------------- An HTML attachment was scrubbed... URL: From barry.h.lynn at gmail.com Thu Jul 6 00:23:04 2023 From: barry.h.lynn at gmail.com (Barry Lynn) Date: Thu, 6 Jul 2023 09:23:04 +0300 Subject: [ncl-talk] To many lines on the bar graph In-Reply-To: References: Message-ID: Dave: That resource is not found in my mapping program (countour map). I need to turn off the lines within the label bar. I think I want this: *lbBoxSeparatorLinesOn* = True. On Thu, Jul 6, 2023 at 6:30?AM Barry Lynn wrote: > Thank you. > > res at xyLineColors = (/"red","blue"/) ; colors for the above/blow > > > > On Thu, Jul 6, 2023 at 5:43?AM Dave Allured - NOAA Affiliate < > dave.allured at noaa.gov> wrote: > >> Example bar_4 on the NCL Bar Charts examples page shows how to do this. >> >> >> On Wed, Jul 5, 2023 at 8:07?PM Barry Lynn via ncl-talk < >> ncl-talk at mailman.ucar.edu> wrote: >> >>> Hello: >>> >>> Is there a way to cancel the vertical lines that delineate colors on the >>> bar graph? >>> >>> I am trying to use all the colors in the color scheme, but when I do >>> that, I end up with a black color bar because the colors are so close >>> together. >>> >>> Thanks, >>> >>> -- >>> >>> Barry H. Lynn, Ph.D >>> Senior Scientist, Lecturer, >>> The Institute of Earth Sciences, >>> The Hebrew University of Jerusalem, >>> Givat Ram, Jerusalem 91904, Israel >>> Tel: 972 547 231 170 >>> Fax: (972)-25662581 >>> >>> Weather It Is, LTD >>> Weather and Climate Focus >>> https://weather-it-is.com >>> Jerusalem, Israel >>> Local: 02 930 9525 >>> Cell: 054 7 231 170 >>> Int-IS: x972 2 930 9525 >>> >> > > -- > > Barry H. Lynn, Ph.D > Senior Scientist, Lecturer, > The Institute of Earth Sciences, > The Hebrew University of Jerusalem, > Givat Ram, Jerusalem 91904, Israel > Tel: 972 547 231 170 > Fax: (972)-25662581 > > Weather It Is, LTD > Weather and Climate Focus > https://weather-it-is.com > Jerusalem, Israel > Local: 02 930 9525 > Cell: 054 7 231 170 > Int-IS: x972 2 930 9525 > > -- Barry H. Lynn, Ph.D Senior Scientist, Lecturer, The Institute of Earth Sciences, The Hebrew University of Jerusalem, Givat Ram, Jerusalem 91904, Israel Tel: 972 547 231 170 Fax: (972)-25662581 Weather It Is, LTD Weather and Climate Focus https://weather-it-is.com Jerusalem, Israel Local: 02 930 9525 Cell: 054 7 231 170 Int-IS: x972 2 930 9525 -------------- next part -------------- An HTML attachment was scrubbed... URL: From barry.h.lynn at gmail.com Thu Jul 13 07:27:20 2023 From: barry.h.lynn at gmail.com (Barry Lynn) Date: Thu, 13 Jul 2023 16:27:20 +0300 Subject: [ncl-talk] To many lines on the bar graph In-Reply-To: References: Message-ID: To turn off the lines, set *lbBoxSeparatorLinesOn* = False On Thu, Jul 6, 2023 at 9:23?AM Barry Lynn wrote: > Dave: > > That resource is not found in my mapping program (countour map). I need > to turn off the lines within the label bar. > > I think I want this: *lbBoxSeparatorLinesOn* > = > True. > > On Thu, Jul 6, 2023 at 6:30?AM Barry Lynn wrote: > >> Thank you. >> >> res at xyLineColors = (/"red","blue"/) ; colors for the above/blow >> >> >> >> On Thu, Jul 6, 2023 at 5:43?AM Dave Allured - NOAA Affiliate < >> dave.allured at noaa.gov> wrote: >> >>> Example bar_4 on the NCL Bar Charts examples page shows how to do this. >>> >>> >>> On Wed, Jul 5, 2023 at 8:07?PM Barry Lynn via ncl-talk < >>> ncl-talk at mailman.ucar.edu> wrote: >>> >>>> Hello: >>>> >>>> Is there a way to cancel the vertical lines that delineate colors on >>>> the bar graph? >>>> >>>> I am trying to use all the colors in the color scheme, but when I do >>>> that, I end up with a black color bar because the colors are so close >>>> together. >>>> >>>> Thanks, >>>> >>>> -- >>>> >>>> Barry H. Lynn, Ph.D >>>> Senior Scientist, Lecturer, >>>> The Institute of Earth Sciences, >>>> The Hebrew University of Jerusalem, >>>> Givat Ram, Jerusalem 91904, Israel >>>> Tel: 972 547 231 170 >>>> Fax: (972)-25662581 >>>> >>>> Weather It Is, LTD >>>> Weather and Climate Focus >>>> https://weather-it-is.com >>>> Jerusalem, Israel >>>> Local: 02 930 9525 >>>> Cell: 054 7 231 170 >>>> Int-IS: x972 2 930 9525 >>>> >>> >> >> -- >> >> Barry H. Lynn, Ph.D >> Senior Scientist, Lecturer, >> The Institute of Earth Sciences, >> The Hebrew University of Jerusalem, >> Givat Ram, Jerusalem 91904, Israel >> Tel: 972 547 231 170 >> Fax: (972)-25662581 >> >> Weather It Is, LTD >> Weather and Climate Focus >> https://weather-it-is.com >> Jerusalem, Israel >> Local: 02 930 9525 >> Cell: 054 7 231 170 >> Int-IS: x972 2 930 9525 >> >> > > -- > > Barry H. Lynn, Ph.D > Senior Scientist, Lecturer, > The Institute of Earth Sciences, > The Hebrew University of Jerusalem, > Givat Ram, Jerusalem 91904, Israel > Tel: 972 547 231 170 > Fax: (972)-25662581 > > Weather It Is, LTD > Weather and Climate Focus > https://weather-it-is.com > Jerusalem, Israel > Local: 02 930 9525 > Cell: 054 7 231 170 > Int-IS: x972 2 930 9525 > > -- Barry H. Lynn, Ph.D Senior Scientist, Lecturer, The Institute of Earth Sciences, The Hebrew University of Jerusalem, Givat Ram, Jerusalem 91904, Israel Tel: 972 547 231 170 Fax: (972)-25662581 Weather It Is, LTD Weather and Climate Focus https://weather-it-is.com Jerusalem, Israel Local: 02 930 9525 Cell: 054 7 231 170 Int-IS: x972 2 930 9525 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Thu Jul 13 09:15:56 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Thu, 13 Jul 2023 09:15:56 -0600 Subject: [ncl-talk] To many lines on the bar graph In-Reply-To: References: Message-ID: Barry, thank you for following up and posting the correct solution. I misunderstood your original request. On Thu, Jul 13, 2023 at 7:27?AM Barry Lynn wrote: > To turn off the lines, set *lbBoxSeparatorLinesOn* > = > False > > On Thu, Jul 6, 2023 at 9:23?AM Barry Lynn wrote: > >> Dave: >> >> That resource is not found in my mapping program (countour map). I need >> to turn off the lines within the label bar. >> >> I think I want this: *lbBoxSeparatorLinesOn* >> = >> True. >> >> On Thu, Jul 6, 2023 at 6:30?AM Barry Lynn wrote: >> >>> Thank you. >>> >>> res at xyLineColors = (/"red","blue"/) ; colors for the above/blow >>> >>> >>> On Thu, Jul 6, 2023 at 5:43?AM Dave Allured - NOAA Affiliate < >>> dave.allured at noaa.gov> wrote: >>> >>>> Example bar_4 on the NCL Bar Charts examples page shows how to do this. >>>> >>>> >>>> On Wed, Jul 5, 2023 at 8:07?PM Barry Lynn via ncl-talk < >>>> ncl-talk at mailman.ucar.edu> wrote: >>>> >>>>> Hello: >>>>> >>>>> Is there a way to cancel the vertical lines that delineate colors on >>>>> the bar graph? >>>>> >>>>> I am trying to use all the colors in the color scheme, but when I do >>>>> that, I end up with a black color bar because the colors are so close >>>>> together. >>>>> >>>>> Thanks, >>>>> >>>>> Barry H. Lynn, Ph.D >>>>> Senior Scientist, Lecturer, >>>>> The Institute of Earth Sciences, >>>>> The Hebrew University of Jerusalem, >>>>> Givat Ram, Jerusalem 91904, Israel >>>>> Tel: 972 547 231 170 >>>>> Fax: (972)-25662581 >>>>> >>>>> Weather It Is, LTD >>>>> Weather and Climate Focus >>>>> https://weather-it-is.com >>>>> Jerusalem, Israel >>>>> Local: 02 930 9525 >>>>> Cell: 054 7 231 170 >>>>> Int-IS: x972 2 930 9525 >>>>> >>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From barry.h.lynn at gmail.com Thu Jul 13 09:27:39 2023 From: barry.h.lynn at gmail.com (Barry Lynn) Date: Thu, 13 Jul 2023 11:27:39 -0400 Subject: [ncl-talk] To many lines on the bar graph In-Reply-To: References: Message-ID: Your welcome. As you know, this line eliminates the vertical black lines between colors, which you need to do if you use many colors in the bar. Barry On Thu, 13 Jul 2023 at 11:16 Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > Barry, thank you for following up and posting the correct solution. I > misunderstood your original request. > > > On Thu, Jul 13, 2023 at 7:27?AM Barry Lynn wrote: > >> To turn off the lines, set *lbBoxSeparatorLinesOn* >> = >> False >> >> On Thu, Jul 6, 2023 at 9:23?AM Barry Lynn wrote: >> >>> Dave: >>> >>> That resource is not found in my mapping program (countour map). I need >>> to turn off the lines within the label bar. >>> >>> I think I want this: *lbBoxSeparatorLinesOn* >>> = >>> True. >>> >>> On Thu, Jul 6, 2023 at 6:30?AM Barry Lynn >>> wrote: >>> >>>> Thank you. >>>> >>>> res at xyLineColors = (/"red","blue"/) ; colors for the above/blow >>>> >>>> >>>> On Thu, Jul 6, 2023 at 5:43?AM Dave Allured - NOAA Affiliate < >>>> dave.allured at noaa.gov> wrote: >>>> >>>>> Example bar_4 on the NCL Bar Charts examples page shows how to do this. >>>>> >>>>> >>>>> On Wed, Jul 5, 2023 at 8:07?PM Barry Lynn via ncl-talk < >>>>> ncl-talk at mailman.ucar.edu> wrote: >>>>> >>>>>> Hello: >>>>>> >>>>>> Is there a way to cancel the vertical lines that delineate colors on >>>>>> the bar graph? >>>>>> >>>>>> I am trying to use all the colors in the color scheme, but when I do >>>>>> that, I end up with a black color bar because the colors are so close >>>>>> together. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Barry H. Lynn, Ph.D >>>>>> Senior Scientist, Lecturer, >>>>>> The Institute of Earth Sciences, >>>>>> The Hebrew University of Jerusalem, >>>>>> Givat Ram, Jerusalem 91904, Israel >>>>>> Tel: 972 547 231 170 >>>>>> Fax: (972)-25662581 >>>>>> >>>>>> Weather It Is, LTD >>>>>> Weather and Climate Focus >>>>>> https://weather-it-is.com >>>>>> Jerusalem, Israel >>>>>> Local: 02 930 9525 >>>>>> Cell: 054 7 231 170 >>>>>> Int-IS: x972 2 930 9525 >>>>>> >>>>> -- Barry H. Lynn, Ph.D Senior Scientist, Lecturer, The Institute of Earth Sciences, The Hebrew University of Jerusalem, Givat Ram, Jerusalem 91904, Israel Tel: 972 547 231 170 Fax: (972)-25662581 Weather It Is, LTD Weather and Climate Focus https://weather-it-is.com Jerusalem, Israel Local: 02 930 9525 Cell: 054 7 231 170 Int-IS: x972 2 930 9525 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Anieklal at cas.iitd.ac.in Thu Jul 13 21:35:08 2023 From: Anieklal at cas.iitd.ac.in (Anie K Lal) Date: Fri, 14 Jul 2023 09:05:08 +0530 Subject: [ncl-talk] Calculation of vertical vapor flux divergence from WRF out file Message-ID: <4684ce57ce30e00b19a0becd541cfca6@cas.iitd.ac.in> Hi all, I want to calculate the vertical vapor flux divergence (1/g*[d(qw)/dz])from a WRF output. I found the vapor flux as below: shum = mixhum_ptrh(pres,temp,rh,2) ;units: (hPA,K,%,kg/kg);calculate the specific humidity(2),(1)means mixing ratio ;printVarSummary(shum) uq = ua * shum ;vapor flux vq = va * shum wq = wa * shum Not sure how to find the divergence. I have gone through few examples in: https://www.ncl.ucar.edu/Applications/wind.shtml https://www.ncl.ucar.edu/Applications/ESMF.shtml All consider only u and v. How do I do it? Looking forward to any kind of help or advise. Thank you. Anie K Lal PhD Student IIT Delhi India From laura at ucar.edu Fri Jul 14 17:57:23 2023 From: laura at ucar.edu (Laura Fowler) Date: Fri, 14 Jul 2023 17:57:23 -0600 Subject: [ncl-talk] byte2flt Message-ID: Hello: I am trying to read Nexrad Reflectivity data from a netCDF file in which Reflectivity has a "byte" format and is defined as: radar-data/20120611> ncdump -h 20120611T1900Z.nc byte Reflectivity(Altitude, Latitude, Longitude) ; Reflectivity:long_name = "Radar Reflectivity" ; Reflectivity:units = "dBZ" ; Reflectivity:scale_factor = 0.5f ; Reflectivity:add_offset = -33.f ; Reflectivity:missing_value = 0b ; A printVarSummary of the dBZ_b variable that points to Reflectivity shows: Variable: dBZ_b Type: byte Total Size: 10064208 bytes 10064208 values Number of Dimensions: 3 Dimensions and sizes: [Altitude | 24] x [Latitude | 539] x [Longitude | 778] Coordinates: Altitude: [ 1..24] Latitude: [30.94..41.7] Longitude: [260.12..275.66] Number Of Attributes: 6 long_name : Radar Reflectivity units : dBZ scale_factor : 0.5 add_offset : -33 missing_value : 0 _FillValue : 0 After reading the section on "Coercion of types", and for now ignoring scale_factor and add_offset, I simply used the tofloat function to output the max and min values of dBZ_b. I got: (0) --- max dBZ_b = 127 (0) --- min dBZ_b = -128 Finally, using scale_factor and add_offset, I used the function byte2flt to convert dBZ_b to a float and output the max and min value of dBZ_s, or: dBZ_s = byte2flt(dBZ_b) (0) --- max dBZ_s = 30.5 (0) --- min dBZ_s = -97 The maximum value of dBZ_s is much lower than I expected (the maximum value of dBZ_s should actually be 58.5 dBZ, as derived by an IDL script used to plot the nexrad Reflectivity data for a peer-review publication). Can somebody help me figure out why I am getting values that are too low relative to what I am expecting. I also tried to bypass the byte2flt function and use the scale_factor and add_offset variables (x_float = x_byte*scale + offset), but to no avail. If you interested to help me out, my working directory on cheyenne is /glade/u/home/laura/fromYunYao/radar-data/20120611; the data file is 20120611T1900Z.nc; the ncl script is read.ncl; and the main idl script is nexrad.pro. Many thanks, Laura -- !------------------------------------------------------------------------------------------------------------- Laura D. Fowler Mesoscale and Microscale Meteorology Division (MMM) National Center for Atmospheric Research P.O. Box 3000, Boulder CO 80307-3000 e-mail: laura at ucar.edu phone: 303-497-1628 !------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.allured at noaa.gov Fri Jul 14 18:51:11 2023 From: dave.allured at noaa.gov (Dave Allured - NOAA Affiliate) Date: Fri, 14 Jul 2023 18:51:11 -0600 Subject: [ncl-talk] byte2flt In-Reply-To: References: Message-ID: A long time, ago, there was ambiguity within Netcdf and NCL, as to whether type "byte" was signed or unsigned. Eventually everyone settled on "signed". NCL is attempting to interpret this byte array as signed, but there are some clues that this file may have been originally written as unsigned bytes. That would cause NCL to misinterpret the data. This would also be consistent with your symptoms. Unsigned maps into signed like this. 0 to 127 map straight across to 0 to 127. 128 to 255 maps to -128 to -1. To unscramble, try this custom formula (untested). It is important to unscramble BEFORE unpacking with scale and offset. dBZ_b = f->Reflectivity ! read from file dbz2 = toshort (dBZ_b) ! convert to a type that can hold full positive range dbz3 = where ( (dbz2 .lt. 0), (dbz2 + 256), dbz2) ! decode negatives into positives copy_VarMeta (dBZ_b, dbz3) ! restore original metadata dbz4 = short2flt (dbz3) ! unpack with scale and offset printMinMax (dbz4,0) If that doesn't come out right, then use printVarSummary and printMinMax at every step, to see what is going on. Another diagnostic would be to count discrete original values, and examine their distribution curve. On Fri, Jul 14, 2023 at 5:57?PM Laura Fowler via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hello: > > I am trying to read Nexrad Reflectivity data from a netCDF file in which > Reflectivity has a "byte" format and is defined as: > > radar-data/20120611> ncdump -h 20120611T1900Z.nc > > byte Reflectivity(Altitude, Latitude, Longitude) ; > > Reflectivity:long_name = "Radar Reflectivity" ; > > Reflectivity:units = "dBZ" ; > > Reflectivity:scale_factor = 0.5f ; > > Reflectivity:add_offset = -33.f ; > > Reflectivity:missing_value = 0b ; > > A printVarSummary of the dBZ_b variable that points to Reflectivity shows: > > Variable: dBZ_b > > Type: byte > > Total Size: 10064208 bytes > > 10064208 values > > Number of Dimensions: 3 > > Dimensions and sizes: [Altitude | 24] x [Latitude | 539] x [Longitude | > 778] > > Coordinates: > > Altitude: [ 1..24] > > Latitude: [30.94..41.7] > > Longitude: [260.12..275.66] > > Number Of Attributes: 6 > > long_name : Radar Reflectivity > > units : dBZ > > scale_factor : 0.5 > > add_offset : -33 > > missing_value : 0 > > _FillValue : 0 > > After reading the section on "Coercion of types", and for now ignoring > scale_factor and add_offset, I simply used the tofloat function to output > the max and min values of dBZ_b. I got: > > (0) --- max dBZ_b = 127 > > (0) --- min dBZ_b = -128 > > > Finally, using scale_factor and add_offset, I used the function byte2flt > to convert dBZ_b to a float and output the max and min value of dBZ_s, or: > > dBZ_s = byte2flt(dBZ_b) > > (0) --- max dBZ_s = 30.5 > > (0) --- min dBZ_s = -97 > > The maximum value of dBZ_s is much lower than I expected (the maximum > value of dBZ_s should actually be 58.5 dBZ, as derived by an IDL script > used to plot the nexrad Reflectivity data for a peer-review publication). > > Can somebody help me figure out why I am getting values that are too low > relative to what I am expecting. I also tried to bypass the byte2flt > function and use the scale_factor and add_offset variables (x_float = > x_byte*scale + offset), but to no avail. > > If you interested to help me out, my working directory on cheyenne is /glade/u/home/laura/fromYunYao/radar-data/20120611; > the data file is 20120611T1900Z.nc; the ncl script is read.ncl; and the > main idl script is nexrad.pro. > > Many thanks, > Laura > -- > > !------------------------------------------------------------------------------------------------------------- > Laura D. Fowler > > Mesoscale and Microscale Meteorology Division (MMM) > National Center for Atmospheric Research > P.O. Box 3000, Boulder CO 80307-3000 > > e-mail: laura at ucar.edu > phone: 303-497-1628 > > !------------------------------------------------------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zoejacobs1990 at gmail.com Fri Jul 14 20:31:39 2023 From: zoejacobs1990 at gmail.com (zoe jacobs) Date: Sat, 15 Jul 2023 06:01:39 +0330 Subject: [ncl-talk] Extract point values from WRF model Message-ID: Hi dear NCL users, I need to extract values for some specific lat/lon from my WRF output files ( for example temperature value fat lat=23 and lon= 36 at 00:00 UTC) . But I am completely new in NCL, and do not know how I can d o this. May I ask you please to help me to achieve this? Looking forward to hearing from you. Kind regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Fri Jul 14 20:52:01 2023 From: shea at ucar.edu (Dennis Shea) Date: Fri, 14 Jul 2023 20:52:01 -0600 Subject: [ncl-talk] Extract point values from WRF model In-Reply-To: References: Message-ID: rcm2points or to include meta data *rcm2points_Wrap* On Fri, Jul 14, 2023 at 8:31?PM zoe jacobs via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi dear NCL users, > I need to extract values for some specific lat/lon from my WRF output > files ( for example temperature value fat lat=23 and lon= 36 at 00:00 UTC) > . But I am completely new in NCL, and do not know how I can d o this. May I > ask you please to help me to achieve this? > Looking forward to hearing from you. > Kind regards. > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Sat Jul 15 12:05:37 2023 From: shea at ucar.edu (Dennis Shea) Date: Sat, 15 Jul 2023 12:05:37 -0600 Subject: [ncl-talk] Calculation of vertical vapor flux divergence from WRF out file In-Reply-To: <4684ce57ce30e00b19a0becd541cfca6@cas.iitd.ac.in> References: <4684ce57ce30e00b19a0becd541cfca6@cas.iitd.ac.in> Message-ID: There are no specific functions or examples to calculate vertical vapor flux divergence: (1/g*[d(qw)/dz]) from a WRF output. ================= I do not remember much about WRF output. Generically: QW = Q*W dQWdz = *center_finite_diff_n* (QW,'z',False,0,0) ======================= There are several examples for doing this type of activity on 'regular/ rectilinear' grids with pressure [also, hybrid levels]: *https://www.ncl.ucar.edu/Applications/wind.shtml* ======================== Good Luck On Thu, Jul 13, 2023 at 9:35?PM Anie K Lal via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi all, > > I want to calculate the vertical vapor flux divergence > (1/g*[d(qw)/dz])from a WRF output. > > I found the vapor flux as below: > shum = mixhum_ptrh(pres,temp,rh,2) ;units: > (hPA,K,%,kg/kg);calculate the specific humidity(2),(1)means mixing ratio > ;printVarSummary(shum) > uq = ua * shum ;vapor flux > vq = va * shum > wq = wa * shum > > Not sure how to find the divergence. > I have gone through few examples in: > https://www.ncl.ucar.edu/Applications/wind.shtml > https://www.ncl.ucar.edu/Applications/ESMF.shtml > > All consider only u and v. How do I do it? > > Looking forward to any kind of help or advise. > > Thank you. > Anie K Lal > PhD Student > IIT Delhi > India > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zoejacobs1990 at gmail.com Sun Jul 16 13:00:09 2023 From: zoejacobs1990 at gmail.com (zoe jacobs) Date: Sun, 16 Jul 2023 22:30:09 +0330 Subject: [ncl-talk] Extract point values from WRF model In-Reply-To: References: Message-ID: Dear Dennis, Thanks for your advice. I prepare a script as follow: ---------------------------------------------------------------------------------------------------------------------------------------------------------------- lon_pts = 51 lat_pts = 31 f = addfile ("wrfout_d03_2021-01-14_00:00:00", "r") lat2d = f->XLAT(0,:,:) ; size = (nlat,nlon) lon2d = f->XLONG(0,:,:) ; size = (nlat,nlon) time = wrf_user_getvar(f,"times",-1) ;========================================= u10 = f->U10 v10 = f->V10 ;u_plane := u10*3.6 ;v_plane := v10*3.6 wspd = wind_speed(u10,v10) wdir = wind_direction(u10,v10,0) ;=========================================== printVarSummary(time) printVarSummary(rh) x1 = f->T2 x=x1-273.15 nm = getind_latlon2d (lat2d,lon2d, lat_pts, lon_pts) print(nm) do k=0,dimsizes(lat_pts)-1 ; loop over locations n = nm(k,0) m = nm(k,1) x_nm = x(:,n,m) ; x(n,m) wspd_nm = wspd (:,n,m) print("---") print(lat2d(n,m)+" "+lon2d(n,m)) print(time) print(x_nm) print(wspd_nm) asciiwrite ("temperature", x_nm) asciiwrite ("wind", wspd_nm) asciiwrite ("time", time) end do ---------------------------------------------------------------------------------------------------------------------------------------------------------------- Now my questions are that: 1. Is my script correct? 2. How can I have time and one of variable (say temperature) net together in an ascii file please? like: time temp 00 2 06 2.3 12 4 Look forward to hearing from you. Best wishes, On Sat, Jul 15, 2023 at 6:22?AM Dennis Shea wrote: > rcm2points > > or to include meta data > *rcm2points_Wrap* > > > > On Fri, Jul 14, 2023 at 8:31?PM zoe jacobs via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hi dear NCL users, >> I need to extract values for some specific lat/lon from my WRF output >> files ( for example temperature value fat lat=23 and lon= 36 at 00:00 UTC) >> . But I am completely new in NCL, and do not know how I can d o this. May I >> ask you please to help me to achieve this? >> Looking forward to hearing from you. >> Kind regards. >> _______________________________________________ >> ncl-talk mailing list >> ncl-talk at mailman.ucar.edu >> List instructions, subscriber options, unsubscribe: >> https://mailman.ucar.edu/mailman/listinfo/ncl-talk >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From laura at ucar.edu Mon Jul 17 09:42:32 2023 From: laura at ucar.edu (Laura Fowler) Date: Mon, 17 Jul 2023 09:42:32 -0600 Subject: [ncl-talk] byte2flt In-Reply-To: References: Message-ID: Hi Dave: Many thanks for the email you sent me last Friday. You were completely right when you wrote that the data set was originally written as unsigned bytes. This definitely agreed with the min and max values of the Reflectivity data that I was getting. I think that I was slowly getting there but you definitely helped me speed up the process. Always nice to start Monday with something accomplished over the weekend. Instead of applying the different steps that you suggested, I simply used the function tounsigned before the function byte2flt. This led to getting the correct min and max of for the radar reflectivity, and reflectivity maps consistent with the publication I was using as a reference. Really appreciate your help. Thanks again, Laura On Fri, Jul 14, 2023 at 6:51?PM Dave Allured - NOAA Affiliate < dave.allured at noaa.gov> wrote: > A long time, ago, there was ambiguity within Netcdf and NCL, as to whether > type "byte" was signed or unsigned. Eventually everyone settled on > "signed". NCL is attempting to interpret this byte array as signed, but > there are some clues that this file may have been originally written as > unsigned bytes. That would cause NCL to misinterpret the data. This would > also be consistent with your symptoms. > > Unsigned maps into signed like this. 0 to 127 map straight across to 0 to > 127. 128 to 255 maps to -128 to -1. To unscramble, try this custom > formula (untested). It is important to unscramble BEFORE unpacking with > scale and offset. > > dBZ_b = f->Reflectivity ! read from file > dbz2 = toshort (dBZ_b) ! convert to a type that can hold full > positive range > dbz3 = where ( (dbz2 .lt. 0), (dbz2 + 256), dbz2) ! decode negatives > into positives > copy_VarMeta (dBZ_b, dbz3) ! restore original metadata > dbz4 = short2flt (dbz3) ! unpack with scale and offset > printMinMax (dbz4,0) > > If that doesn't come out right, then use printVarSummary and printMinMax > at every step, to see what is going on. Another diagnostic would be to > count discrete original values, and examine their distribution curve. > > > On Fri, Jul 14, 2023 at 5:57?PM Laura Fowler via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hello: >> >> I am trying to read Nexrad Reflectivity data from a netCDF file in which >> Reflectivity has a "byte" format and is defined as: >> >> radar-data/20120611> ncdump -h 20120611T1900Z.nc >> >> byte Reflectivity(Altitude, Latitude, Longitude) ; >> >> Reflectivity:long_name = "Radar Reflectivity" ; >> >> Reflectivity:units = "dBZ" ; >> >> Reflectivity:scale_factor = 0.5f ; >> >> Reflectivity:add_offset = -33.f ; >> >> Reflectivity:missing_value = 0b ; >> >> A printVarSummary of the dBZ_b variable that points to Reflectivity shows: >> >> Variable: dBZ_b >> >> Type: byte >> >> Total Size: 10064208 bytes >> >> 10064208 values >> >> Number of Dimensions: 3 >> >> Dimensions and sizes: [Altitude | 24] x [Latitude | 539] x [Longitude | >> 778] >> >> Coordinates: >> >> Altitude: [ 1..24] >> >> Latitude: [30.94..41.7] >> >> Longitude: [260.12..275.66] >> >> Number Of Attributes: 6 >> >> long_name : Radar Reflectivity >> >> units : dBZ >> >> scale_factor : 0.5 >> >> add_offset : -33 >> >> missing_value : 0 >> >> _FillValue : 0 >> >> After reading the section on "Coercion of types", and for now ignoring >> scale_factor and add_offset, I simply used the tofloat function to output >> the max and min values of dBZ_b. I got: >> >> (0) --- max dBZ_b = 127 >> >> (0) --- min dBZ_b = -128 >> >> >> Finally, using scale_factor and add_offset, I used the function byte2flt >> to convert dBZ_b to a float and output the max and min value of dBZ_s, or: >> >> dBZ_s = byte2flt(dBZ_b) >> >> (0) --- max dBZ_s = 30.5 >> >> (0) --- min dBZ_s = -97 >> >> The maximum value of dBZ_s is much lower than I expected (the maximum >> value of dBZ_s should actually be 58.5 dBZ, as derived by an IDL script >> used to plot the nexrad Reflectivity data for a peer-review publication). >> >> Can somebody help me figure out why I am getting values that are too low >> relative to what I am expecting. I also tried to bypass the byte2flt >> function and use the scale_factor and add_offset variables (x_float = >> x_byte*scale + offset), but to no avail. >> >> If you interested to help me out, my working directory on cheyenne is /glade/u/home/laura/fromYunYao/radar-data/20120611; >> the data file is 20120611T1900Z.nc; the ncl script is read.ncl; and the >> main idl script is nexrad.pro. >> >> Many thanks, >> Laura >> -- >> >> !------------------------------------------------------------------------------------------------------------- >> Laura D. Fowler >> >> Mesoscale and Microscale Meteorology Division (MMM) >> National Center for Atmospheric Research >> P.O. Box 3000, Boulder CO 80307-3000 >> >> e-mail: laura at ucar.edu >> phone: 303-497-1628 >> >> !------------------------------------------------------------------------------------------------------------- >> > -- !------------------------------------------------------------------------------------------------------------- Laura D. Fowler Mesoscale and Microscale Meteorology Division (MMM) National Center for Atmospheric Research P.O. Box 3000, Boulder CO 80307-3000 e-mail: laura at ucar.edu phone: 303-497-1628 !------------------------------------------------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From jayantkp2979 at gmail.com Mon Jul 17 21:02:10 2023 From: jayantkp2979 at gmail.com (Jayant) Date: Tue, 18 Jul 2023 00:02:10 -0300 Subject: [ncl-talk] daily climatology time dimension Message-ID: Hi! Using asciiread, I am reading a file for daily values that are in reverse chronological order (starts from September 01, 2015 and ends in April 30, 1968. Further, I used calendar utilities and created time dimensions and computed daily and monthly climatologies. The printVarSummary of the daily climatology variable shows year_day = [1...366]. Do the year_day = 1 corresponds to Jan 1 climatology for Sept 01? How to be sure of it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From shea at ucar.edu Tue Jul 18 10:07:00 2023 From: shea at ucar.edu (Dennis Shea) Date: Tue, 18 Jul 2023 10:07:00 -0600 Subject: [ncl-talk] daily climatology time dimension In-Reply-To: References: Message-ID: To my knowledge, the answer is "yes" The functions use the 'day of the year' rather than the order the data are read. "How to be sure?" maybe plot the variable. On Mon, Jul 17, 2023 at 9:02?PM Jayant via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi! Using asciiread, I am reading a file for daily values that are in > reverse chronological order (starts from September 01, 2015 and ends in > April 30, 1968. Further, I used calendar utilities and created time > dimensions and computed daily and monthly climatologies. The > printVarSummary of the daily climatology variable shows year_day = > [1...366]. Do the year_day = 1 corresponds to Jan 1 climatology for Sept > 01? How to be sure of it? > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tabishumaransari at gmail.com Mon Jul 24 12:11:29 2023 From: tabishumaransari at gmail.com (Tabish Ansari) Date: Mon, 24 Jul 2023 20:11:29 +0200 Subject: [ncl-talk] gsn_csm_contour_map creates a missing value strip near greenwich meridian after automatic grid transformation Message-ID: Hi I have a CESM global model output where the grid is not centered at 0 degrees East, i.e., it doesn't span from (-90 to +90 deg) latitude. Instead it spands 0-180 deg latitudes. When I use the gsn_csm_contour_map function to create a global contour map, it automatically transforms the grid to one that is centered at 0 degrees meridian - which is good, however, it shows a strip of missing values (no colors in the contour plot) on the map along the meridian. I think the model output has no such missing data over that region. I have attached the plot. Here's my script: *beginDIR = "/work/users/tan/Hannah-HTAP2data/"f1 = addfile("/work/users/tan/Hannah-HTAP2data/NOX_HTAP.cam.h0.2010.nc ","r") ; BASELINE NOX-TAGGED RUN o3 = f1->O3 o3 = 10^9 * o3 o3 at units = "ppb" o3annual = o3(0,:,:) ; initializing for coordinate arrays o3annual = dim_avg_n(o3, 0)* *;;;;;GRAPHICAL SETTINGS;;;;; wks = gsn_open_wks ("png","SurfaceO3_2010") ; send graphics to png res = True res at gsnMaximize = True ; Maximize plot in frame res at cnFillOn = True ; turn on color res at cnLinesOn = False ; no contour lines res at cnLineLabelsOn = False ; turn off contour lines res at gsnAddCyclic = False res at mpFillOn = True ; map fill res at cnFillMode = "RasterFill" res at mpGeophysicalLineThicknessF = 1.0 res at mpDataBaseVersion = "MediumRes" res at mpOutlineBoundarySets = "Geophysical" res at cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels o3levels = ispan(5,65,5) res at cnLevels = o3levels res at cnFillPalette = "BlAqGrYeOrReVi200" ; set color map res at tmYLLabelFontHeightF = 0.012 res at tiMainString = "Annual avg surface O3 for 2010" plot = gsn_csm_contour_map(wks,o3annual,res) ; create plotend* Please let me know if this is a known issue and can be avoided/corrected. Thanks Tabish -------------------------------------------------------------------------------------- Dr Tabish Ansari Research Associate Air Quality Modelling Group Research Institute for Sustainability (RIFS) - Helmholtz Centre Potsdam Potsdam, Germany -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SurfaceO3_2010.png Type: image/png Size: 153151 bytes Desc: not available URL: From rashidcomsis at gmail.com Mon Jul 24 13:05:04 2023 From: rashidcomsis at gmail.com (Rashed Mahmood) Date: Mon, 24 Jul 2023 21:05:04 +0200 Subject: [ncl-talk] gsn_csm_contour_map creates a missing value strip near greenwich meridian after automatic grid transformation In-Reply-To: References: Message-ID: Hi Tabish, Turning on this resource should work: *res at gsnAddCyclic = False => True * Cheers, Rashed On Mon, Jul 24, 2023 at 8:11?PM Tabish Ansari via ncl-talk < ncl-talk at mailman.ucar.edu> wrote: > Hi > > I have a CESM global model output where the grid is not centered at 0 > degrees East, i.e., it doesn't span from (-90 to +90 deg) latitude. Instead > it spands 0-180 deg latitudes. When I use the gsn_csm_contour_map function > to create a global contour map, it automatically transforms the grid to one > that is centered at 0 degrees meridian - which is good, however, it shows a > strip of missing values (no colors in the contour plot) on the map along > the meridian. I think the model output has no such missing data over that > region. > > I have attached the plot. > > Here's my script: > > > > > > > > > > > > *beginDIR = "/work/users/tan/Hannah-HTAP2data/"f1 = > addfile("/work/users/tan/Hannah-HTAP2data/NOX_HTAP.cam.h0.2010.nc > ","r") ; BASELINE NOX-TAGGED RUN o3 = > f1->O3 o3 = 10^9 * o3 o3 at units = "ppb" o3annual = o3(0,:,:) ; > initializing for coordinate arrays o3annual = dim_avg_n(o3, 0)* > > > > > > > > > > > > > > > > > > > > > > > > *;;;;;GRAPHICAL SETTINGS;;;;; wks = gsn_open_wks > ("png","SurfaceO3_2010") ; send graphics to png res > = True res at gsnMaximize = True ; Maximize plot in > frame res at cnFillOn = True ; turn on color > res at cnLinesOn = False ; no contour lines > res at cnLineLabelsOn = False ; turn off contour lines > res at gsnAddCyclic = False res at mpFillOn = True ; > map fill res at cnFillMode = "RasterFill" > res at mpGeophysicalLineThicknessF = 1.0 res at mpDataBaseVersion = > "MediumRes" res at mpOutlineBoundarySets = "Geophysical" > res at cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels > o3levels = ispan(5,65,5) res at cnLevels > = o3levels res at cnFillPalette = "BlAqGrYeOrReVi200" ; set color > map res at tmYLLabelFontHeightF = 0.012 res at tiMainString = "Annual avg > surface O3 for 2010" plot = gsn_csm_contour_map(wks,o3annual,res) ; > create plotend* > > Please let me know if this is a known issue and can be avoided/corrected. > > Thanks > > Tabish > > -------------------------------------------------------------------------------------- > Dr Tabish Ansari > Research Associate > Air Quality Modelling Group > Research Institute for Sustainability (RIFS) - Helmholtz Centre Potsdam > Potsdam, Germany > _______________________________________________ > ncl-talk mailing list > ncl-talk at mailman.ucar.edu > List instructions, subscriber options, unsubscribe: > https://mailman.ucar.edu/mailman/listinfo/ncl-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tabishumaransari at gmail.com Mon Jul 24 13:10:04 2023 From: tabishumaransari at gmail.com (Tabish Ansari) Date: Mon, 24 Jul 2023 21:10:04 +0200 Subject: [ncl-talk] gsn_csm_contour_map creates a missing value strip near greenwich meridian after automatic grid transformation In-Reply-To: References: Message-ID: Hi Rashed, That worked - thank you very much! best regards, Tabish -------------------------------------------------------------------------------------- Dr Tabish Ansari Research Associate Air Quality Modelling Group Research Institute for Sustainability (RIFS) - Helmholtz Centre Potsdam Potsdam, Germany On Mon, 24 Jul 2023 at 21:05, Rashed Mahmood wrote: > Hi Tabish, > > Turning on this resource should work: *res at gsnAddCyclic = False > => True * > > > Cheers, > Rashed > > > > > On Mon, Jul 24, 2023 at 8:11?PM Tabish Ansari via ncl-talk < > ncl-talk at mailman.ucar.edu> wrote: > >> Hi >> >> I have a CESM global model output where the grid is not centered at 0 >> degrees East, i.e., it doesn't span from (-90 to +90 deg) latitude. Instead >> it spands 0-180 deg latitudes. When I use the gsn_csm_contour_map function >> to create a global contour map, it automatically transforms the grid to one >> that is centered at 0 degrees meridian - which is good, however, it shows a >> strip of missing values (no colors in the contour plot) on the map along >> the meridian. I think the model output has no such missing data over that >> region. >> >> I have attached the plot. >> >> Here's my script: >> >> >> >> >> >> >> >> >> >> >> >> *beginDIR = "/work/users/tan/Hannah-HTAP2data/"f1 = >> addfile("/work/users/tan/Hannah-HTAP2data/NOX_HTAP.cam.h0.2010.nc >> ","r") ; BASELINE NOX-TAGGED RUN o3 = >> f1->O3 o3 = 10^9 * o3 o3 at units = "ppb" o3annual = o3(0,:,:) ; >> initializing for coordinate arrays o3annual = dim_avg_n(o3, 0)* >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> *;;;;;GRAPHICAL SETTINGS;;;;; wks = gsn_open_wks >> ("png","SurfaceO3_2010") ; send graphics to png res >> = True res at gsnMaximize = True ; Maximize plot in >> frame res at cnFillOn = True ; turn on color >> res at cnLinesOn = False ; no contour lines >> res at cnLineLabelsOn = False ; turn off contour lines >> res at gsnAddCyclic = False res at mpFillOn = True ; >> map fill res at cnFillMode = "RasterFill" >> res at mpGeophysicalLineThicknessF = 1.0 res at mpDataBaseVersion = >> "MediumRes" res at mpOutlineBoundarySets = "Geophysical" >> res at cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels >> o3levels = ispan(5,65,5) res at cnLevels >> = o3levels res at cnFillPalette = "BlAqGrYeOrReVi200" ; set color >> map res at tmYLLabelFontHeightF = 0.012 res at tiMainString = "Annual avg >> surface O3 for 2010" plot = gsn_csm_contour_map(wks,o3annual,res) ; >> create plotend* >> >> Please let me know if this is a known issue and can be avoided/corrected. >> >> Thanks >> >> Tabish >> >> -------------------------------------------------------------------------------------- >> Dr Tabish Ansari >> Research Associate >> Air Quality Modelling Group >> Research Institute for Sustainability (RIFS) - Helmholtz Centre Potsdam >> Potsdam, Germany >> _______________________________________________ >> ncl-talk mailing list >> ncl-talk at mailman.ucar.edu >> List instructions, subscriber options, unsubscribe: >> https://mailman.ucar.edu/mailman/listinfo/ncl-talk >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: