[Thread Prev][Thread Next][Index]

Re: [ferret_users] ferret inconsistency/errors in masking



Hi Lev,
It's a bit hard to tell without seeing what the grids of the different variables are, and so on, but I imagine that this may have to do with the order of operations as the expression is being evaluated. You have some regridding operations going on in conjunction with the IF test. In the incorrect result you show below, is it showing H*(1.-0.91/1.028)?

To test that, try some different ways to make the definitions. Try:

   let hd  = if ifloat[g=h] GT 0.9 THEN H*(1.-0.91/1.028) ELSE HDG-SLEV
or
let hd = if ifloat[g=h] GT 0.9 THEN H*(1.-0.91/1.028) ELSE HDG[g=h]-SLEV[g-h]

Also does "cancel mode interpolate" make a difference?

Finally, looking at the output when "set mode diagnostic" is turned on may give us an idea. It'll show variables being read or loaded into memory and grids being reconciled with one another as the expression is evaluated.

Ansley

On 2/25/2014 6:36 PM, Lev Tarasov wrote:
I'm trying to merge some data sets, and get inconsistent
results:

For instance, variable hd, defined as follows:
yes?show var hd
 HD = IF IFLOAT GT 0.9 THEN H*(1.-0.91/1.028) ELSE HDG-SLEV
should equal hdg-slev for the following region, since ifloat=0:

yes? stats ifloat[g=h]
             IF H*0.91/1.028 LT SLEV+HP THEN 1 ELSE 0
             LONGITUDE: 89W (interpolated)
             LATITUDE: 36.5N (interpolated)
             Z:  N/A
             T: -121 to -33
             E:  N/A
             F:  N/A
             DATA SET: ./idHept.nn9894

 Total # of data points: 44 (1*1*1*44*1*1)
 # flagged as bad  data: 0
 Minimum value: 0
 Maximum value: 0
 Mean    value: 0 (unweighted average)
 Standard deviation: 0

but it doesn't:

yes? stats hd[g=h]-(hdg[g=h]-slev[g=h])

             HD[G=H]-(HDG[G=H]-SLEV[G=H])
             LONGITUDE: 89W (interpolated)
             LATITUDE: 36.5N (interpolated)
             Z:  N/A
             T: -121 to -33
             E:  N/A
             F:  N/A
             DATA SET: ./idHept.nn9894

 Total # of data points: 44 (1*1*1*44*1*1)
 # flagged as bad  data: 0
 Minimum value: -84.7
 Maximum value: 92.7
 Mean    value: -29.884 (unweighted average)
 Standard deviation: 46.089

     FERRET v6.84
     Linux 2.6.9-101.ELsmp 64-bit - 07/19/13

How do I fix this or is it a bug?

Cheers,

lev

Lev Tarasov -   Dept of Physics and Physical Oceanography,
        Memorial University of Newfoundland.
                email: lev@xxxxxx
                http://www.physics.mun.ca/~lev/
        Tel (709)-864-2675
        Fax (709)-864-8739



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement