[Thread Prev][Thread Next][Index]
Re: Problem with calculating derivatives
Hi Glen,
First a quick aside:
The notation
let zz=z[g=ngh]-z[g=ngh]+k
can be replaced by the simpler
let zz=k[g=ngh]
OK -- now for your mystery.
In fact, Ferret is mis-identifying the units "Kelvin", just as you surmised. I
will look into fixing this up -- thanks for pointing it out.
If you try replacing "Kelvin" by (say) "deg. K" you'll find that Ferret issues
a message
yes? define axis/z=0:100:10/unit="deg. K" zz
*** NOTE: unknown axis units: DEG. K
which tells you that it will NOT be incorrectly translating "Deg. K" to some
othe units this time.
- steve
====================================================
Glenn Carver wrote:
> Regarding my last message, I've got a bit further in trying to figure out
> what's going on. It appears as though the problem is arising because of the
> units I use for the vertical axis, in this case 'kelvin' as the axis is
> potential temperature, which Ferret must be translating in some way.
>
> Although I've isolated the problem, I still don't understand what Ferret's
> doing. As kelvin is not a length unit, it ought to leave it alone?
>
> Here's a snippet of Ferret commands that appears to give the correct
> result, followed by a subtle change that makes it go awry.
>
> yes? define axis/z/from_data/name=zx z[g=pv] # PV is coming from a ext.
> file
> yes? define grid/like=pv/z=zx gg
> yes? let p=z[g=gg]
> yes? list/k=1:4 p, p[z=@ddf]
> Z: 329.4 to 457.8
> Column 1: P is Z[G=GG]
> Column 2: P[Z=@DDF] is Z[G=GG] (forward derivative on Z)
> P P
> 344 / 1: 343.9950 1.000000
> 373.2 / 2: 373.1750 1.000000
> 404.8 / 3: 404.8350 1.000000
> 439.2 / 4: 439.1750 1.000000
>
> All ok there. Now suppose I make a subtle change to the axis definition as
> it is actually specified in the netcdf file by declaring what units the
> axis is in.
>
> yes? define axis/z/from_data/name=zx/units=kelvin z[g=pv]
> Replacing definition of axis ZX
> *** NOTE: 31 words of axis coordinate storage lost
> yes? list/k=1:4 p, p[z=@ddf]
> Z (KELVIN): 329.4 to 457.8
> Column 1: P is Z[G=GG]
> Column 2: P[Z=@DDF] is Z[G=GG] (forward derivative on Z)
> P P
> 344 / 1: 343.9950 39.37008
> 373.2 / 2: 373.1750 39.37008
> 404.8 / 3: 404.8350 39.37008
> 439.2 / 4: 439.1750 39.37008
>
> And back comes the problem. So what's Ferret got against kelvin as a unit
> for vertical coordinates?? Or am I missing something?
>
> One of the things I find disconcerting about Ferret is that so much happens
> behind the scenes without much feedback for the user. If Ferret is doing
> some kind of conversion to metres here for kelvin (though god knows how
> because I've not given it a temperature profile), it would be nice to be
> told; set mode diagnostic doesn't really help.
>
> Regards,
> Glenn
>
> ----
> Dr. Glenn Carver, Senior Research Associate,
> Centre for Atmospheric Science, Chemistry Dept., Cambridge University, UK
> mailto:Glenn.Carver@atm.ch.cam.ac.uk http://www.atm.ch.cam.ac.uk/~glenn/
>
> "I never think of the future, it comes soon enough"
> - Albert Einstein
--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement