[Thread Prev][Thread Next][Index]
Re: [ferret_users] @LOC
Hi All,
One comment on David's question and answers/examples for @LOC,
@WEQ and integrating/averaging over mixed layer/isotherms.
For finding the depth of a "given isotherm" from time varying temperature
field, you need to use a SCALAR value itself with @LOC. Though your
temperature field is changing with time, the value of intended isotherm is
not. Please see the example below.
To be precise, you need @WEQ in more complex situations. Suppose you
want to find salinity on 26 Deg_C isotherm (see the example below),
or value at deepest depth etc., then you need to use @WEQ. Ferret manual
and FAQ have nice examples, illustrating where @WEQ comes very handy.
In case you want to use the result of @LOC (say, depth of isotherm
or depth of mixed layer etc.) in some other calculation (say for averaging
or integrating), you have to use the "IF .....THEN....ELSE" masking method.
(none of @LOC or @WEQ will work for this purpose). This method relies on
setting all values outside the interested region to missing values and then
averaging/integrating over the entire axis. This method can be used for
integrating over mixed layer depth, which Yangxing and Peter were trying to
figure out. (If I was in your situation, I will interpolate the variable to
reasonably high resolution z-axis before such integration, to avoid problems
with vertical resolution of source data and values of MLD/isotherm depth.)
Please let me know if you have any questions,
Thanks and Regards,
Jaison
!-------Example starts here ------------------
\ cancel mode verify
! make two XYZT variables
use levitus_climatology
define axis/t="15-JAN-1900":"15-DEC-1900":30/units=days/calendar=360_DAYS\
/T0=30-DEC-1899 tclim
let te = temp[d=1] + SIN(t[gt=tclim])*COS(z[gz=temp,d=1])
let sa = salt[d=1] + SIN(t[gt=tclim])*COS(z[gz=temp,d=1])
show grid te
! find the depth of 26 deg_C isotherm
let z_26C = te[z=@LOC:26]
fill/lev=(0,180,10) /l=1/title="Depth of 26 Deg_C Isotherm : JAN" z_26C
pause
fill/lev=(0,180,10) /l=8/title="Depth of 26 Deg_C Isotherm : AUG" z_26C
pause
! now, say you want to find value of salinity on 26 Deg_C isotherm, then
let kernel_26C = te[z=@WEQ:26]
let salt_26C_all = sa * kernel_26C
let salt_26C = salt_26C_all[z=@SUM]
fill/lev=(32,37.5,0.25) /l=1/title="Salinity on 26 Deg_C Isotherm : JAN" salt_26C
! to find the average temperature between surface and depth of 26 Deg_C
! isotherm, use the masking method.
! (note that z_26C varies in time, as do temperature)
let mask_z26C = IF z[gz=te] LE z_26C THEN 1 ! ELSE missing values assumed
! let us have a look at this mask
list/x=60/y=10 z_26C[l=1], z_26C[l=8]
list/x=60/y=10 mask_z26C[l=1], mask_z26C[l=8] ; pause
! set values deeper than 26 Deg_C isotherm as missing values
let temp_0_26C = te * mask_z26C
list/x=60/y=10 temp_0_26C[l=1], temp_0_26C[l=8] ; pause
! do the integration or averaging whatever.....
let temp_av = temp_0_26C[z=@AVE]
fill/lev=(24,30,0.25) /l=1\
/title="Temperature Averaged between surface & 26 Deg_C Isotherm : JAN" temp_av
!-------Example ends here ------------------
> Hi David,
> Take a look at @WEQ. The documentation in Chapter 3 of the Users Guide
> shows a couple of examples that should point you in the right
> direction. (also search the archives for "isotherm" and you'll find
> several discussions.)
>
> Ansley
>
> David Wang wrote:
>> Hi Ferreters,
>>
>> I suppose @LOC transformation takes only scalars, doesn't it? So isn't
>> it possible to locate, for instance, the depth of the isotherm of the
>> time-varying temperature given in an expression? Just in case there
>> are hidden tricks that I'm not aware of.
>>
>> Thanks,
>> David
>>
>
[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Privacy Policy | Disclaimer | Accessibility Statement