Re: NCL V6.0.0 announcement: default missing values will be changed

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 10 2011 - 18:08:08 MST

On Jan 10, 2011, at 9:29 AM, wxtofly wrote:

> Will you provide a function to prescan existing ncl code for
incompatiblity?

As mentioned in the original email, we've created a command line
option that will allow you to get the old behavior for missing
values. You will be able to run your script with and without this
option and compare the results.

You will also be able to programmatically set the default missing
values back to the old values:

    set_default_fillvalue("all","ncl_v5")

As for providing a function to scan scripts: this is not a trivial
matter as something like this could be unique to a user's programming
style. If somebody has created some kind of hack to convert their hard-
coded missing values, feel free to post to ncl-talk.

The way I've done this personally is to search for the string "-99" in
my code. This will potentially catch hard-coded values for shorts,
ints, longs, floats, and doubles. However, I didn't want to
automatically replace all instances of these values, because it just
depended on what my original intention was.

The other possible incompatibility that we'll be introducing is the
byte/character issue. Currently, bytes are unsigned and characters
are signed. This is going to be switched in 6.0.0.

The place where this will be an issue is if you are trying to assign
values larger than 127 to a byte variable.

For example, in versions 5.2.1 and earlier, you can do the following:

   b = 128b

In versions 6.0.0 and later, however, this value will be too large,
since the largest signed byte is (2^7-1) (127). What will happen in
this case is you'll get -128.

To my knowledge, these are the only two places in V6.0.0 where
potential incompatibilities will be issued.

We are interested in getting feedback if either of these changes are
an issue. We probably won't revert back to the old method, but we
might be able to provide some transitional help if we know what the
concerns are.

--Mary

