Re: Fwd: fill with fillvalue

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 09 2011 - 09:18:26 MST

In the statement
   dc3(i) = v1(i) - abs(dr3(i) * dv1(i))
(a) one or more of the variables v1(i), dr3(i) or dv1(i)
is a _FillValue

or

(b) the statement is 'inadvertently' yielding a number equal to the
_FillValue. For example: v1=-998, dr3=2, dv1=0.5 ==> dc3=-999
  I am guessing that the _FillValue is -999. It is always
suggested that the _FillValue be some number well outside
of any possible result from a computation: eg dc3@_FillValue = 1e30

Try
     if (.not.ismissing(dc3(i)) .and.\
        (dc3(i) .le. -100) .and. (dc3(i) .gt. -999)) then
         dc3(i) = dc3@_FillValue
     end if

A better way of doing computations would be
to eliminate the do loop and use array syntax
and use the where statement

    dc3 = v1 - abs(dr3 * dv1) ; array syntax
    dc3 = where(.not.ismissing(dc3(i)) .and.\
               (dc3 .le. -100) .and. (dc3 .gt. -999) \
                dc3@_FillValue, dc3)

On 2/9/11 8:03 AM, mark vogel wrote:
> Dear all
> I try to put Fill values to the variable.
> What is the best way to do it?
> Thanks
> Mark
> This is what I did and the error message said I could not have fill
> value result from if statment
> fatal:The result of the conditional expression yields a missing value.
> NCL can not determine branch, see ismissing function
> ^Mfatal:Execute: Error occurred at or near line 156 in file adjust_NR.ncl
>
> do i = 0,180
> dc3(i) = v1(i) - abs(dr3(i) * dv1(i))
> if (dc3(i) .le. -100) .and. (dc3(i) .gt. -999) then
> dc3(i) = -999
> end if
> end do
>
> ---------- Forwarded message ----------
> From: ** <ncl-talk-bounces@ucar.edu <mailto:ncl-talk-bounces@ucar.edu>>
> Date: Tue, Feb 8, 2011 at 5:00 PM
> Subject: The results of your email commands
> To: mdvogelii@gmail.com <mailto:mdvogelii@gmail.com>
>
>
> The results of your email command are provided below. Attached is your
> original message.
>
> - Results:
> Ignoring non-text/plain MIME parts
> Invalid confirmation string. Note that confirmation strings expire
> approximately 3 days after the initial subscription request. If your
> confirmation has expired, please try to re-submit your original request or
> message.
>
> - Unprocessed:
> On Tue, Feb 8, 2011 at 4:49 PM, <ncl-talk-request@ucar.edu
> <mailto:ncl-talk-request@ucar.edu>> wrote:
> > Mailing list subscription confirmation notice for mailing list
> > ncl-talk
> >
> > We have received a request from 99.181.226.225 for subscription of
> > your email address, "mdvogelii@gmail.com
> <mailto:mdvogelii@gmail.com>", to the ncl-talk@ucar.edu
> <mailto:ncl-talk@ucar.edu>
> > mailing list. To confirm that you want to be added to this mailing
> > list, simply reply to this message, keeping the Subject: header
> > intact. Or visit this web page:
> >
> >
> >
> http://mailman.ucar.edu/mailman/confirm/ncl-talk/abb51e5fba129361537d45146ea568bbc58ea402
> >
> >
> > Or include the following line -- and only the following line -- in a
> > message to ncl-talk-request@ucar.edu <mailto:ncl-talk-request@ucar.edu>:
> >
> > confirm abb51e5fba129361537d45146ea568bbc58ea402
> >
> > Note that simply sending a `reply' to this message should work from
> > most mail readers, since that usually leaves the Subject: line in the
> > right form (additional "Re:" text in the Subject: is okay).
> >
> > If you do not wish to be subscribed to this list, please simply
>
> - Ignored:
> > disregard this message. If you think you are being maliciously
> > subscribed to the list, or have any other questions, send them to
> > ncl-talk-owner@ucar.edu <mailto:ncl-talk-owner@ucar.edu>.
> >
>
> - Done.
>
>
>
> ---------- Forwarded message ----------
> From: mark vogel <mdvogelii@gmail.com <mailto:mdvogelii@gmail.com>>
> To: ncl-talk-request@ucar.edu <mailto:ncl-talk-request@ucar.edu>
> Date: Tue, 8 Feb 2011 16:53:22 -0500
> Subject: Re: confirm abb51e5fba129361537d45146ea568bbc58ea402
>
>
> On Tue, Feb 8, 2011 at 4:49 PM, <ncl-talk-request@ucar.edu
> <mailto:ncl-talk-request@ucar.edu>> wrote:
>
> Mailing list subscription confirmation notice for mailing list
> ncl-talk
>
> We have received a request from 99.181.226.225 for subscription of
> your email address, "mdvogelii@gmail.com
> <mailto:mdvogelii@gmail.com>", to the ncl-talk@ucar.edu
> <mailto:ncl-talk@ucar.edu>
> mailing list. To confirm that you want to be added to this mailing
> list, simply reply to this message, keeping the Subject: header
> intact. Or visit this web page:
>
> http://mailman.ucar.edu/mailman/confirm/ncl-talk/abb51e5fba129361537d45146ea568bbc58ea402
>
>
> Or include the following line -- and only the following line -- in a
> message to ncl-talk-request@ucar.edu <mailto:ncl-talk-request@ucar.edu>:
>
> confirm abb51e5fba129361537d45146ea568bbc58ea402
>
> Note that simply sending a `reply' to this message should work from
> most mail readers, since that usually leaves the Subject: line in the
> right form (additional "Re:" text in the Subject: is okay).
>
> If you do not wish to be subscribed to this list, please simply
> disregard this message. If you think you are being maliciously
> subscribed to the list, or have any other questions, send them to
> ncl-talk-owner@ucar.edu <mailto:ncl-talk-owner@ucar.edu>.
>
>
>
>
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 9 09:18:33 2011

This archive was generated by hypermail 2.1.8 : Fri Feb 11 2011 - 16:11:42 MST