>
> On 01/05/2011 06:50 AM, Mary Haley wrote:
>>
>> Dear NCL users,
>>
>>
>> We are gearing up towards a major new release of NCL,
>> V6.0.0, which we
>> plan to release a beta version of in late January.
>>
>> We'll send out announcements in the upcoming days about
>> this version
>> including major changes, new features, and other important
>> information.
>>
>>
>> -------------------------------------------------------------------
>>
>> Our first announcement is that the default missing values
>> for all
>> numeric variable types will be changed.
>>
>> This is being done to stay in line with the default
>> missing values for
>> NetCDF. Also, some of the old default values are too
>> small to be well
>> out of the range of potential calculations.
>>
>> The default missing values for the variable types that
>> will be changed
>> are:
>>
>> Variable type Old missing value New missing
>> value
>> byte 0xff -127
>> short -99 -32767
>> ushort 0 65535
>> integer -999 -2147483647
>> uint 0 4294967295
>> long -9999 -2147483647
>> ulong 0 4294967295
>> int64 -99999999 -9223372036854775806
>> uint64 0 18446744073709551614
>> float -999 9.96921e+36
>> double -9999 9.969209968386869e+36
>> character 0 0x00
>>
>> Note that the missing values for bytes and characters
>> are rather
>> different. This is because in V6.0.0, an NCL byte will go
>> from being
>> an unsigned byte to a signed byte, and an NCL character
>> will go
>> from being a signed byte to an unsigned byte. This change
>> keeps
>> us in line with the definition of a NetCDF byte and
>> character as
>> well.
>>
>> This change could cause some backwards incompatibility in
>> your NCL
>> scripts if you are checking for missing data using hard-
>> coded values.
>>
>> For example, if you have a float variable "x" that
>> was assigned a
>> default missing value of -999 via some other
>> calculation, *and* you
>> have code like this:
>>
>> if(x(i).eq.-999)) then
>> ...do something...
>>
>>
>> then your code may no longer work in V6.0.0. You
>> should instead use
>> functions like "ismissing" to check for missing values:
>>
>> if(ismissing(x(i))) then
>> ...do something...
>>
>> This change could also affect reading in values with
>> ASCII reading
>> functions (asciiread, readAsciiTable). These
>> functions automatically
>> assign a _FillValue attribute based on the type of
>> the variable you're
>> reading in. If you are assuming that the default missing
>> value is
>> -999 for floats, say, then your code will not work properly.
>>
>> For example, if you have an ASCII file with float values,
>> and you have
>> "-999" in the file to represent missing values, then you
>> will need to
>> explicitly set the _FillValue attribute to -999 after you
>> read it in,
>> because now the default missing value for a float will
>> be "9.96921e+36":
>>
>> data = asciiread("file.txt",-1,"float")
>> data@_FillValue = -999 ; Default is 9.96921e+36 in V6.00
>>
>>
>> You can make these kind of changes *now* to your scripts
>> without
>> changing their behavior.
>>
>>
>> We will provide two ways to get at the old default missing
>> values if you are
>> not ready to change your code. One way will be to call
>> a procedure:
>>
>>
>> set_default_fillvalue("all", "ncl_v5")
>>
>>
>> (The exact names may change.)
>>
>>
>> The second way will be to use a command line option when
>> you run NCL.
>>
>>
>> However, we strongly encourage people to clean up their
>> code now
>> (if necessary), to be ready for the change in V6.0.0.
>>
>>
>> -------------------------------------------------------------------
>>
>> Stay tuned for more announcements on NCL Version 6.0.0.
>> You can
>> also see all the latest information on V6.0.0 at:
>>
>> http://www.ncl.ucar.edu/future_release.shtml
>>
>>
>> --Mary
>>
>>
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
> --
> TJ's Blanchard Page <ene3.ico> My Wx Widget <ebeywings.ico> Ft
> Ebey (Whidbey) <nwsicon.ico> NWS Seattle <raspicon16.png>ASP
> <skewt.ico> : MAPS/RUC2 <skewt.ico> | <llapse1.png> Lo Alt | MM5
> <skewt.ico> <nwsicon.ico> Bham Obs <fireSky.gif> Fire Winds Rasp
> <skewt.ico> Soundings
> Winds Aloft R♥sp Visible Satellite <discuss.jpg> Fcst
> Discussion <ca_icon.ico> Fraser Valley <windgramico.png>
> Windgrams text
> <nwsicon.ico> Blanchard Digital | ♥Meteogram ♦UW Satellite |
> Loop ♥ <discuss.jpg> Discussion With Images <nwsicon.ico>
> Windcast <blipspot1.ico> Blipspots
> ♦ Quick Radar ♥ <nwsicon.ico> NWS Radar 9 Meso-stations
> Pressure gradients WA Meso Stations map <wbarb3.png> Time/hght/wind
> MesoW GoogleMaps <findu.ico> aprs current <wunder.ico> Personal Wx
> Stations ♣ <nwsicon.ico> Wind Map now, sfc winds | bl winds
> RASP Regional Atmospheric Soaring Predictions for PNW ||
> Average BL wind loop Blanchard
> Surface wind forecast Loops: | Animated Radar | | loop
> Blanchard | loop PNW | loop FtEbey | loop Tiger | loop FraserValley
>
> Layered by altitude Sea Level to 850mb (approx 5000 ft)
> looped by time wind forecasts:
> Blanchard Pressure Level Loop | Tiger Pressure Level Loop | Fraser
> Valley Pressure Level Loop
> All day hour-by-hour text RUC2/MAPS soundings
> These have no graphics and are designed to be printed to take with
> you to the site.
> After sunclipse there will be one run for the next day but it only
> has MAPS soundings.
> Woodside/Sumas/Bridal Black Mt Big Johnson Stewart
> same as Blanchard Ft Ebey Skagit Valley Tiger
> Blipsp⊕ts: | Baldy | BJ | Black | BlackLZ | Blanchard | Chelan |
> Iron | Saddle | Stewart | Tiger | FtEbey | Woodside | Bridal Falls
> | Current Rapid Update Soundings for flying sites | Winds aloft
> Seatac & Vancouver | Visible Satellite zoomed | NWS forecasts |
> Abbreviated pages for mobile devices. | Blanchard | Tiger | Ft Ebey
> | East Side
> The Seattle Forecast Discussion "translated" or with maps or
> original form without maps (available sooner) Learn to read the
> maps. Soundings Tutorial
> Cloud Forecast -- RUC based Meteogram for KBLI Bellingham | RUC
> based Meteogram for CYXX Abbotsford -- Cloud Forecast
> TJ Olney Weather: Site Map
> _______________________________________________
> 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 Mon Jan 10 18:08:17 2011

This archive was generated by hypermail 2.1.8 : Thu Jan 13 2011 - 09:24:21 MST